Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions sdk/python/feast/infra/offline_stores/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ def get_historical_features(
assert isinstance(config.offline_store, BigQueryOfflineStoreConfig)

table_reference = _get_table_reference_for_new_entity(
client, client.project, config.offline_store.dataset
client,
client.project,
config.offline_store.dataset,
config.offline_store.location,
)

@contextlib.contextmanager
Expand Down Expand Up @@ -340,13 +343,16 @@ def _wait_until_done(bq_job):


def _get_table_reference_for_new_entity(
client: Client, dataset_project: str, dataset_name: str
client: Client,
dataset_project: str,
dataset_name: str,
dataset_location: Optional[str],
) -> str:
"""Gets the table_id for the new entity to be uploaded."""

# First create the BigQuery dataset if it doesn't exist
dataset = bigquery.Dataset(f"{dataset_project}.{dataset_name}")
dataset.location = "US"
dataset.location = dataset_location if dataset_location else "US"

try:
client.get_dataset(dataset)
Expand Down