Skip to content

Commit

Permalink
✨ add download job result subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
sickler-alex committed Apr 1, 2024
1 parent 95fd403 commit da7b851
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions d3b_dff_cli/modules/dewrangle/download_job.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Download job results from Dewrangle."""

from . import helper_functions as hf

def download_job(jobid, token=None):
"""
Function to download results from Dewrangle
Input: Dewrangle job id
Output: object with job resuls
"""

client = hf.create_gql_client(api_key=token)

return hf.download_job_result(jobid, client=client, api_key=token)


def main(args):
"""Main function."""

status, job_df = download_job(args.jobid)
if status == "Complete":
job_df.to_csv(args.outfile)
else:
print("Job incomplete, please check again later.")

0 comments on commit da7b851

Please sign in to comment.