You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
validate_file_for_import is public API and its current shape invited the class of bug that #1829 patched. Proposing an additive replacement plus a deprecation on the existing method - no breaking change now, removal on the next major version.
Returning raw invalid lines forces callers to re-parse to give a useful error, and hands credential-bearing rows back to the caller (mitigated by _redact_password_column but the shape invites the bug).
Proposed replacement:
@dataclass(frozen=True)classCsvImportError:
row: intcolumn: ColumnType|Nonereason: str# never the raw field value@dataclassclassCsvImportResult:
valid_count: interrors: list[CsvImportError]
@staticmethoddefvalidate_import_file(csv_file) ->CsvImportResult: ...
Migration:
Add validate_import_file returning the structured result.
Reimplement validate_file_for_import as a thin wrapper that emits DeprecationWarning and adapts back to the old return shape.
Update samples/ to use the new method.
Remove the deprecated method on the next major version bump.
validate_file_for_importis public API and its current shape invited the class of bug that #1829 patched. Proposing an additive replacement plus a deprecation on the existing method - no breaking change now, removal on the next major version.Current signature:
Two problems with the shape:
_redact_password_columnbut the shape invites the bug).Proposed replacement:
Migration:
validate_import_filereturning the structured result.validate_file_for_importas a thin wrapper that emitsDeprecationWarningand adapts back to the old return shape.samples/to use the new method.🤖 Generated with Claude Code