forked from datafold/data-diff
-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
Description
Context
Follow-up from PR #21 code review. Two minor cleanups in Cte.schema.
1. Return type annotation mismatch
Cte.schema is declared -> Schema but the base ITable.schema returns Schema | None. The implementation can return None (when not self.params and source schema is None). Should match the base class signature:
@property
def schema(self) -> Schema | None:File: data_diff/queries/ast_classes.py, line 637
2. Use safezip instead of manual len check + zip
data_diff/utils.py already provides safezip which enforces equal-length zipping (used in 20+ callsites). The manual len check + zip in Cte.schema could be replaced:
from data_diff.utils import safezip
# ...
result = type(s)(dict(safezip(self.params, s.values())))This eliminates the separate length-mismatch guard.
File: data_diff/queries/ast_classes.py, lines 643-646
Reactions are currently unavailable