fix: Fix Shared SQL/Snowflake registry crashes on cross-project UDF deserialization by ntkathole · Pull Request #6427 · feast-dev/feast
What this PR does / why we need it:
When multiple Feast projects share a single registry (PostgreSQL, S3, or Snowflake), operations like feast apply, REST API listing (/features/all), and UI dashboard crash with ModuleNotFoundError because the registry eagerly deserializes UDFs (via dill.loads()) from all projects — including those whose Python modules aren't installed in the current environment.
This PR fixes the crash at two layers:
Layer 1: Cache building (proto() method) — SQL & Snowflake registries
- Added a proto_only parameter to _list_objects() that returns raw protobuf objects without calling from_proto(), completely bypassing dill.loads().
- Refactored proto() to use _list_objects(proto_only=True) when building the in-memory cache, restoring the clean lister-loop pattern.
Layer 2: REST API / gRPC listing — All registry types
- Threaded a skip_udf parameter through the registry stack: base_registry → caching_registry / registry / snowflake / remote → proto_registry_utils.
- gRPC handlers
(ListFeatureViews, ListStreamFeatureViews, ListOnDemandFeatureViews, ListAllFeatureViews, ListFeatures)pass skip_udf=True so metadata listing never triggers dill.loads(). - Preserved full API response fidelity: when skip_udf=True, the raw transformation proto is stored on the Python object and used directly in to_proto(), so the response (including UDF source text, binary body, name, mode) is identical to the non-skip path.