Skip to content

Commit 32d5c6c

Browse files
authored
Add MVP support for on demand transforms for bigquery (#1855)
Signed-off-by: Danny Chiao <danny@tecton.ai>
1 parent 6fe086c commit 32d5c6c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

sdk/python/feast/infra/offline_stores/bigquery.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,17 @@ def to_bigquery(
221221
path = f"{self.client.project}.{self.config.offline_store.dataset}.historical_{today}_{rand_id}"
222222
job_config = bigquery.QueryJobConfig(destination=path)
223223

224+
if not job_config.dry_run and self.on_demand_feature_views is not None:
225+
transformed_df = self.to_df()
226+
job = self.client.load_table_from_dataframe(
227+
transformed_df,
228+
job_config.destination,
229+
job_config=bigquery.LoadJobConfig(),
230+
)
231+
job.result()
232+
print(f"Done writing to '{job_config.destination}'.")
233+
return str(job_config.destination)
234+
224235
bq_job = self.client.query(self.query, job_config=job_config)
225236

226237
if job_config.dry_run:

0 commit comments

Comments
 (0)