fix: correct TypeError and comparison issues discovered in DateArray compliance tests#79
fix: correct TypeError and comparison issues discovered in DateArray compliance tests#79
Conversation
test: add a test session with prerelease versions of dependencies
This makes them consistent with other date/time dtypes, as well as internally consistent with the advertised `dtype.na_value`. BREAKING-CHANGE: dbdate and dbtime dtypes return NaT instead of None for missing values Release-As: 0.4.0
…types-pandas into issue28-TypeError
parthea
left a comment
There was a problem hiding this comment.
Added minor observations, otherwise LGTM
.github/workflows/unittest.yml
Outdated
| name: coverage-artifacts | ||
| path: .coverage-${{ matrix.python }} | ||
|
|
||
| compliance: |
There was a problem hiding this comment.
alternatively, you could pull this into a separate file called unittest-compliance.yml and remove the customizations in owlbot.py for .github/workflows/unittest.yml. Owlbot shouldn't overwrite the changes because unittest-compliance.yml doesn't exist in templates.
There was a problem hiding this comment.
I'll give that a try! I was thinking mostly about having this count towards coverage, but I see that specifically calls out tests/unit, so this isn't as important.
|
|
||
|
|
||
| class TestGetitem(base.BaseGetitemTests): | ||
| def test_take_na_value_other_date(self): |
There was a problem hiding this comment.
It would be helpful to have an additional comment in the test to clarify the expected behaviour
There was a problem hiding this comment.
👍 Would have been nice if pandas had a bit more of an explanatory comment, but I'll try and deduce why this test was added in pandas-dev/pandas#20814. Perhaps it's not even necessary in general?
There was a problem hiding this comment.
Removed, as most other extension dtype tests don't have it.
🤖 I have created a release *beep* *boop* --- ## [0.4.0](v0.3.1...v0.4.0) (2022-03-24) ### ⚠ BREAKING CHANGES * * fix: address failing compliance tests in DateArray and TimeArray * * fix: address failing compliance tests in DateArray and TimeArray * * fix: address failing compliance tests in DateArray and TimeArray * * fix: address failing compliance tests in DateArray and TimeArray * * fix: address failing compliance tests in DateArray and TimeArray * * fix: address failing compliance tests in DateArray and TimeArray * dbdate and dbtime dtypes return NaT instead of None for missing values ### Features * dbdate and dbtime support numpy.datetime64 values in array constructor ([1db1357](1db1357)) ### Bug Fixes * address failing 2D array compliance tests in DateArray ([#64](#64)) ([b771e05](b771e05)) * address failing tests with pandas 1.5.0 ([#82](#82)) ([38ac28d](38ac28d)) * allow comparison with scalar values ([#88](#88)) ([7495698](7495698)) * avoid TypeError when using sorted search ([#84](#84)) ([42bc2d9](42bc2d9)) * correct TypeError and comparison issues discovered in DateArray compliance tests ([#79](#79)) ([1e979cf](1e979cf)) * dbdate and dbtime support set item with null values ([#85](#85)) ([1db1357](1db1357)) * use `pandas.NaT` for missing values in dbdate and dbtime dtypes ([#67](#67)) ([f903c2c](f903c2c)) * use public pandas APIs where possible ([#60](#60)) ([e9d41d1](e9d41d1)) ### Tests * add dbtime compliance tests ([#90](#90)) ([f14fb2b](f14fb2b)) * add final dbdate compliance tests and sort ([#89](#89)) ([efe7e6d](efe7e6d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [0.4.0](googleapis/python-db-dtypes-pandas@v0.3.1...v0.4.0) (2022-03-24) ### ⚠ BREAKING CHANGES * * fix: address failing compliance tests in DateArray and TimeArray * * fix: address failing compliance tests in DateArray and TimeArray * * fix: address failing compliance tests in DateArray and TimeArray * * fix: address failing compliance tests in DateArray and TimeArray * * fix: address failing compliance tests in DateArray and TimeArray * * fix: address failing compliance tests in DateArray and TimeArray * dbdate and dbtime dtypes return NaT instead of None for missing values ### Features * dbdate and dbtime support numpy.datetime64 values in array constructor ([1db1357](googleapis/python-db-dtypes-pandas@1db1357)) ### Bug Fixes * address failing 2D array compliance tests in DateArray ([#64](googleapis/python-db-dtypes-pandas#64)) ([b771e05](googleapis/python-db-dtypes-pandas@b771e05)) * address failing tests with pandas 1.5.0 ([#82](googleapis/python-db-dtypes-pandas#82)) ([38ac28d](googleapis/python-db-dtypes-pandas@38ac28d)) * allow comparison with scalar values ([#88](googleapis/python-db-dtypes-pandas#88)) ([7495698](googleapis/python-db-dtypes-pandas@7495698)) * avoid TypeError when using sorted search ([#84](googleapis/python-db-dtypes-pandas#84)) ([42bc2d9](googleapis/python-db-dtypes-pandas@42bc2d9)) * correct TypeError and comparison issues discovered in DateArray compliance tests ([#79](googleapis/python-db-dtypes-pandas#79)) ([1e979cf](googleapis/python-db-dtypes-pandas@1e979cf)) * dbdate and dbtime support set item with null values ([#85](googleapis/python-db-dtypes-pandas#85)) ([1db1357](googleapis/python-db-dtypes-pandas@1db1357)) * use `pandas.NaT` for missing values in dbdate and dbtime dtypes ([#67](googleapis/python-db-dtypes-pandas#67)) ([f903c2c](googleapis/python-db-dtypes-pandas@f903c2c)) * use public pandas APIs where possible ([#60](googleapis/python-db-dtypes-pandas#60)) ([e9d41d1](googleapis/python-db-dtypes-pandas@e9d41d1)) ### Tests * add dbtime compliance tests ([#90](googleapis/python-db-dtypes-pandas#90)) ([f14fb2b](googleapis/python-db-dtypes-pandas@f14fb2b)) * add final dbdate compliance tests and sort ([#89](googleapis/python-db-dtypes-pandas#89)) ([efe7e6d](googleapis/python-db-dtypes-pandas@efe7e6d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
As #64 was getting long, this pulls out some of the smaller changes for easier review.
The compliance tests are modeled after https://github.com/pandas-dev/pandas/blob/main/pandas/tests/extension/decimal/test_decimal.py, including the order of classes in the test suite. "Reduce" classes are skipped due to #78
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Towards #28 🦕
TODO: