Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Regression in BigQuery offline store caused by newer pydantic versions #4280

Closed
galen-ft opened this issue Jun 14, 2024 · 4 comments · Fixed by #4509
Closed

Bug: Regression in BigQuery offline store caused by newer pydantic versions #4280

galen-ft opened this issue Jun 14, 2024 · 4 comments · Fixed by #4509

Comments

@galen-ft
Copy link
Contributor

galen-ft commented Jun 14, 2024

Expected Behavior

Calls to store = FeatureStore(repo_path=repo_path) for a BigQuery offline store should just work.

Current Behavior

Running store = FeatureStore(repo_path=repo_path) for a BigQuery offline store causes:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: 'pydantic_core._pydantic_core.ValidationInfo' object is not subscriptable

This happens on line 108 in bigquery.py#L108.

Likely cause

pydantic>=2.0.0 changed the ValidationInfo object.

The setup.py for feast >= v0.36.0 requires that pydantic>=2.0.0.

Last known successful configuration:

Steps to reproduce

Example feature_store.yaml:

project: my_feature_repo
registry: gs://.../registry.db
# The provider AWS used for the online store.
# Mixing AWS and GCP should be okay provided that offline store type is specified.
provider: aws
offline_store:
    type: bigquery
    billing_project_id: some-project-id
    dataset: latest
    gcs_staging_location: gs://...
    location: EU
    project_id: some-project-id
online_store:
  type: redis
  connection_string: ...

entity_key_serialization_version: 2
import os
# Credentials for GCP
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="GCP_keyfile.json"
from feast import FeatureStore, RepoConfig


if __name__ == "__main__":
    # repo_path must contain the GCP_keyfile.json and feature_store.yaml files
    repo_path = "./"
    assert os.path.exists(repo_path)
    # Create a feature store object
    store = FeatureStore(repo_path=repo_path) # <--- Error occurs here

Specifications

  • Version: feast v0.38.0
  • Platform: x86-64 Ubuntu 22.04.3 LTS as well as arm64 Mac OS Sonoma 14.4.1
  • Subsystem:

Possible Solution

On first try, using values.data["project_id"] instead of values["project_id"] in the pydantic.field_validator for billing_project_id in bigquery.py#L108 should work:

@field_validator("billing_project_id")
    def project_id_exists(cls, v, values, **kwargs):
        # if v and not values["project_id"]:
        if v and not values.data["project_id"]:
            raise ValueError(
                "please specify project_id if billing_project_id is specified"
            )
        return v

More testing is needed before I can make a PR.

@galen-ft galen-ft changed the title Regression in BigQuery offline store caused by newer pydantic versions Bug: Regression in BigQuery offline store caused by newer pydantic versions Jun 14, 2024
@charlieviettq
Copy link

the same issue with feast v0.39.0

@tokoko
Copy link
Collaborator

tokoko commented Jun 26, 2024

@galen-ft Let me know if you're planning to open a PR for this

@jgesche
Copy link
Contributor

jgesche commented Sep 10, 2024

Same issue with feast v0.40.1. I have opened a PR. @galen-ft I just used your proposed solution for the issue. Have you made any progress on your end, or do you have any other ideas on how to fix it better or differently?

@galen-ft
Copy link
Contributor Author

Hi @tokoko and @jgesche, and apologies for my late reply. I've been quite busy during the summer so I haven't had the chance to investigate a better fix. I'll try to do it as soon as I get some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants