Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
zzeppozz committed Nov 8, 2024
1 parent 8067833 commit ba09d81
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion aws/lambda/bison_s0_test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def lambda_handler(event, context):
print(f"*** Error querying for bucket/object {annotated_riis_key} ({e})")
raise e
try:
_contents = tr_response["Contents"]
tr_response["Contents"]
except KeyError:
print(f"*** Object {annotated_riis_key} is not present")
else:
Expand Down
2 changes: 1 addition & 1 deletion aws/lambda/bison_s1_annotate_riis.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def lambda_handler(event, context):
print(f"*** Error querying for bucket/object {annotated_riis_key} ({e})")
raise e
try:
_contents = tr_response["Contents"]
tr_response["Contents"]
except KeyError:
print(f"*** Object {annotated_riis_key} is not present")
else:
Expand Down
2 changes: 1 addition & 1 deletion aws/lambda/bison_s2_load_ancillary.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def lambda_handler(event, context):
print(f"!!! Error querying for object {annotated_riis_key} ({e})")
raise e
try:
_contents = tr_response["Contents"]
tr_response["Contents"]
except KeyError:
raise Exception(
f"!!! Missing annotated RIIS data: {annotated_riis_key}")
Expand Down
2 changes: 1 addition & 1 deletion aws/lambda/bison_s4_intersect_bison.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def lambda_handler(event, context):
else:
try:
name = records[0][2]["stringValue"]
except:
except Exception:
success = False
msg = f"!!! Unexpected query result {records}"
else:
Expand Down
4 changes: 2 additions & 2 deletions aws/lambda/bison_s5_assign_riis.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ def lambda_handler(event, context):
raise
else:
if cmd == "query_riis":
print(f"*** Assessment totals")
print("*** Assessment totals")
# Query returns assesment, count as 1st and 2nd items in record
for rec in records:
try:
print(f"*** {rec[0]['stringValue']}: {rec[1]['longValue']}")
except:
except Exception:
print(f"!!! Unexpected record format {rec}")
break

Expand Down
6 changes: 3 additions & 3 deletions aws/lambda/bison_s6_aggregate_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def lambda_handler(event, context):
key = fullkey[prefix_len:-suffix_len]
s3objs_present.append(key)
print(f"*** {key}")

# -------------------------------------
# SECOND: Check that current BISON data is in Redshift
# NEXT: Execute remaining aggregation and export commmands in order
Expand Down Expand Up @@ -422,8 +422,8 @@ def lambda_handler(event, context):
tbl_name = rec[2]["stringValue"]
tables_present.append(tbl_name)
print(f"*** {tbl_name}")
except:
raise Exception(f"!!! Unexpected record result {rec}")
except Exception as e:
raise Exception(f"!!! Unexpected record result {rec}, {e}")

return {
"statusCode": 200,
Expand Down
5 changes: 2 additions & 3 deletions aws/lambda/bison_s7_delete_obsolete.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def lambda_handler(event, context):
else:
tbl_lst = new_tables


# -------------------------------------
# Submit query request
try:
Expand Down Expand Up @@ -221,7 +220,7 @@ def lambda_handler(event, context):
# Determine which tables to remove
print("*** ---------------------------------------")
tables_to_remove = set(tmp_tables)
print("*** Tables to remove:" )
print("*** Tables to remove:")
print(f"*** {tmp_tables}")
# Make sure new table exists before removing old table
for old_tbl in old_tables:
Expand Down Expand Up @@ -326,7 +325,7 @@ def lambda_handler(event, context):
# -------------------------------------
# Determine which objects to remove from S3
print("*** ---------------------------------------")
print("*** Keys to remove:" )
print("*** Keys to remove:")
# Make sure new table exists before removing old table
for old_key in old_keys:
prefix = old_key[:-len(old_bison_datestr)]
Expand Down

0 comments on commit ba09d81

Please sign in to comment.