jeff n
12/30/2020, 12:41 AMJenny
12/30/2020, 12:47 AMjeff n
12/30/2020, 12:51 AMdef upload_to_s3(bucket_name, output_file):
    """
    Using the following format to put the key
    [system]/[topic]/[year]/[month]/[day]/[filename]
    :param bucket_name:
    :param output_file:
    :return:
    """
    s3 = boto3.resource('s3')
    bucket = s3.Bucket(bucket_name)
    objects = [obj for obj in bucket.objects.all()]
    return objectsjeff n
12/30/2020, 12:51 AMbucket = s3.Bucket(bucket_name)jeff n
12/30/2020, 12:52 AMwith Flow("Event data pull") as flow:
    event_date = Parameter("event_date", datetime(2020, 10, 1))
    output_file = Parameter("output_file", "temp.csv")
    bucket = Parameter("bucket", "lc-dateng-exports-dev")
    events = pull_events_by_day(event_date)
    write_to_csv = write_to_csv(output_file, events)
    upload = upload_to_s3(bucket, output_file)
state = flow.run()jeff n
12/30/2020, 12:52 AMJenny
12/30/2020, 1:05 AMjeff n
12/30/2020, 4:23 AM