Repository navigation
fix: Version Snowflake materialization UDFs instead of replacing them - #7232
Draft
daniel-kristjansson wants to merge 3 commits into
Draft
daniel-kristjansson wants to merge 3 commits into
daniel-kristjansson wants to merge 3 commits into
Conversation
feast-dev#6608 made every `feast apply` redeploy the materialization UDFs with CREATE OR REPLACE FUNCTION. Replacing (or dropping) a function requires owning it, which fails in schemas whose future-ownership grants hand new objects to another role, and every Feast version sharing a schema runs whichever UDFs were applied last. UDFs are now named `feast_<project>_<fingerprint>_*`, where the fingerprint hashes the packaged Feast source, the creation SQL template and python_udf_runtime_version, and their zip is uploaded to `<stage>/<project>_<fingerprint>/`. They are created with CREATE FUNCTION IF NOT EXISTS and never replaced. A runtime-version change still takes effect, because it deploys a new set. update() checks with SHOW USER FUNCTIONS and returns early when the current set exists, so materializing needs no CREATE or WRITE privileges once the UDFs are deployed. Materialization runs the idempotent deployment once per engine, so a new Feast version works before anyone runs `feast apply`. Teardown now also drops the seven snowflake_array_*_proto UDFs it was missing, and warns instead of raising when the UDFs cannot be dropped, so the rest of the teardown (e.g. registry deletion) still runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Daniel Kristjansson <danielk@cuymedia.net>
Contributor
There was a problem hiding this comment.
Devin Review found 3 potential issues.
4 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
daniel-kristjansson
marked this pull request as draft
November 24, 2026 18:56
…E pattern Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Daniel Kristjansson <danielk@cuymedia.net>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Daniel Kristjansson <danielk@cuymedia.net>
daniel-kristjansson
force-pushed
the
fix/versioned-snowflake-udfs
branch
from
November 24, 2026 19:14
b810198 to
ef209c9
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
In production we don't want services to be able to modify UDFs that are already deployed. The UDFs run inside every materialization, so they should change only through a deliberate deployment, not as a side effect of whichever service last ran
feast applyor materialized.#6608 works against that: every
feast applyredeploys the Snowflake materialization UDFs withCREATE OR REPLACE FUNCTION. As a result:feast applyfail.This PR makes deployed UDFs immutable by content-addressing them:
feast_<project>_<fingerprint>_*. The 8-character fingerprint hashes the packaged Feast source files, the UDF creation SQL template andpython_udf_runtime_version. The zip is uploaded to<stage>/<project>_<fingerprint>/.CREATE FUNCTION IF NOT EXISTSand never replaced. A change topython_udf_runtime_version(the case fix: Bump decommissioned Snowflake Python UDF runtime from 3.9 to 3.10 (#6606) #6608 fixed) still takes effect, because it produces a new fingerprint and deploys a new set alongside the old one.update()restores an existence check (SHOW USER FUNCTIONS) and returns early when the current set already exists. Once the UDFs are deployed, services that apply or materialize need no CREATE, WRITE or ownership privileges on them.feast apply.snowflake_array_*_protoUDFs that the deletion SQL was missing. If the UDFs can't be dropped (for example, because the role doesn't own them), it warns instead of raising, so the rest of the teardown, such as deleting the registry, still runs.Which issue(s) this PR fixes:
Follow-up to #6608.
Misc
🤖 Generated with Claude Code