We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f11389 commit d221669Copy full SHA for d221669
dags/utils/posts_insights/base.py
@@ -126,14 +126,21 @@ def _dump_to_bigquery(
126
logger.info(f"No {dump_type} to dump!")
127
return
128
129
+ if dump_type == "posts":
130
+ target_table = self.POST_TABLE_NAME
131
+ elif dump_type == "posts insights":
132
+ target_table = self.INSIGHT_TABLE_NAME
133
+ else:
134
+ raise ValueError(f"Unexpected dump_type {dump_type}")
135
+
136
job_config = bigquery.LoadJobConfig(
137
schema=bq_schema_fields,
138
write_disposition="WRITE_APPEND",
139
)
140
try:
141
job = self.bq_client.load_table_from_json(
142
posts,
- f"pycontw-225217.ods.{self.INSIGHT_TABLE_NAME}",
143
+ f"pycontw-225217.ods.{target_table}",
144
job_config=job_config,
145
146
job.result()
0 commit comments