bug fixes

This commit is contained in:
Mayank Aamseek
2024-03-29 15:36:46 +05:30
parent 5f7614b98f
commit a8409befe2
3 changed files with 8 additions and 6 deletions
+1
View File
@@ -437,6 +437,7 @@ if user_mail in user_list:
st.download_button("Download Table", csv, "file.csv", "text/csv", key='download-csv') st.download_button("Download Table", csv, "file.csv", "text/csv", key='download-csv')
with buttons[1]: with buttons[1]:
# st.download_button("Download Table", csv, "file.csv", "text/csv", key='download-csv') # st.download_button("Download Table", csv, "file.csv", "text/csv", key='download-csv')
st.write("")
with buttons[2]: with buttons[2]:
st.button("Kickoff Database Integration") st.button("Kickoff Database Integration")
+3 -2
View File
@@ -78,6 +78,7 @@ except:
st.write("Local copy of TRAINING_DATA_RAW table loaded") st.write("Local copy of TRAINING_DATA_RAW table loaded")
try: try:
error('table is not updated')
query = 'select * from "BUSINESS_CONFIG"' query = 'select * from "BUSINESS_CONFIG"'
cur.execute(query) cur.execute(query)
fields = pd.DataFrame.from_records(iter(cur), columns=[x[0] for x in cur.description]) fields = pd.DataFrame.from_records(iter(cur), columns=[x[0] for x in cur.description])
@@ -93,7 +94,7 @@ except:
fields = fields.drop_duplicates(subset='Field Name', keep="first").sort_values('Field Name') fields = fields.drop_duplicates(subset='Field Name', keep="first").sort_values('Field Name')
fields['Field Name'] = fields['SF_DB_COL_NAME'] fields['Field Name'] = fields['SF_DB_COL_NAME']
fields = fields[~fields['Field Name'].isnull()] fields = fields[~fields['Field Name'].isnull()]
st.write("Local copy of BUSINESS_CONFIG table loaded") # st.write("Local copy of BUSINESS_CONFIG table loaded")
try: try:
query = 'select * from "TRAINING_ATTEMPT_LOGS"' query = 'select * from "TRAINING_ATTEMPT_LOGS"'
@@ -580,7 +581,7 @@ if user_mail in user_list:
st.write(raw_response_text) st.write(raw_response_text)
try: try:
save_to_sf('load_training_results', "training_results_file_name", "results.csv", "attempt_logs_file_name", "history.csv") save_to_sf('load_training_results', "results.csv", "history.csv")
except: except:
st.write("running locally") st.write("running locally")
+3 -3
View File
@@ -36,7 +36,7 @@ def get_secret():
# get_secret() # get_secret()
def save_to_sf(dag_name, config_1, value_1, config_2, value_2): def save_to_sf(dag_name, training_results_file, attempt_logs_file):
mwaa_env_name = 'doczy-dev-infra-mwaa' mwaa_env_name = 'doczy-dev-infra-mwaa'
dag_name = dag_name dag_name = dag_name
@@ -60,8 +60,8 @@ def save_to_sf(dag_name, config_1, value_1, config_2, value_2):
# conf = "{\"" + "training_results_file_name" + "\":\"" + {training_results_file} + "\", \"" + "attempt_logs_file_name" + "\":\"" + {attempt_logs_file} + "\"}".format(training_results_file=training_results_file, attempt_logs_file=attempt_logs_file) # conf = "{\"" + "training_results_file_name" + "\":\"" + {training_results_file} + "\", \"" + "attempt_logs_file_name" + "\":\"" + {attempt_logs_file} + "\"}".format(training_results_file=training_results_file, attempt_logs_file=attempt_logs_file)
conf = f"""{{ conf = f"""{{
{config_1}: "{value_1}", "training_results_file_name": "{training_results_file}",
{config_2}: "{value_2}" "attempt_logs_file_name": "{attempt_logs_file}"
}}""" }}"""