Skip to content

pyopensky 2.18

Latest

Choose a tag to compare

@junzis junzis released this 25 Oct 10:16

pyopensky 2.18

This release adds route batching and configurable Trino sessions, and fixes flight-table alias handling in historical and raw-message queries.

Highlights

  • Query exact directed airport pairs with routes=[("KJFK", "EGLL"), ...] in history(), flightlist(), and rawdata(). Include all required routes in each time window to avoid submitting one state-vector query per route.
  • Configure a client with Trino(session_properties={...}). For selective flight joins, join_distribution_type="BROADCAST" can reduce CPU, scan bytes, and worker network traffic. The filtered build table must fit in each worker's memory. The default client uses the server's session settings.
  • Flight metadata filters and selected flight columns use the existing joined flight table, avoiding unintended unjoined scans and duplicated results. Independent nested SELECT queries retain their own tables and time windows.
  • Result-cache keys include configured session properties. Property ordering does not affect the cache key.
  • Updated documentation explains route matching, query batching, session settings, and trajectory clipping at start/stop. Added offline regression tests and a reproducible uncached live benchmark script.

Example

from pyopensky.trino import Trino

trino = Trino()
df = trino.history(
    "2025-06-01 12:00",
    "2025-06-01 13:00",
    routes=[("EGLL", "KJFK"), ("LFPG", "KJFK"), ("EHAM", "KJFK")],
    selected_columns=("time", "icao24", "callsign", "lat", "lon"),
)

Validation

  • Full local test suite: 67 passed, 3 existing skips.
  • Lint, formatting, type checks, and lockfile consistency checks pass.
  • Wheel and source distribution build successfully and pass strict Twine checks.
  • Prior live benchmarks verified identical results with the result cache disabled. Performance depends on the workload and server/storage state.

Install after publication

pip install --upgrade pyopensky==2.18