Skip to content

Commit

Permalink
PR feedback, removed unused pylint excepts
Browse files Browse the repository at this point in the history
  • Loading branch information
dogversioning committed Feb 13, 2024
1 parent 32adbb0 commit 43cc529
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/handlers/dashboard/filter_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ def _parse_filter_req(filter_req):
if "," in filter_req:
return " AND ".join(_parse_filter_req(x) for x in filter_req.split(","))
filter_req_split = filter_req.split(":")
if (
filter_req_split[1] in _FILTER_MAP_ONE_PARAM.keys() # pylint: disable=consider-iterating-dictionary
):
if filter_req_split[1] in _FILTER_MAP_ONE_PARAM:
return _FILTER_MAP_ONE_PARAM[filter_req_split[1]] % filter_req_split[0]
return _FILTER_MAP_TWO_PARAM[filter_req_split[1]] % (
filter_req_split[0],
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/dashboard/get_chart_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _get_table_cols(table_name: str, version: str | None = None) -> list:
s3_client = boto3.client("s3")
s3_iter = s3_client.get_object(
Bucket=s3_bucket_name,
Key=s3_key, # type: ignore[arg-type]
Key=s3_key,
)["Body"].iter_lines()
return next(s3_iter).decode().split(",")

Expand All @@ -42,7 +42,7 @@ def _build_query(query_params: dict, filters: list, path_params: dict) -> str:
filter_str = get_filter_string(filters)
if filter_str != "":
filter_str = f"AND {filter_str}"
count_col = [next(c for c in columns if c.startswith("cnt"))][0]
count_col = next(c for c in columns if c.startswith("cnt"))
columns.remove(count_col)
select_str = f"{query_params['column']}, sum({count_col}) as {count_col}"
group_str = f"{query_params['column']}"
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/shared/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def error_decorator(func):
def wrapper(*args, **kwargs):
try:
res = func(*args, **kwargs)
except Exception as e: # pylint: disable=broad-except
except Exception as e:
trace = []
tb = e.__traceback__
while tb is not None:
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/site_upload/api_gateway_authorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class HttpVerb:
ALL = "*"


class AuthPolicy: # pylint: disable=missing-class-docstring; # pragma: no cover
class AuthPolicy:
awsAccountId = ""
"""The AWS account id the policy will be generated for. This is used to
create the method ARNs."""
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/site_upload/powerset_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def merge_powersets(manager: S3Manager) -> None:
manager.update_local_metadata(
TransactionKeys.LAST_AGGREGATION.value, site=latest_site
)
except Exception as e: # pylint: disable=broad-except
except Exception as e:
manager.merge_error_handler(
latest_path,
subbucket_path,
Expand Down

0 comments on commit 43cc529

Please sign in to comment.