Skip to content

Commit

Permalink
Fix proerly remove duplicates in vehicle positions ingestor using onl…
Browse files Browse the repository at this point in the history
…y subset of columns

How could I be so stupid? Really?
  • Loading branch information
VMois committed Apr 27, 2024
1 parent 4cc17f2 commit 9e6400d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gtfs_realtime_ingestor/ingest_vehicle_positions.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ def extract_vehicle_location():

if chunks_left == 0:
chunks_left = CHUNKS_TO_LOAD
df = pl.DataFrame(flattened_data).unique(keep="last")
df = pl.DataFrame(flattened_data).unique(
subset=["vehicle_id", "timestamp"], keep="last"
)

flattened_data.clear()
object_path = f"realtime/vehicle_{current_hash}.csv"
Expand Down

0 comments on commit 9e6400d

Please sign in to comment.