run doczy.ai pipeline api update

This commit is contained in:
Mayank Aamseek
2024-04-10 21:10:54 +05:30
parent 2c7be6393f
commit a17ad3dfea
+12 -13
View File
@@ -48,10 +48,10 @@ if user_mail in user_list:
region_name="us-east-2",
)
# to be replaced with snowflake data
client_list = ['doczy-ai-client-1', 'Delaware First Health, Inc.', 'Community Health Choice, Inc','CareSource Network Partners LLC',
'HealthNet of Cali', 'Oklahoma Complete Health, Inc', 'HealthFirst', 'Molina Healthcare of TX', 'AvMed', 'Arizona Care1st',
'WellCare New Jersey']
# # to be replaced with snowflake data
# client_list = ['doczy-ai-client-1', 'Delaware First Health, Inc.', 'Community Health Choice, Inc','CareSource Network Partners LLC',
# 'HealthNet of Cali', 'Oklahoma Complete Health, Inc', 'HealthFirst', 'Molina Healthcare of TX', 'AvMed', 'Arizona Care1st',
# 'WellCare New Jersey']
client_list, s3_paths = get_client_names()
client_s3_paths = dict(zip(client_list, s3_paths))
@@ -62,11 +62,11 @@ if user_mail in user_list:
with client_row[1]:
client = st.selectbox('Client Name',(client_list), label_visibility = "collapsed")
client = client_s3_paths.get(client)
client_bucket = client_s3_paths.get(client)
# # to be deleted when buckets for different clients are ready; below line is added only for testing the corresponding DAG
client = 'doczy-ai-client-1'
client_bucket = 'doczy-ai-client-1'
batch_objects = s3_client.list_objects_v2(Bucket=client
batch_objects = s3_client.list_objects_v2(Bucket=client_bucket
, Prefix="", Delimiter='/')
batch_list = []
@@ -99,10 +99,10 @@ if user_mail in user_list:
add_vertical_space(1)
df = pd.DataFrame(columns=['Contract Name', 'Batch ID', 'Unique Key','Pricing Before Carveouts'
df = pd.DataFrame(columns=['Contract Name', 'Unique Key','Pricing Before Carveouts'
, 'Contract Related', 'Provider', 'Timeline', 'Carveout Indicator', 'Carveout Methodology'])
file_list = []
file_objects = s3_client.list_objects_v2(Bucket=client
file_objects = s3_client.list_objects_v2(Bucket=client_bucket
, Prefix=batch_id+"/contracts_landing_zone/", Delimiter='/')
if st.button("Read the contracts from Path"):
@@ -111,7 +111,6 @@ if user_mail in user_list:
file_list.append(obj['Key'].split('/')[-1])
df['Contract Name'] = file_list
df['Batch ID'] = batch_id
# df['Request ID'] = range(len(file_list))
# df['Contract ID'] = file_list
df['Unique Key'] = a
@@ -167,13 +166,13 @@ if user_mail in user_list:
entry_dict = {
"contract_name": row['Contract Name'],
"groups": group_list,
"contract_source_path": "batches/batch_1/"+client+"/"+row['Contract Name']
"contract_source_path": batch_id+"/contracts_landing_zone/"+row['Contract Name']
}
contract_list.append(entry_dict)
myobj = {
"s3_bucket": 'doczy-dev-infra-textract',
"batch_id": "1",
"s3_bucket": client_bucket,
"batch_id": batch_id,
"client_name": client,
"username": user_mail,
"contract_list": contract_list