Skip to content

Remote registry client fails with ModuleNotFoundError: No module named 'grpc' unless the unrelated [grpcio] extra is installed #6666

Description

@BigyaPradhan

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

  1. pip install "feast[postgres]==0.64.0" in a clean virtualenv.

  2. feature_store.yaml:

    project: demo
    registry:
      registry_type: remote
      path: registry.example:80
    provider: local
  3. from feast import FeatureStore
    FeatureStore(repo_path=".").list_feature_views()
  4. 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.

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions