Skip to content

Conversation

@tcuongd
Copy link
Collaborator

@tcuongd tcuongd commented May 17, 2023

pandas 2.0 introduces some breaking changes to read_json() (see pandas-dev/pandas#52595):,

  • Timezone-naive strings are read as timezone-aware
  • On Windows, integer indices are read as np.int64 (whereas they were np.int32 in the past)

This mainly affects our serialize / deserialize functionality, and I was hoping for a fix from pandas rather than patching it on our side (because it doesn't seem trivial). There is the more urgent issue of incompatibility with holidays 0.25 though, so in order to get a release out to address the issue, I'll skip / patch the serialize tests for now. We'll need to revisit the serialization stuff ASAP though.

Also bumping the versirson number for the release, so doing it here.

Tests

❯ python -m pytest prophet/tests/test_serialize.py
================================================================================ test session starts ================================================================================
platform darwin -- Python 3.9.16, pytest-7.3.1, pluggy-1.0.0
rootdir: /Users/cuong/projects/prophet/python
plugins: anyio-3.6.2
collected 3 items

prophet/tests/test_serialize.py ..s                                                                                                                                           [100%]

================================================================================= warnings summary ==================================================================================
prophet/tests/test_serialize.py::TestSerialize::test_simple_serialize[CMDSTANPY]
prophet/tests/test_serialize.py::TestSerialize::test_full_serialize[CMDSTANPY]
  /Users/cuong/projects/prophet/python/prophet/serialize.py:160: FutureWarning: The behavior of Timestamp.utcfromtimestamp is deprecated, in a future version will return a timezone-aware Timestamp with UTC timezone. To keep the old behavior, use Timestamp.utcfromtimestamp(ts).tz_localize(None). To get the future behavior, use Timestamp.fromtimestamp(ts, 'UTC')
    setattr(model, attribute, pd.Timestamp.utcfromtimestamp(model_dict[attribute]).tz_localize(None))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
===================================================================== 2 passed, 1 skipped, 2 warnings in 3.36s ======================================================================

@tcuongd tcuongd merged commit 49e455a into main May 17, 2023
@tcuongd tcuongd deleted the tcuongd-mark-serialize-skip branch May 17, 2023 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants