diff options
| author | Ellie <ecsymonds@gmail.com> | 2024-08-19 15:56:48 +0100 |
|---|---|---|
| committer | Ellie <ecsymonds@gmail.com> | 2024-08-19 15:56:48 +0100 |
| commit | c3c45c0d133ce32d48f1c72a0ac54f291038b1e7 (patch) | |
| tree | 402159204e42a29ad27dda0caeb0b73545b70fb0 /src/extract_lambda.py | |
| parent | 17275cb511b0b134e34247f3cbf008a4da50768b (diff) | |
| download | de-project-bentley-c3c45c0d133ce32d48f1c72a0ac54f291038b1e7.tar.gz de-project-bentley-c3c45c0d133ce32d48f1c72a0ac54f291038b1e7.zip | |
wip: fixing last test
Diffstat (limited to 'src/extract_lambda.py')
| -rw-r--r-- | src/extract_lambda.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/extract_lambda.py b/src/extract_lambda.py index 4168e27..533bf82 100644 --- a/src/extract_lambda.py +++ b/src/extract_lambda.py @@ -147,12 +147,13 @@ def process_and_upload_tables(db, existing_files, client=boto3.client("s3")): WHERE table_schema='public' AND table_type='BASE TABLE';""" ) for table in tables: + print(tables) table_name = table[0] rows = db.run( f"SELECT * FROM {identifier(table_name)} " "WHERE last_updated >= :latest;", latest={datetime.strftime(latest_timestamp, "%H-%m-%d %H:%M:%S")}, ) - + print('rows', rows) # Creating a temporary file path and writing the column name to it followed by each row of data if rows: csv_file_path = f"/tmp/{table_name}.csv" @@ -183,6 +184,6 @@ def process_and_upload_tables(db, existing_files, client=boto3.client("s3")): else: load_status["no change"].append(table_name) logger.info( - f"No new data in {table_name} name. Latest data retrieved is from {latest_timestamp}." + f"No new data" ) return load_status |
