Skip to content

Commit

Permalink
fix: formatting issue on my branch
Browse files Browse the repository at this point in the history
  • Loading branch information
elseagle committed Jun 6, 2024
1 parent 4b626b3 commit 18ca38c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
17 changes: 11 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ def process_import_function(event, context):
key = message.get("file_path")
jurisdiction_id = message.get("jurisdiction_id")
jurisdiction_name = message.get("jurisdiction_name")
# Archiving processed realtime bills defaults to False, except it was explicitly set on
# cli or on task-definitions Repo as <--archive> or
# added on AWS admin console for os-realtime lambda function config as file_archiving_enabled=True
# Archiving processed realtime bills defaults to False,
# except it was explicitly set on cli or on task-definitions
# Repo as <--archive> or added on AWS admin console for os-realtime
# lambda function config as file_archiving_enabled=True
file_archiving_enabled = (
message.get("file_archiving_enabled") or context.file_archiving_enabled
message.get("file_archiving_enabled")
or context.file_archiving_enabled
)

# for some reason, the key is url encoded sometimes
Expand Down Expand Up @@ -132,7 +134,9 @@ def process_import_function(event, context):
s3_client.delete_object(Bucket=bucket, Key=file_path)
logger.info(f"Deleted file :: {file_path}")
except Exception as e:
logger.error(f"Error importing jurisdiction {jur_id}: {e}") # noqa: E501
logger.error(
f"Error importing jurisdiction {jur_id}: {e}"
) # noqa: E501
continue

logger.info(f"{len(all_files)} files processed")
Expand All @@ -149,7 +153,8 @@ def remove_duplicate_message(items):

# Use another list comprehension to create a list of unique dictionaries
filtered_items = [
dict(i) for i in set(tuple(i.items()) for i in parsed_items) # noqa: E501
dict(i)
for i in set(tuple(i.items()) for i in parsed_items) # noqa: E501
]

return filtered_items
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@ black = "^24.4.2"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[flake8]
max-line-length = 79

[tool.black]
line-length = 79

0 comments on commit 18ca38c

Please sign in to comment.