Skip to content

Commit

Permalink
more linter failures and fix some from before
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurie Merrell committed Oct 26, 2023
1 parent 0727a5b commit b5bce36
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def email_failures(task_instance: TaskInstance, execution_date, **kwargs):
The following agency GTFS feeds could not be extracted on {execution_date}:
{html_report}
""" # noqa: E231
""" # noqa: E231,E241

if os.environ["AIRFLOW_ENV"] == "development":
print(
Expand Down
4 changes: 2 additions & 2 deletions airflow/plugins/operators/littlepay_raw_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def sync_file(
)
try:
metadata_str = fs.getxattr(
path=f"gs://{fileinfo.name}",
attr=PARTITIONED_ARTIFACT_METADATA_KEY, # noqa: E231
path=f"gs://{fileinfo.name}", # noqa: E231
attr=PARTITIONED_ARTIFACT_METADATA_KEY,
)
except KeyError:
print(f"metadata missing on {fileinfo.name}")
Expand Down
2 changes: 1 addition & 1 deletion jobs/gtfs-aggregator-scraper/gtfs_aggregator_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def main(aggregator: GTFSFeedAggregator, dry_run: bool = False, progress: bool =
)
if dry_run:
typer.secho(
f"dry run; skipping upload of {humanize.naturalsize(len(scrape_result.content))}"
f"dry run; skipping upload of {humanize.naturalsize(len(scrape_result.content))}" # noqa: E702
)
else:
typer.secho(
Expand Down
4 changes: 2 additions & 2 deletions jobs/gtfs-rt-parser-v2/gtfs_rt_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ def main(
typer.secho(f"missing: {files_missing_metadata}")
typer.secho(f"invalid: {files_invalid_metadata}")
raise RuntimeError(
f"too many files have missing/invalid metadata; {total - len(files)} of {total}"
f"too many files have missing/invalid metadata; {total - len(files)} of {total}" # noqa: E702
)

if not files:
Expand Down Expand Up @@ -893,7 +893,7 @@ def main(

if exceptions:
exc_str = "\n".join(str(tup) for tup in exceptions)
msg = f"got {len(exceptions)} exceptions from processing {len(aggregations_to_process)} feeds:\n{exc_str}"
msg = f"got {len(exceptions)} exceptions from processing {len(aggregations_to_process)} feeds:\n{exc_str}" # noqa: E231
typer.secho(msg, err=True, fg=typer.colors.RED)
raise RuntimeError(msg)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def validate_hour(
success_rate = len(result.successes) / len(extracts)
if success_rate < GTFS_VALIDATE_LIST_ERROR_THRESHOLD:
exc_str = "\n".join(str(tup) for tup in exceptions)
msg = f"got {len(exceptions)} exceptions from validating {len(extracts)} extracts:\n{exc_str}"
msg = f"got {len(exceptions)} exceptions from validating {len(extracts)} extracts:\n{exc_str}" # noqa: E231
if exceptions:
typer.secho(msg, err=True, fg=typer.colors.RED)
raise RuntimeError(msg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def cut_segments(
.drop(columns="temp_index")
)

segmented2 = gpd.GeoDataFrame(segmented, crs=f"EPSG:{EPSG_CODE}")
segmented2 = gpd.GeoDataFrame(segmented, crs=f"EPSG:{EPSG_CODE}") # noqa: E231

return segmented2

Expand Down
2 changes: 1 addition & 1 deletion packages/calitp-data-analysis/calitp_data_analysis/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_engine(max_bytes=None, project="cal-itp-data-infra"):
# Note that we should be able to add location as a uri parameter, but
# it is not being picked up, so passing as a separate argument for now.
return create_engine(
f"bigquery://{project}/?maximum_bytes_billed={max_bytes}",
f"bigquery://{project}/?maximum_bytes_billed={max_bytes}", # noqa: E231
location=CALITP_BQ_LOCATION,
credentials_path=cred_path,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _repr_html_(self):
</tr>
{table_body_html}
</table>
"""
""" # noqa: E221,E222


tbls = AutoTable(
Expand Down

0 comments on commit b5bce36

Please sign in to comment.