Fix/sr ndit 1663#127
Open
stevenhsd wants to merge 3 commits into
Open
Conversation
…fter data contract validations
…spark parsers to only cast where format exactly as stipulated
georgeRobertson
approved these changes
Jul 10, 2026
| """Mapping of default ISO formats to use when date format not supplied""" | ||
|
|
||
|
|
||
|
|
Comment on lines
+107
to
+109
| entity_fields: dict[str, ModelField] = contract_metadata.schemas[ | ||
| entity_name | ||
| ].__fields__ |
| for column in spark_schema | ||
| if column.name in record_df.columns | ||
| ] | ||
| *[ |
Contributor
There was a problem hiding this comment.
add a #todo for v0.9 as this is breaking in pydantic v2
| return get_spark_cast_statement_from_annotation( | ||
| element_name, python_type, parent_element, date_regex, timestamp_regex | ||
| ) | ||
| element_name, python_type, parent_element) |
| pyarrow = "23.0.1" | ||
| pydantic = "1.10.19" | ||
| pyspark = ">=3.0.0,<=3.5.2" | ||
| pyspark = ">=3.5.0,<=3.5.2" |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



TLDR of changes
Allow custom date formats to cascade to contract stage for casting. Ensure strict casting only - if a date doesn't meet the format exactly then it will be nulled - duckdb is too permissive and spark can error if not the case.
What kind of changes does this PR introduce?
Tick all that apply
Please check if the PR fulfills these requirements