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

docs: add clarification around SQL timestamps #1012

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions google/cloud/bigtable/data/execute_query/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ class Bool(Type):
type_field_name = "bool_type"

class Timestamp(Type):
"""
Timestamp supports :class:`DatetimeWithNanoseconds` but Bigtable SQL does
not currently support nanoseconds precision. We support this for potential
compatibility in the future. Nanoseconds are currently ignored.
"""
daniel-sanche marked this conversation as resolved.
Show resolved Hide resolved

type_field_name = "timestamp_type"
expected_types = (
datetime.datetime,
Expand Down
3 changes: 3 additions & 0 deletions google/cloud/bigtable/data/execute_query/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def __repr__(self) -> str:
bool,
bytes,
str,
# Note that Bigtable SQL does not currently support nanosecond precision,
# only microseconds. We use this for compatibility with potential future
# support
DatetimeWithNanoseconds,
date_pb2.Date,
"Struct",
Expand Down
Loading