diff --git a/data_diff/databases/presto.py b/data_diff/databases/presto.py index 339f49ec..e6a5b294 100644 --- a/data_diff/databases/presto.py +++ b/data_diff/databases/presto.py @@ -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')" diff --git a/data_diff/queries/ast_classes.py b/data_diff/queries/ast_classes.py index 2df227dc..8e6053a6 100644 --- a/data_diff/queries/ast_classes.py +++ b/data_diff/queries/ast_classes.py @@ -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)