Expected Behavior
Installing Feast with any extra that supports a remote registry, and configuring
registry_type: remote, should work — grpcio should be present because the
remote registry client cannot run without it.
Current Behavior
sdk/python/feast/infra/registry/remote.py does an unconditional module-level
import grpc. grpcio is declared only in the grpcio optional-dependency
group in pyproject.toml, and no other extra depends on it. So an install such
as pip install feast[redis] or feast[postgres] resolves cleanly and then
fails at runtime as soon as the remote registry is constructed:
ModuleNotFoundError: No module named 'grpc'
The grpcio extra reads as being about serving gRPC (it also pulls
grpcio-reflection and grpcio-health-checking, which a client does not need),
so there is nothing to suggest a registry client requires it. The failure
surfaces only at runtime, in a code path unrelated to anything the user
installed.
Steps to reproduce
-
pip install "feast[postgres]==0.64.0" in a clean virtualenv.
-
feature_store.yaml:
project: demo
registry:
registry_type: remote
path: registry.example:80
provider: local
-
from feast import FeatureStore
FeatureStore(repo_path=".").list_feature_views()
-
Fails with ModuleNotFoundError: No module named 'grpc'.
Specifications
- Version: 0.64.0; unchanged on 0.65.0 (latest release) and
master. On 0.65.0
the redis extra pulls only redis and hiredis, and grpcio remains
declared solely in the grpcio extra.
- Platform: Linux, Python 3.12
- Subsystem: packaging / registry —
feast.infra.registry.remote
Possible Solution
The dependency has to become reachable — the only question is how.
- Move
grpcio into the core dependencies. The remote registry is a
first-class registry type, and grpcio ships a wheel on every supported
platform. This is the only option that fixes an existing
pip install feast[postgres] without the user changing anything.
- Add a client-only extra (for example
remote) that pulls just grpcio,
and document it as required for registry_type: remote. Users still have to
edit their install line, but there is then a correct one to point them at. The
existing grpcio extra is a poor substitute: it also pulls
grpcio-reflection and grpcio-health-checking, which a registry client
does not need, and its name reads as being about serving gRPC.
A lazy import that raises a clear Feast error naming the extra would be an
improvement on the bare ModuleNotFoundError, but it is worth being explicit
that it does not fix this: the remote registry still cannot run, the call
still fails, and the user is still stuck until the dependency is installed. Good
diagnostics are worth having alongside (1) or (2), not instead of them.
Our workaround is to add grpcio to the dependency set of the module that builds
the store, which is invisible to anyone reading pyproject.toml for what a
remote registry needs.
Expected Behavior
Installing Feast with any extra that supports a remote registry, and configuring
registry_type: remote, should work —grpcioshould be present because theremote registry client cannot run without it.
Current Behavior
sdk/python/feast/infra/registry/remote.pydoes an unconditional module-levelimport grpc.grpciois declared only in thegrpciooptional-dependencygroup in
pyproject.toml, and no other extra depends on it. So an install suchas
pip install feast[redis]orfeast[postgres]resolves cleanly and thenfails at runtime as soon as the remote registry is constructed:
The
grpcioextra reads as being about serving gRPC (it also pullsgrpcio-reflectionandgrpcio-health-checking, which a client does not need),so there is nothing to suggest a registry client requires it. The failure
surfaces only at runtime, in a code path unrelated to anything the user
installed.
Steps to reproduce
pip install "feast[postgres]==0.64.0"in a clean virtualenv.feature_store.yaml:Fails with
ModuleNotFoundError: No module named 'grpc'.Specifications
master. On 0.65.0the
redisextra pulls onlyredisandhiredis, andgrpcioremainsdeclared solely in the
grpcioextra.feast.infra.registry.remotePossible Solution
The dependency has to become reachable — the only question is how.
grpciointo the core dependencies. The remote registry is afirst-class registry type, and
grpcioships a wheel on every supportedplatform. This is the only option that fixes an existing
pip install feast[postgres]without the user changing anything.remote) that pulls justgrpcio,and document it as required for
registry_type: remote. Users still have toedit their install line, but there is then a correct one to point them at. The
existing
grpcioextra is a poor substitute: it also pullsgrpcio-reflectionandgrpcio-health-checking, which a registry clientdoes not need, and its name reads as being about serving gRPC.
A lazy import that raises a clear Feast error naming the extra would be an
improvement on the bare
ModuleNotFoundError, but it is worth being explicitthat it does not fix this: the remote registry still cannot run, the call
still fails, and the user is still stuck until the dependency is installed. Good
diagnostics are worth having alongside (1) or (2), not instead of them.
Our workaround is to add
grpcioto the dependency set of the module that buildsthe store, which is invisible to anyone reading
pyproject.tomlfor what aremote registry needs.