Обновить dags/fin_porfel.py
This commit is contained in:
parent
4b9d7040cf
commit
934ba1dad7
|
|
@ -52,16 +52,7 @@ def upsert_list_fin_portfel(**kwargs):
|
|||
if not df.empty:
|
||||
conn.execute("CREATE TEMP TABLE temp_fin_porfel (schet text null, subkonto2 text null, summa_dogovora text null, percent_value text null)")
|
||||
df.to_sql('temp_fin_porfel', con=conn, if_exists='append', index=False, method='multi')
|
||||
conn.execute
|
||||
("""
|
||||
INSERT INTO public.fin_porfel
|
||||
SELECT distinct
|
||||
schet
|
||||
, subkonto2
|
||||
, summa_dogovora
|
||||
, percent_value
|
||||
FROM temp_fin_porfel
|
||||
""")
|
||||
conn.execute("INSERT INTO public.fin_porfel SELECT distinct schet, subkonto2, summa_dogovora, percent_value FROM temp_fin_porfel")
|
||||
return 'Список обновлен.'
|
||||
else:
|
||||
return 'Обновлять нечего.'
|
||||
|
|
|
|||
Loading…
Reference in New Issue