Skip to content
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
2 changes: 1 addition & 1 deletion data_diff/databases/_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def _connection_created(self, db):
try:
db.query(db.dialect.set_timezone_to_utc())
except NotImplementedError:
logging.debug(
logging.warning(
f"Database '{db}' does not allow setting timezone. We recommend making sure it's set to 'UTC'."
)
return db
Expand Down
4 changes: 3 additions & 1 deletion data_diff/databases/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ def to_comparable(self, value: str, coltype: ColType) -> str:
return super().to_comparable(value, coltype)

def set_timezone_to_utc(self) -> str:
raise NotImplementedError()
# BigQuery uses stateless REST jobs; SET @@time_zone only affects a single job,
# not subsequent queries. BigQuery stores timestamps in UTC internally.
raise NotImplementedError("BigQuery uses stateless jobs; session SET has no cross-query effect.")

def parse_table_name(self, name: str) -> DbPath:
path = parse_table_name(name)
Expand Down
2 changes: 1 addition & 1 deletion data_diff/databases/clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def parse_type(self, table_path: DbPath, info: RawColumnInfo) -> ColType:
# return f"'{str(t)[:19]}'"

def set_timezone_to_utc(self) -> str:
raise NotImplementedError()
return "SET session_timezone = 'UTC'"

def current_timestamp(self) -> str:
return "now()"
Expand Down
Loading