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

Add support for str and bytes in AxisQuery #114

Merged
merged 1 commit into from
Feb 3, 2023
Merged

Conversation

thetorpedodog
Copy link
Contributor

Because our backend now supports string and bytes queries 1, we no longer need to reject them at the input stage. Also adds more tests.


Related to: single-cell-data/TileDB-SOMA#419

Because our backend now supports string and bytes queries [1],
we no longer need to reject them at the input stage.
Also adds more tests.

[1]: single-cell-data/TileDB-SOMA#861
@johnkerl johnkerl changed the title Add support for str and bytes in AxisQuery. Add support for str and bytes in AxisQuery Feb 3, 2023
Copy link
Member

@johnkerl johnkerl left a comment

Choose a reason for hiding this comment

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

@@ -28,10 +32,10 @@ def _canonicalize_coords(
def _canonicalize_coord(coord: options.SparseDFCoord) -> options.SparseDFCoord:
"""Validates a single coordinate, freezing mutable sequences."""
if coord is None or isinstance(
coord, (int, slice, pa.Array, pa.ChunkedArray, np.ndarray)
coord, (bytes, int, slice, str, pa.Array, pa.ChunkedArray, np.ndarray)
Copy link
Member

Choose a reason for hiding this comment

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

nit: put bytes next to str

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I considered that, but decided on this since it puts all the built-in types in alphabetical order.

@thetorpedodog thetorpedodog merged commit 81f4eb4 into main Feb 3, 2023
@thetorpedodog thetorpedodog deleted the support-str-bytes branch February 3, 2023 18:19
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.

2 participants