1
This commit is contained in:
+18
-16
@@ -215,10 +215,11 @@ def importDataToElastic(elastic, file_excel, index_name_o, tcode_label, tcode_id
|
||||
qanon_title = row[column_names[2]]
|
||||
code_state = row[column_names[3]]
|
||||
row_number = row[column_names[4]]
|
||||
if code_state :
|
||||
print ( 'ddddddddddddddcode_state' , code_state)
|
||||
else :
|
||||
print ( 'ccccccccccccccode_state' , code_state)
|
||||
# if code_state :
|
||||
# print ( 'ddddddddddddddcode_state' , code_state)
|
||||
# else :
|
||||
# print ( 'ccccccccccccccode_state' , code_state)
|
||||
|
||||
qanon_id = 0
|
||||
section_id = 0
|
||||
state = ''
|
||||
@@ -296,10 +297,11 @@ def importDataToElastic(elastic, file_excel, index_name_o, tcode_label, tcode_id
|
||||
"label" : tcode_label,
|
||||
"id" : tcode_id
|
||||
}
|
||||
if code_state :
|
||||
if code_state == True :
|
||||
tcode_mains.append(code)
|
||||
else:
|
||||
tcode_subs.append(code)
|
||||
tcode_subs.append(code)
|
||||
|
||||
data={
|
||||
'_id':section_id,
|
||||
'_source' : {
|
||||
@@ -325,18 +327,18 @@ def importDataToElastic(elastic, file_excel, index_name_o, tcode_label, tcode_id
|
||||
elastic.updateBulkList(bulk_data, index_name_o)
|
||||
|
||||
|
||||
# columns=['جزء', 'مصوب', 'قانون', 'اصلی', 'ردیف', 'شناسه قانون', 'شناسه جزء', 'وضعیت پردازش']
|
||||
columns=[0, 1, 2, 3, 4, 5, 6, 7]
|
||||
new_df = pd.DataFrame(rows_list_new, columns=columns)
|
||||
if result_path == '' :
|
||||
directory_path = os.path.dirname(file_excel)
|
||||
result_path = directory_path + "/result/"
|
||||
##### columns=['جزء', 'مصوب', 'قانون', 'اصلی', 'ردیف', 'شناسه قانون', 'شناسه جزء', 'وضعیت پردازش']
|
||||
# columns=[0, 1, 2, 3, 4, 5, 6, 7]
|
||||
# new_df = pd.DataFrame(rows_list_new, columns=columns)
|
||||
# if result_path == '' :
|
||||
# directory_path = os.path.dirname(file_excel)
|
||||
# result_path = directory_path + "/result/"
|
||||
|
||||
file_name = os.path.basename(file_excel)
|
||||
file_excel2 = result_path + file_name.replace('.xlsx', '_result.xlsx')
|
||||
# file_name = os.path.basename(file_excel)
|
||||
# file_excel2 = result_path + file_name.replace('.xlsx', '_result.xlsx')
|
||||
|
||||
print('rows_list_new', str(len(rows_list_new)), ' --> ', file_excel2)
|
||||
new_df.to_excel(file_excel2, index=False, engine='openpyxl')
|
||||
# print('rows_list_new', str(len(rows_list_new)), ' --> ', file_excel2)
|
||||
# new_df.to_excel(file_excel2, index=False, engine='openpyxl')
|
||||
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user