feast icon indicating copy to clipboard operation
feast copied to clipboard

IndexError: tuple index out of range when initializing FeatureStore with on-demand feature views on Python 3.11

Open abhijeet-dhumal opened this issue 4 months ago • 2 comments

On-demand features fail on Python 3.11 due to dill serialization issues:

  • dill.dumps() fails during FeatureStore initialization → IndexError: tuple index out of range
  • dill.loads() fails during feature retrieval → EOFError: Ran out of input

Expected Behavior

FeatureStore should initialize successfully and on-demand features should work.

Current Behavior

FeatureStore.init() fails with IndexError: tuple index out of range when loading on-demand feature views from a SQL registry on Python 3.11. The error occurs during proto serialization of the UDF via dill.dumps().

IndexError: tuple index out of range
  File "feast/feature_store.py", line 158, in __init__
    self._registry = SqlRegistry(registry_config, self.config.project, None)
  File "feast/infra/registry/sql.py", line 272, in __init__
    self.cached_registry_proto = self.proto()
  File "feast/infra/registry/sql.py", line 866, in process_project
    obj_protos = [obj.to_proto() for obj in objs]
  File "feast/on_demand_feature_view.py", line 318, in to_proto
    self.feature_transformation.to_proto()
  File "feast/transformation/base.py", line 95, in to_proto
    body=dill.dumps(self.udf, recurse=True),
  File "dill/_dill.py", line 420, in dump
    StockPickler.dump(self, obj)
  File "dill/detect.py", line 148, in nestedglobals
    dis.dis(func)
  File "dis.py", line 467, in _get_instructions_bytes
    argval, argrepr = _get_name_info(arg, get_name)
  File "dis.py", line 390, in _get_name_info
    argval = get_name(name_index, **extrainfo)
IndexError: tuple index out of range

Steps to reproduce

  1. Define on-demand feature view:
@on_demand_feature_view(
    sources=[base_features],
    schema=[Field(name="transformed_feature", dtype=Float64)],
)
def feature_transformations(inputs: pd.DataFrame) -> pd.DataFrame:
    df = pd.DataFrame()
    df["transformed_feature"] = inputs["base_feature"] / 100
    return df
  1. Apply to SQL registry (PostgreSQL):
feast apply
  1. Try to initialize FeatureStore on Python 3.11:
from feast import FeatureStore
store = FeatureStore(repo_path="/path/to/repo") 

Specifications

  • Feast version: 0.54.0
  • Python version: 3.11.x
  • Registry type: PostgreSQL (SQL registry with psycopg2)
  • Offline store: Ray
  • OS: Red Hat UBI 9 (Linux)
  • dill version: 0.3.8, 0.3.9 (both fail)

abhijeet-dhumal avatar Oct 19 '25 10:10 abhijeet-dhumal

https://github.com/uqfoundation/dill/issues/727

abhijeet-dhumal avatar Oct 19 '25 11:10 abhijeet-dhumal

The bug is described in this issue: https://github.com/apache/airflow/issues/35307

I discussed this on slack. tl;dr use py 3.10/3.12 https://feastopensource.slack.com/archives/C01M2GYP0UC/p1738614864856059

Issue can be closed, if anything this has to be handled on by dill.

jfw-ppi avatar Nov 28 '25 13:11 jfw-ppi