GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — On-demand feature view UDFs lose their module globals when rebuilt from the registry, so serving fails with NameError · Issue #6815 · feast-dev/feast DescriptionExpected BehaviorAn OnDemandFeatureView whose UDF calls a helper (or reads a constant/import) defined Current BehaviorThe UDF is rebuilt from its stored source text only, so every name it resolves from
The Steps to reproduceApply an ODFV from a script/notebook, so dill serializes the UDF by value and captures SCALE = 100.0 def scaled(x): return x * SCALE @on_demand_feature_view( sources=[stats, req], schema=[Field(name="conv_rate_scaled", dtype=Float64)], ) def scaled_rate(inputs: pd.DataFrame) -> pd.DataFrame: df = pd.DataFrame() df["conv_rate_scaled"] = scaled(inputs["conv_rate"]) + inputs["bonus"] return df fs.apply([driver, src, stats, req, scaled_rate]) fs.materialize_incremental(datetime(2026, 6, 1)) Then read it back in a separate process that only has the registry (what a feature fs = FeatureStore(repo_path=".") fs.get_online_features( features=["driver_stats:conv_rate", "scaled_rate:conv_rate_scaled"], entity_rows=[{"driver_id": 1001, "bonus": 1.0}], ).to_dict() # NameError: name 'scaled' is not defined Monkeypatching @classmethod def _old_from_proto(cls, p): return PandasTransformation(udf=dill.loads(p.body), udf_string=p.body_text) PandasTransformation.from_proto = _old_from_proto # -> conv_rate_scaled=[51.0] So the registry demonstrably holds a working body that is being ignored. Both transformation modes are affected — a bare proto round-trip is enough to show it: t = PythonTransformation(udf=py_udf, udf_string=src) # py_udf calls helper() rt = PythonTransformation.from_proto(t.to_proto()) t.udf({"a": [1, 2]}) # {'out': [3, 6]} rt.udf({"a": [1, 2]}) # NameError: name 'helper' is not defined Specifications
Possible SolutionMake the "is this rehydrated callable usable?" check non-vacuous before accepting it. A Worth noting this is distinct from #5620, which covers the dill-by-reference case where I'm happy to put up a PR for this if the validate-then-fall-back approach looks right. ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |