feast-dev / feast-dev/feast

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

Open
#5,679 2 comments 0 reactions 0 assignees View on GitHub
kind/bug priority/p2
Dominant language
Python
Stars
7.3k
Forks
1.4k
Avg merge
1d 21h
Merged PRs (30d)
15

Description

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
```

2. Apply to SQL registry (PostgreSQL):
```
feast apply
```

3. 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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.