3rd commit
This commit is contained in:
@@ -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()]
|
||||
|
||||
Reference in New Issue
Block a user