Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rymarczy committed Oct 21, 2024
1 parent 7786cc3 commit 3d8e48d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
18 changes: 10 additions & 8 deletions src/lamp_py/bus_performance_manager/events_tm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,23 @@
)
from lamp_py.runtime_utils.process_logger import ProcessLogger


def _empty_stop_crossing() -> pl.DataFrame:
"""
create empty stop crossing dataframe with expected columns
"""
schema = {
"vehicle_label": pl.String,
"route_id": pl.String,
"trip_id": pl.String,
"stop_id": pl.String,
"tm_stop_sequence": pl.Int64,
"tm_arrival_dt": pl.Datetime,
"tm_departure_dt": pl.Datetime,
}
"vehicle_label": pl.String,
"route_id": pl.String,
"trip_id": pl.String,
"stop_id": pl.String,
"tm_stop_sequence": pl.Int64,
"tm_arrival_dt": pl.Datetime,
"tm_departure_dt": pl.Datetime,
}
return pl.DataFrame(schema=schema)


def generate_tm_events(tm_files: List[str]) -> pl.DataFrame:
"""
Build out events from transit master stop crossing data after joining it
Expand Down
6 changes: 3 additions & 3 deletions src/lamp_py/bus_performance_manager/write_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def write_bus_metrics() -> None:

with tempfile.TemporaryDirectory() as tempdir:
write_file = f"{service_date.strftime('%Y%m%d')}.parquet"
events_df.write_parquet(os.path.join(tempdir,write_file), use_pyarrow=True)
events_df.write_parquet(os.path.join(tempdir, write_file), use_pyarrow=True)

upload_file(
file_name=os.path.join(tempdir,write_file),
object_path=os.path.join(bus_events.s3_uri,write_file),
file_name=os.path.join(tempdir, write_file),
object_path=os.path.join(bus_events.s3_uri, write_file),
extra_args={"Metadata": {VERSION_KEY: bus_events.version}},
)

Expand Down
1 change: 1 addition & 0 deletions src/lamp_py/runtime_utils/remote_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

VERSION_KEY = "lamp_version"


@dataclass
class S3Location:
"""
Expand Down

0 comments on commit 3d8e48d

Please sign in to comment.