Skip to content

Commit

Permalink
Update update_attempt.py
Browse files Browse the repository at this point in the history
fixed bug
  • Loading branch information
o-mura authored May 28, 2024
1 parent a0d1bb3 commit 24f5dfe
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def insert_attempt_info(import_unixtime, endpoint, apikey, dest_db, dest_table,
client.load_table_from_dataframe(df, dest_table, if_exists='append', fmt='msgpack')

def run(session_unixtime, dest_db, dest_table, ids, api_endpoint='api.treasuredata.com', workflow_endpoint='api-workflow.treasuredata.com'):
id_list = ids.split(',')
if len(id_list) == 0:
if len(ids) == 0:
print('no update record')
return
id_list = ids.split(',')
delete_attempt_info(api_endpoint, os.environ['TD_API_KEY'], dest_db, dest_table, id_list)

workflow_url = 'https://%s/api/attempts' % workflow_endpoint + '/%s'
Expand All @@ -56,4 +56,4 @@ def run(session_unixtime, dest_db, dest_table, ids, api_endpoint='api.treasureda
if len(l) == 0:
print('no update record')
return
insert_attempt_info(session_unixtime, 'https://%s' % api_endpoint, os.environ['TD_API_KEY'], dest_db, dest_table, l)
insert_attempt_info(session_unixtime, 'https://%s' % api_endpoint, os.environ['TD_API_KEY'], dest_db, dest_table, l)

0 comments on commit 24f5dfe

Please sign in to comment.