From 0844d3e493c77a2bbe20fb16e78ec4e7cb01acaf Mon Sep 17 00:00:00 2001 From: Enrico Minack Date: Fri, 30 Aug 2024 11:36:50 +0200 Subject: [PATCH] Remove chrono.pxd, use existing CTimePoint instead --- python/pyarrow/_flight.pyx | 1 - python/pyarrow/includes/chrono.pxd | 38 --------------------- python/pyarrow/includes/libarrow_flight.pxd | 4 +-- 3 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 python/pyarrow/includes/chrono.pxd diff --git a/python/pyarrow/_flight.pyx b/python/pyarrow/_flight.pyx index d84d03f157415..ea67feb08f5e2 100644 --- a/python/pyarrow/_flight.pyx +++ b/python/pyarrow/_flight.pyx @@ -32,7 +32,6 @@ from pyarrow.lib cimport * from pyarrow.lib import (ArrowCancelled, ArrowException, ArrowInvalid, SignalStopHandler) from pyarrow.lib import as_buffer, frombytes, timestamp, tobytes -from pyarrow.includes.chrono cimport duration_cast, nanoseconds from pyarrow.includes.libarrow_flight cimport * from pyarrow.ipc import _get_legacy_format_default, _ReadPandasMixin import pyarrow.lib as lib diff --git a/python/pyarrow/includes/chrono.pxd b/python/pyarrow/includes/chrono.pxd deleted file mode 100644 index 93640c7234dbe..0000000000000 --- a/python/pyarrow/includes/chrono.pxd +++ /dev/null @@ -1,38 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# distutils: language = c++ - -from libc.stdint cimport * - - -cdef extern from "" namespace "std::chrono": - cdef cppclass duration: - duration(int64_t count) - const int64_t count() - - cdef cppclass nanoseconds(duration): - nanoseconds(int64_t count) - - T duration_cast[T](duration d) - - -cdef extern from "" namespace "std::chrono::system_clock": - cdef cppclass time_point: - time_point(const duration& d) - const duration time_since_epoch() - ctypedef duration duration diff --git a/python/pyarrow/includes/libarrow_flight.pxd b/python/pyarrow/includes/libarrow_flight.pxd index d2bc3c9d0da23..eefad537dcec8 100644 --- a/python/pyarrow/includes/libarrow_flight.pxd +++ b/python/pyarrow/includes/libarrow_flight.pxd @@ -19,7 +19,7 @@ from pyarrow.includes.common cimport * from pyarrow.includes.libarrow cimport * -from pyarrow.includes.chrono cimport time_point +from pyarrow.includes.libarrow_python cimport CTimePoint cdef extern from "arrow/flight/api.h" namespace "arrow" nogil: @@ -135,7 +135,7 @@ cdef extern from "arrow/flight/api.h" namespace "arrow" nogil: CTicket ticket vector[CLocation] locations - optional[time_point] expiration_time + optional[CTimePoint] expiration_time c_string app_metadata bint operator==(CFlightEndpoint)