Skip to content

Commit

Permalink
Add client field b/c of Venkat's PR merge
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgxue committed Mar 1, 2024
1 parent 4faa87b commit 38c2877
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions airflow/dags/metrcis/load_firestore_to_snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def load_request_data_from_firestore() -> list[tuple[str, int, bool, int]]:
score = doc_dict.get("score")
status = doc_dict.get("status") == "complete"
response_received_at = datetime.fromtimestamp(doc_dict.get("response_received_at"))
rows.append((uuid, score, status, response_received_at))
client = doc_dict.get("client")
rows.append((uuid, score, status, response_received_at, client))

return rows

Expand All @@ -77,9 +78,9 @@ def write_request_data_to_snowflake(rows: list[tuple[str, int, bool, int]]) -> N

insert_sql = f"""
INSERT INTO
{METRICS_SNOWFLAKE_DB_DATABASE}.{METRICS_SNOWFLAKE_DB_SCHEMA}.request(uuid, score, success, created_at)
{METRICS_SNOWFLAKE_DB_DATABASE}.{METRICS_SNOWFLAKE_DB_SCHEMA}.request(uuid, score, success, created_at, client)
VALUES
(?, ?, ?, ?)
(?, ?, ?, ?, ?)
"""
conn.cursor().executemany(insert_sql, rows)

Expand Down

0 comments on commit 38c2877

Please sign in to comment.