Skip to content

Commit

Permalink
Add MVP support for on demand transforms for bigquery (#1855)
Browse files Browse the repository at this point in the history
Signed-off-by: Danny Chiao <[email protected]>
  • Loading branch information
adchia authored Sep 14, 2021
1 parent 6fe086c commit 32d5c6c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sdk/python/feast/infra/offline_stores/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,17 @@ def to_bigquery(
path = f"{self.client.project}.{self.config.offline_store.dataset}.historical_{today}_{rand_id}"
job_config = bigquery.QueryJobConfig(destination=path)

if not job_config.dry_run and self.on_demand_feature_views is not None:
transformed_df = self.to_df()
job = self.client.load_table_from_dataframe(
transformed_df,
job_config.destination,
job_config=bigquery.LoadJobConfig(),
)
job.result()
print(f"Done writing to '{job_config.destination}'.")
return str(job_config.destination)

bq_job = self.client.query(self.query, job_config=job_config)

if job_config.dry_run:
Expand Down

0 comments on commit 32d5c6c

Please sign in to comment.