nЯ хотел бы получить дату из таблицы красных смещений, и, если она равна сегодняшней дате, выполнить следующий запрос в python.
reshift_conn = create_engine('postgresql://'+username+':'+pwd+'@'+host+':'+str(port)+'/'+dbname)
with reshift_conn.connect() as conn,conn.begin():
df=pd.read_sql("""select top 1 trunc(convert_timezone ('Pacific/Auckland',getdate()))""",conn)
date=df['trunc'][0]
today=pd.to_datetime('today').strftime("%Y-%m-%d")
if date==today the run the next query