Обновить dags/split_subkonto2.py

This commit is contained in:
bn_user 2025-09-09 06:16:31 +00:00
parent b88daab2a1
commit 50ed722166
1 changed files with 2 additions and 2 deletions

View File

@ -299,12 +299,12 @@ def merge_dict_and_split_1C(**kwargs):
result_df['date_end'] = result_df['date_end_dict'] result_df['date_end'] = result_df['date_end_dict']
result_df = result_df[['subkonto2', 'naimenovanie', 'nomer', 'date_begin', 'date_end']].drop('id', axis=1) result_df = result_df[['subkonto2', 'naimenovanie', 'nomer', 'date_begin', 'date_end']]
engine = get_db_engine() engine = get_db_engine()
with engine.begin() as conn: with engine.begin() as conn:
#conn.exucute('CREATE TEMP TABLE temp_dict_subkonto_two as SELECT * FROM public.dict_subkonto_two where 1=0') #conn.exucute('CREATE TEMP TABLE temp_dict_subkonto_two as SELECT * FROM public.dict_subkonto_two where 1=0')
result_df.to_sql('dict_subkonto_two', con=conn, if_exists='append', index=False, method='multi') result_df.to_sql('dict_subkonto_two', con=conn, if_exists='append', index=False, method='multi', index_label='id')
#conn.execute('INSERT INTO public.dict_subkonto_two SELECT * FROM temp_dict_subkonto_two') #conn.execute('INSERT INTO public.dict_subkonto_two SELECT * FROM temp_dict_subkonto_two')
return result_df.to_dict('Данные загружены!') return result_df.to_dict('Данные загружены!')