Skip to content

Commit

Permalink
docs: add clarification around SQL timestamps (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdingilian committed Aug 8, 2024
1 parent 45bc8c4 commit 6e80190
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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.
"""

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

0 comments on commit 6e80190

Please sign in to comment.