3rd commit

This commit is contained in:
Ankit Malik
2026-06-12 15:39:39 +05:30
parent 80bb585cdb
commit 8aaae1e27d
12 changed files with 1280 additions and 120 deletions
+4 -2
View File
@@ -1,5 +1,5 @@
import os
import pyarrow
# import pyarrow
import sys
import logging
from datetime import date, timedelta
@@ -10,7 +10,7 @@ import clickhouse_connect
from dotenv import load_dotenv
from log import log
from clickhouse_task.create_table import create_clickhouse_table , check
from clickhouse_task.create_table import *
from db_con.connection import *
@@ -28,7 +28,9 @@ def collect_mids(engine: Engine, target_date: date) -> list[int]:
SELECT MID FROM OneApp_KelloggsMT.dbo.T_StoreCoverage
WHERE CONVERT(date, UpdateDate) = :target_date
""")
log.info(f"Collecting MIDs for: {target_date}")
with engine.connect() as conn:
result = conn.execute(sql, {"target_date": target_date})
mids = [row[0] for row in result.fetchall()]