Skip to content

Commit 4e7e207

Browse files
Satish Kumarmeta-codesync[bot]
authored andcommitted
Fix OSS build failures
Summary: Changes for OSS thrift-python compatibility: `sink.pyx`: Cython requires `noexcept` on callback functions. Adds it to `sink_final_resp_callback`. `adapter.py`: GitHub CI runs in UTC while `DatetimeAdapter.from_thrift` uses local timezone. Changes test assertion to use `datetime.fromtimestamp()` for timezone-agnostic comparison. Reviewed By: prakashgayasen Differential Revision: D90645108 fbshipit-source-id: cdf2595d20c1019d5b4efd1d388331e9dc7bdb29
1 parent 35d7c22 commit 4e7e207

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

third-party/thrift/src/thrift/lib/python/streaming/sink.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ cdef raise_first_exception_field(response_struct):
134134
cdef void sink_final_resp_callback(
135135
cFollyTry[unique_ptr[cIOBuf]]&& res,
136136
PyObject* user_data,
137-
):
137+
) noexcept:
138138
future, final_resp_cls, sink_elem_cls, protocol = <object> user_data
139139

140140
try:

third-party/thrift/src/thrift/lib/python/test/adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def test_directly_annotated(self) -> None:
263263
self.assertIsInstance(foo.baz.value, self._fbthrift_unadapted_Baz)
264264

265265
def test_adapted_variable(self) -> None:
266-
self.assertEqual(self.NINETEEN_EIGHTY_FOUR, datetime(1984, 1, 1))
266+
self.assertEqual(self.NINETEEN_EIGHTY_FOUR, datetime.fromtimestamp(441792000))
267267
self.assertEqual(self._fbthrift_unadapted_NINETEEN_EIGHTY_FOUR, 441792000)
268268

269269
def test_adapted_field_with_default_value(self) -> None:

0 commit comments

Comments
 (0)