From a52cd054dbce176bb0009de9c71e429b73ab05a5 Mon Sep 17 00:00:00 2001 From: Xavier Olive Date: Wed, 30 Oct 2024 23:04:08 +0100 Subject: [PATCH] fix pyarrow --- src/traffic/algorithms/openap.py | 2 +- src/traffic/core/time.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/traffic/algorithms/openap.py b/src/traffic/algorithms/openap.py index 9b9e990a..7da0ab25 100644 --- a/src/traffic/algorithms/openap.py +++ b/src/traffic/algorithms/openap.py @@ -32,7 +32,7 @@ def phases(self, twindow: int = 60) -> "Flight": fp = FlightPhase() fp.set_trajectory( - (self.data.timestamp.astype(int) // 1_000_000_000).values, + self.data.timestamp.dt.as_unit("s").astype(int).values, altitude, groundspeed, vertical_rate, diff --git a/src/traffic/core/time.py b/src/traffic/core/time.py index c4e06530..39e45385 100644 --- a/src/traffic/core/time.py +++ b/src/traffic/core/time.py @@ -1,5 +1,5 @@ import logging -from datetime import datetime, timezone +from datetime import datetime from numbers import Real from pyopensky.time import ( @@ -53,4 +53,4 @@ def to_datetime(time: timelike) -> pd.Timestamp: "automatically, look at the tzinfo (resp. tz) argument of the " "datetime (resp. pd.Timestamp) constructor." ) - return time # type: ignore + return time