-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
In ARROW-134, we added a workaround for Pandas NaT objects in the pandas test. We should encode NaT datetimes as BSON null in the write() function.
Encoding a pandas.NaT object results in an error:
bindings/python/test/test_pandas.py:114: in round_trip res = write(self.coll, data) bindings/python/pymongoarrow/api.py:394: in write enc_tab = RawBSONDocument(encode(next(tabular_gen), codec_options=codec_options)) ../../work/pycharm/mongo-arrow/lib/python3.10/site-packages/bson/__init__.py:1021: in encode return _dict_to_bson(document, check_keys, codec_options) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E ValueError: NaTType does not support utcoffset pandas/_libs/tslibs/nattype.pyx:67: ValueError
- depends on
-
PYTHON-3684 Allow encoding subclasses of built in types, like pandas.NaT
- Backlog
- related to
-
INTPYTHON-135 Add Pandas NA type to TypeRegistry instead of Replacing the Registry
- Backlog