Skip to content

Conversation

@chalmerlowe
Copy link
Collaborator

WIP do not review.

This commit adds a new test case to tests/unit/test__pandas_helpers.py to cover the range_timestamp_dtype branch in the default_types_mapper function.

Due to issues importing RangeTIMESTAMPDtype directly, a mock class (MockRangeTSDtype) was used to simulate the necessary pyarrow_dtype attribute for the test. This ensures the logic of the default_types_mapper for range_timestamp_dtype is correctly tested.

The pragma: NO COVER comment associated with this branch in google/cloud/bigquery/_pandas_helpers.py has been removed as the branch is now covered by this new test.

This commit adds a new test case to `tests/unit/test__pandas_helpers.py`
to cover the `range_timestamp_dtype` branch in the `default_types_mapper`
function.

Due to issues importing `RangeTIMESTAMPDtype` directly, a mock class
(`MockRangeTSDtype`) was used to simulate the necessary `pyarrow_dtype`
attribute for the test. This ensures the logic of the `default_types_mapper`
for `range_timestamp_dtype` is correctly tested.

The `pragma: NO COVER` comment associated with this branch in
`google/cloud/bigquery/_pandas_helpers.py` has been removed as the
branch is now covered by this new test.

All existing tests continue to pass.
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery API. labels May 30, 2025
@chalmerlowe chalmerlowe changed the title Add test for range_timestamp_dtype in type_mapper test: Add test for range_timestamp_dtype in type_mapper Jun 2, 2025
@chalmerlowe chalmerlowe closed this Jun 9, 2025
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-bigquery API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant