Skip to content

Fix/sr ndit 1663#127

Open
stevenhsd wants to merge 3 commits into
release_v083from
fix/sr-ndit-1663
Open

Fix/sr ndit 1663#127
stevenhsd wants to merge 3 commits into
release_v083from
fix/sr-ndit-1663

Conversation

@stevenhsd

@stevenhsd stevenhsd commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

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

  • fix: A bug fix. Correlates with PATCH in SemVer
  • feat: A new feature. Correlates with MINOR in SemVer
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing or correcting existing tests
  • build: Changes that affect the build system or external dependencies (example scopes: pip, docker, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: GitLabCI)

Please check if the PR fulfills these requirements

  • I have read and followed the Contributing guidance
  • Docs have been added / updated
  • Tests and Linting in the CI are passing
  • Changes have been reviewed and approved by a Project Maintainer

georgeRobertson and others added 2 commits July 2, 2026 16:07
…spark parsers to only cast where format exactly as stipulated
"""Mapping of default ISO formats to use when date format not supplied"""



Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get rid

Comment on lines +107 to +109
entity_fields: dict[str, ModelField] = contract_metadata.schemas[
entity_name
].__fields__

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

for column in spark_schema
if column.name in record_df.columns
]
*[

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format

Comment thread pyproject.toml
pyarrow = "23.0.1"
pydantic = "1.10.19"
pyspark = ">=3.0.0,<=3.5.2"
pyspark = ">=3.5.0,<=3.5.2"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump to 3.5.5?

@georgeRobertson georgeRobertson changed the base branch from main to release_v083 July 10, 2026 14:33
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants