Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Jul 25, 2024
1 parent bc10c3a commit 7cad472
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions python/pyarrow/_flight.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,8 @@ cdef class FlightEndpoint(_Weakrefable):
self.endpoint.locations.push_back(c_location)

if expiration_time is not None:
self.endpoint.expiration_time = time_point(microseconds(expiration_time.cast(timestamp("us")).value))
self.endpoint.expiration_time = time_point(
microseconds(expiration_time.cast(timestamp("us")).value))

self.endpoint.app_metadata = tobytes(app_metadata)

Expand All @@ -766,8 +767,9 @@ cdef class FlightEndpoint(_Weakrefable):
shared_ptr[CTimestampType] time_type = make_shared[CTimestampType](TimeUnit.TimeUnit_MICRO, UTC)
shared_ptr[CTimestampScalar] shared
if self.endpoint.expiration_time.has_value():
time_since_epoch = duration_cast[microseconds](self.endpoint.expiration_time.value().time_since_epoch()).count()
shared = make_shared[CTimestampScalar](time_since_epoch, time_type);
time_since_epoch = duration_cast[microseconds](
self.endpoint.expiration_time.value().time_since_epoch()).count()
shared = make_shared[CTimestampScalar](time_since_epoch, time_type)
return Scalar.wrap(<shared_ptr[CScalar]> shared)
return None

Expand Down
2 changes: 1 addition & 1 deletion python/pyarrow/includes/chrono.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ cdef extern from "<chrono>" namespace "std::chrono":
cdef extern from "<chrono>" namespace "std::chrono::system_clock":
cdef cppclass time_point:
time_point(const duration& d)
const duration time_since_epoch()
const duration time_since_epoch()
4 changes: 2 additions & 2 deletions python/pyarrow/tests/test_flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,8 @@ def test_eq():
b"foo", [], pa.scalar("2023-04-05T12:34:56").cast(pa.timestamp("s")),
b''),
flight.FlightEndpoint(
b"foo", [],
pa.scalar("2023-04-05T12:34:56.789").cast(pa.timestamp("ms")), b'')),
b"foo", [],
pa.scalar("2023-04-05T12:34:56.789").cast(pa.timestamp("ms")), b'')),
lambda: (flight.FlightEndpoint(b"foo", [], None, b''),
flight.FlightEndpoint(b"foo", [], None, b'meta')),
lambda: (
Expand Down

0 comments on commit 7cad472

Please sign in to comment.