Skip to content
Open
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
3 changes: 1 addition & 2 deletions data_diff/databases/presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ def normalize_uuid(self, value: str, coltype: ColType_UUID) -> str:
return f"TRIM(CAST({value} AS VARCHAR))"

def normalize_timestamp(self, value: str, coltype: TemporalType) -> str:
# TODO rounds
if coltype.rounds:
s = f"date_format(cast({value} as timestamp(6)), '%Y-%m-%d %H:%i:%S.%f')"
s = f"date_format(cast({value} as timestamp({coltype.precision})), '%Y-%m-%d %H:%i:%S.%f')"
else:
s = f"date_format(cast({value} as timestamp(6)), '%Y-%m-%d %H:%i:%S.%f')"

Expand Down
2 changes: 1 addition & 1 deletion data_diff/queries/ast_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def select(self, *exprs, **named_exprs) -> Self | ITable:
named_exprs = _drop_skips_dict(named_exprs)
exprs += _named_exprs_as_aliases(named_exprs)
resolve_names(self.source_table, exprs)
# TODO Ensure exprs <= self.columns ?
# No explicit subset check needed; resolve_names() raises KeyError for invalid column names (when schema is present)
return attrs.evolve(self, columns=exprs)


Expand Down
Loading