René's URL Explorer Experiment


Title: On-demand feature view UDFs lose their module globals when rebuilt from the registry, so serving fails with NameError · Issue #6815 · feast-dev/feast · GitHub

Open Graph Title: On-demand feature view UDFs lose their module globals when rebuilt from the registry, so serving fails with NameError · Issue #6815 · feast-dev/feast

X Title: On-demand feature view UDFs lose their module globals when rebuilt from the registry, so serving fails with NameError · Issue #6815 · feast-dev/feast

Description: Expected Behavior An OnDemandFeatureView whose UDF calls a helper (or reads a constant/import) defined at its own module level should keep working when the view is loaded back from the registry — e.g. in a feature server, or any process ...

Open Graph Description: Expected Behavior An OnDemandFeatureView whose UDF calls a helper (or reads a constant/import) defined at its own module level should keep working when the view is loaded back from the registry — e...

X Description: Expected Behavior An OnDemandFeatureView whose UDF calls a helper (or reads a constant/import) defined at its own module level should keep working when the view is loaded back from the registry — e...

Opengraph URL: https://github.com/feast-dev/feast/issues/6815

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"On-demand feature view UDFs lose their module globals when rebuilt from the registry, so serving fails with NameError","articleBody":"## Expected Behavior\n\nAn OnDemandFeatureView whose UDF calls a helper (or reads a constant/import) defined\nat its own module level should keep working when the view is loaded back from the\nregistry — e.g. in a feature server, or any process that did not define the view itself.\n\n## Current Behavior\n\nThe UDF is rebuilt from its stored source text only, so every name it resolves from\nits defining module is missing, and the transformation fails at call time:\n\n```\nNameError: name 'scaled' is not defined\n```\n\n`PandasTransformation.from_proto` / `PythonTransformation.from_proto` prefer\n`rehydrate_udf_from_source` over the stored dill body. That function `exec`s **only the\nfunction's own source** into a fresh namespace seeded with just `pd`/`pandas`/`np`/`numpy`\n(`sdk/python/feast/transformation/udf_rehydrate.py:102`), so a module-level helper,\nconstant, or an import under any other alias is not present.\n\nThe `exec` itself still succeeds, because a function body's free variables are only\nresolved when the function is *called*. So `resolve_udf`\n(`sdk/python/feast/transformation/udf_rehydrate.py:160`) treats rehydration as\nsuccessful and **never falls back to the dill body** — even when that body would have\nworked. The failure surfaces later, during retrieval.\n\n## Steps to reproduce\n\nApply an ODFV from a script/notebook, so dill serializes the UDF by value and captures\nits globals:\n\n```python\nSCALE = 100.0\n\ndef scaled(x):\n    return x * SCALE\n\n@on_demand_feature_view(\n    sources=[stats, req],\n    schema=[Field(name=\"conv_rate_scaled\", dtype=Float64)],\n)\ndef scaled_rate(inputs: pd.DataFrame) -> pd.DataFrame:\n    df = pd.DataFrame()\n    df[\"conv_rate_scaled\"] = scaled(inputs[\"conv_rate\"]) + inputs[\"bonus\"]\n    return df\n\nfs.apply([driver, src, stats, req, scaled_rate])\nfs.materialize_incremental(datetime(2026, 6, 1))\n```\n\nThen read it back in a separate process that only has the registry (what a feature\nserver does):\n\n```python\nfs = FeatureStore(repo_path=\".\")\nfs.get_online_features(\n    features=[\"driver_stats:conv_rate\", \"scaled_rate:conv_rate_scaled\"],\n    entity_rows=[{\"driver_id\": 1001, \"bonus\": 1.0}],\n).to_dict()\n# NameError: name 'scaled' is not defined\n```\n\nMonkeypatching `from_proto` back to the previous dill-only behaviour, in the same\nprocess and against the same registry, returns the correct result:\n\n```python\n@classmethod\ndef _old_from_proto(cls, p):\n    return PandasTransformation(udf=dill.loads(p.body), udf_string=p.body_text)\n\nPandasTransformation.from_proto = _old_from_proto\n# -> conv_rate_scaled=[51.0]\n```\n\nSo the registry demonstrably holds a working body that is being ignored.\n\nBoth transformation modes are affected — a bare proto round-trip is enough to show it:\n\n```python\nt  = PythonTransformation(udf=py_udf, udf_string=src)   # py_udf calls helper()\nrt = PythonTransformation.from_proto(t.to_proto())\n\nt.udf({\"a\": [1, 2]})    # {'out': [3, 6]}\nrt.udf({\"a\": [1, 2]})   # NameError: name 'helper' is not defined\n```\n\n### Specifications\n\n- Version: `master` @ `5ad5592390febfca60c9d88edf7daccbdd156fd6` (source-first rehydration added in #6655)\n- Platform: Linux x86_64, Python 3.11.15\n- Subsystem: on-demand feature views / transformation serialization\n\n## Possible Solution\n\nMake the \"is this rehydrated callable usable?\" check non-vacuous before accepting it.\nWalk the compiled function's `co_names` (recursively through nested code objects) and\nconfirm each is resolvable in the exec namespace or in builtins; if any name is missing,\nreturn `None` so `resolve_udf` falls back to the dill body as it did before.\n\nA `NameError`-catching wrapper that retries via dill on first call would also work, but\nvalidating up front keeps the failure out of the serving path entirely.\n\nWorth noting this is distinct from #5620, which covers the dill-by-reference case where\nthe defining module genuinely is not importable. The problem here is that source-first\nrehydration is chosen even when the stored dill body would succeed, so a setup that\npreviously served correctly now raises.\n\nI'm happy to put up a PR for this if the validate-then-fall-back approach looks right.\n","author":{"url":"https://github.com/Daksha1611","@type":"Person","name":"Daksha1611"},"datePublished":"2026-09-06T17:16:31Z","url":"https://github.com/feast-dev/feast/issues/6815"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e0345ee7-f0ff-5979-c551-fc166886a245
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB032:2826BD:E3559B:12AEC04:6AFE922B
html-safe-nonce51b927d077a8e75a4dd8f46b203d7368b7790a36f7f14aa33a7d8d297e70feed
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDMyOjI4MjZCRDpFMzU1OUI6MTJBRUMwNDo2QUZFOTIyQiIsInZpc2l0b3JfaWQiOiI4MzQ3NDMxMDQ5NzkyNDM1NjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb3030661bf106cadc16ba3105167895a56b66d8b4ebf1c46078058b83781b2bc
hovercard-subject-tagissue:5366471921
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/6815/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4340efab21e70ad0cdaec4ce9f2ff349d8aad15feb4cd15f9a980516dceb6d8b/feast-dev/feast/issues/6815
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4340efab21e70ad0cdaec4ce9f2ff349d8aad15feb4cd15f9a980516dceb6d8b/feast-dev/feast/issues/6815
og:image:altExpected Behavior An OnDemandFeatureView whose UDF calls a helper (or reads a constant/import) defined at its own module level should keep working when the view is loaded back from the registry — e...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDaksha1611
hostnamegithub.com
expected-hostnamegithub.com
Noneb3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86
turbo-cache-controlno-preview
go-importgithub.com/feast-dev/feast git https://github.com/feast-dev/feast.git
octolytics-dimension-user_id57027613
octolytics-dimension-user_loginfeast-dev
octolytics-dimension-repository_id161133770
octolytics-dimension-repository_nwofeast-dev/feast
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id161133770
octolytics-dimension-repository_network_root_nwofeast-dev/feast
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4a10310af51a1bfffbedc4fd81cb582acf0cb0ff
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/feast-dev/feast/issues/6815#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffeast-dev%2Ffeast%2Fissues%2F6815
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffeast-dev%2Ffeast%2Fissues%2F6815
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=feast-dev%2Ffeast
Reloadhttps://github.com/feast-dev/feast/issues/6815
Reloadhttps://github.com/feast-dev/feast/issues/6815
Reloadhttps://github.com/feast-dev/feast/issues/6815
feast-devhttps://github.com/feast-dev
feasthttps://github.com/feast-dev/feast
Codehttps://github.com/feast-dev/feast
Issues223 (223)https://github.com/feast-dev/feast/issues
Pull requests143 (143)https://github.com/feast-dev/feast/pulls
Discussionshttps://github.com/feast-dev/feast/discussions
Actionshttps://github.com/feast-dev/feast/actions
Security and quality1 (1)https://github.com/feast-dev/feast/security
Insightshttps://github.com/feast-dev/feast/insights
https://github.com/feast-dev/feast
New issuehttps://github.com/login?return_to=https://github.com/feast-dev/feast/issues/6815
New issuehttps://github.com/login?return_to=https://github.com/feast-dev/feast/issues/6815
#6816https://github.com/feast-dev/feast/pull/6816
#6891https://github.com/feast-dev/feast/pull/6891
On-demand feature view UDFs lose their module globals when rebuilt from the registry, so serving fails with NameErrorhttps://github.com/feast-dev/feast/issues/6815#top
#6816https://github.com/feast-dev/feast/pull/6816
#6891https://github.com/feast-dev/feast/pull/6891
https://github.com/Daksha1611
Daksha1611https://github.com/Daksha1611
on Sep 6, 2026https://github.com/feast-dev/feast/issues/6815#issue-5366471921
fix: UDF/ODFV source rehydrate (+ Postgres / online cache) #6655https://github.com/feast-dev/feast/pull/6655
#5620https://github.com/feast-dev/feast/issues/5620
shuchuhttps://github.com/shuchu
completedhttps://github.com/feast-dev/feast/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#6816https://github.com/feast-dev/feast/pull/6816
on Nov 10, 2026https://github.com/feast-dev/feast/issues/6815#event-35645564977
Sign up for freehttps://github.com/signup?return_to=https://github.com/feast-dev/feast/issues/6815
Sign in to commenthttps://github.com/login?return_to=https://github.com/feast-dev/feast/issues/6815
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.