Skip to content

Commit

Permalink
Use scalar timestamp types in Sequence and Slice. (#140)
Browse files Browse the repository at this point in the history
Sequences don't want ndarrays of timestamps, they want just timestamps.
Also introduces pyarrow timestamps to dataframe coordinates.
  • Loading branch information
thetorpedodog authored Feb 24, 2023
1 parent 0c4939d commit b337106
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions python-spec/src/somacore/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,20 @@ class ResultOrder(enum.Enum):
# https://github.com/single-cell-data/TileDB-SOMA/issues/960
SparseDFCoord = Union[
DenseCoord,
float,
np.datetime64,
pa.TimestampType,
Sequence[int],
Sequence[float],
Sequence[str],
Sequence[bytes],
Sequence[npt.NDArray[np.datetime64]],
Sequence[np.datetime64],
Sequence[pa.TimestampType],
types.Slice[float],
types.Slice[str],
types.Slice[bytes],
types.Slice[npt.NDArray[np.datetime64]],
types.Slice[np.datetime64],
types.Slice[pa.TimestampType],
pa.Array,
pa.ChunkedArray,
npt.NDArray[np.integer],
Expand Down
2 changes: 1 addition & 1 deletion python-spec/src/somacore/query/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _canonicalize_coord(coord: options.SparseDFCoord) -> options.SparseDFCoord:
pa.ChunkedArray,
np.ndarray,
np.datetime64,
pa.lib.TimestampType,
pa.TimestampType,
),
):
return coord
Expand Down

0 comments on commit b337106

Please sign in to comment.