Skip to content

fix: parse column from cast expression for ScdType2 models#5475

Merged
toriwei merged 2 commits intomainfrom
tori/fix-column-name-validation
Oct 3, 2025
Merged

fix: parse column from cast expression for ScdType2 models#5475
toriwei merged 2 commits intomainfrom
tori/fix-column-name-validation

Conversation

@toriwei
Copy link
Contributor

@toriwei toriwei commented Oct 2, 2025

No description provided.

if v is None:
return None
parsed = d.parse_one(v)
if isinstance(parsed, exp.Cast) and isinstance(parsed.this, exp.Column):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a comment explaining that both scd type 2 expects a column and the logic for it does a cast anyways so this shouldn't be needed? Could be an issue later so it would at least explaining the reasoning at this time.

Copy link
Contributor Author

@toriwei toriwei Oct 2, 2025

Choose a reason for hiding this comment

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

updated with:


        """
        Extract column name if updated_at contains a cast.

        SCDType2ByTimeKind and SCDType2ByColumnKind expect a column, and the casting is done later.
        """

@toriwei toriwei marked this pull request as ready for review October 2, 2025 22:41
@toriwei toriwei merged commit 285b8f2 into main Oct 3, 2025
36 checks passed
@toriwei toriwei deleted the tori/fix-column-name-validation branch October 3, 2025 16:53
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