1010 Dict ,
1111 Iterator ,
1212 List ,
13+ Literal ,
1314 Optional ,
1415 Tuple ,
1516 Union ,
1920import pandas as pd
2021import pyarrow
2122import pyarrow .parquet
22- from pydantic import ConstrainedStr , StrictStr , validator
23- from pydantic .typing import Literal
23+ from pydantic import StrictStr , field_validator
2424from tenacity import Retrying , retry_if_exception_type , stop_after_delay , wait_fixed
2525
2626from feast import flags_helper
@@ -72,13 +72,6 @@ def get_http_client_info():
7272 return http_client_info .ClientInfo (user_agent = get_user_agent ())
7373
7474
75- class BigQueryTableCreateDisposition (ConstrainedStr ):
76- """Custom constraint for table_create_disposition. To understand more, see:
77- https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationLoad.FIELDS.create_disposition"""
78-
79- values = {"CREATE_NEVER" , "CREATE_IF_NEEDED" }
80-
81-
8275class BigQueryOfflineStoreConfig (FeastConfigBaseModel ):
8376 """Offline store config for GCP BigQuery"""
8477
@@ -102,10 +95,15 @@ class BigQueryOfflineStoreConfig(FeastConfigBaseModel):
10295 gcs_staging_location : Optional [str ] = None
10396 """ (optional) GCS location used for offloading BigQuery results as parquet files."""
10497
105- table_create_disposition : Optional [BigQueryTableCreateDisposition ] = None
106- """ (optional) Specifies whether the job is allowed to create new tables. The default value is CREATE_IF_NEEDED."""
98+ table_create_disposition : Literal [
99+ "CREATE_NEVER" , "CREATE_IF_NEEDED"
100+ ] = "CREATE_IF_NEEDED"
101+ """ (optional) Specifies whether the job is allowed to create new tables. The default value is CREATE_IF_NEEDED.
102+ Custom constraint for table_create_disposition. To understand more, see:
103+ https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationLoad.FIELDS.create_disposition
104+ """
107105
108- @validator ("billing_project_id" )
106+ @field_validator ("billing_project_id" )
109107 def project_id_exists (cls , v , values , ** kwargs ):
110108 if v and not values ["project_id" ]:
111109 raise ValueError (
0 commit comments