Skip to content

fix: address failing 2D array compliance tests in DateArray #64

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

Merged
merged 26 commits into from
Mar 24, 2022

Conversation

tswast
Copy link
Collaborator

@tswast tswast commented Jan 27, 2022

Based on #82

test: add a test session with prerelease versions of dependencies

TODO:

  • Fix issues identified by DateArray failures
  • Actually test against TimeArray will do in subsequent PRs
  • Fix issues identified by TimeArray failures
  • Actually test against prerelease dependencies. Done in fix: address failing tests with pandas 1.5.0 #82
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #65 🦕
Towards #28

test: add a test session with prerelease versions of dependencies
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-db-dtypes-pandas API. label Jan 27, 2022
return DateArray([None, datetime.date(2022, 1, 27)])


class Test2DCompat(base.NDArrayBacked2DTests):

Choose a reason for hiding this comment

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

Note that this class is only one of the base test classes you can inherit from to test compliance (and actually a class that tests functionality (2D aspect of the EA) that is currently not used in pandas).
You probably want to add the others as well (see https://github.com/pandas-dev/pandas/blob/main/pandas/tests/extension/base/__init__.py for the different classes, and https://github.com/pandas-dev/pandas/blob/main/pandas/tests/extension/decimal/test_decimal.py for an example that uses them)

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
@tswast tswast changed the title fix: address failing compliance tests in DateArray and TimeArray fix: address failing 2D array compliance tests in DateArray Mar 17, 2022
@tswast tswast marked this pull request as ready for review March 18, 2022 20:33
@tswast tswast requested a review from a team as a code owner March 18, 2022 20:33
@tswast tswast requested review from a team and shollyman March 18, 2022 20:33
Copy link

@leahecole leahecole left a comment

Choose a reason for hiding this comment

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

LGTM for style but perhaps someone from @googleapis/api-bigquery should be a final stamp just to make sure all is well from that end

@tswast tswast merged commit b771e05 into main Mar 24, 2022
@tswast tswast deleted the issue28-NDArrayBacked2DTests branch March 24, 2022 14:47
gcf-merge-on-green bot pushed a commit that referenced this pull request Mar 24, 2022
🤖 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-db-dtypes-pandas API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: NDArrayBacked2DTests compliance tests from pandas are failing
4 participants