Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in tests caused by pandas fixed by pandas 2.1.4 #211

Merged
merged 2 commits into from
Dec 18, 2023
Merged

Conversation

willu47
Copy link
Member

@willu47 willu47 commented Dec 15, 2023

Resolves the failing tests which were caused by a regression in version 2.1.0 of pandas.

Description

I ran tests for Python 3.9 and pandas v2.1.0 through v2.1.4. All tests pass for the latest version (v2.1.4) of pandas.

The version pin has been updated to force use of pandas 2.1.4 and later.

Also, a future deprecation issue was resolved.

Issue Ticket Number

Closes #194

Documentation

@willu47 willu47 requested a review from trevorb1 December 15, 2023 14:04
Copy link
Member

@trevorb1 trevorb1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willu47, LGTM! I made two small changes:

  • Updated pandas version in docs/requirements.txt
  • Added a changelog note

When I run tests with python 3.11.5 and pandas v2.1.4 everything works fine. But if I bump to python 3.12.0 (the default conda install) I get the following warnings. I will add this to a new issue though, as this is now a datetime warning and not a pandas issue

============================================================ warnings summary ============================================================
.tox/default/lib/python3.12/site-packages/dateutil/tz/tz.py:37
  /home/trevorb1/master/otoole/.tox/default/lib/python3.12/site-packages/dateutil/tz/tz.py:37: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    EPOCH = datetime.datetime.utcfromtimestamp(0)

tests/test_convert.py: 7 warnings
tests/test_read_strategies.py: 2 warnings
tests/test_utils.py: 2 warnings
tests/test_write_strategies.py: 1 warning
  /home/trevorb1/master/otoole/.tox/default/lib/python3.12/site-packages/openpyxl/packaging/core.py:99: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    now = datetime.datetime.utcnow()

tests/test_convert.py::TestWrite::test_write_excel
tests/test_write_strategies.py::TestWriteExcel::test_write_out_empty_dataframe
  /home/trevorb1/master/otoole/.tox/default/lib/python3.12/site-packages/openpyxl/writer/excel.py:292: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    workbook.properties.modified = datetime.datetime.utcnow()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

---------- coverage: platform linux, python 3.12.0-final-0 -----------
Coverage HTML written to dir htmlcov

============================================== 209 passed, 1 skipped, 15 warnings in 50.15s ==============================================

@willu47 willu47 merged commit 1197393 into master Dec 18, 2023
12 checks passed
@willu47 willu47 deleted the issue_194 branch December 18, 2023 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: pandas v2.1 breaks tests
2 participants