Skip to content

fix issue where merge fails because source and target have different columns - #264

Merged
tomjemmett merged 4 commits into
mainfrom
remove_merge_condition
Jun 17, 2026
Merged

fix issue where merge fails because source and target have different columns#264
tomjemmett merged 4 commits into
mainfrom
remove_merge_condition

Conversation

@tomjemmett

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 17, 2026 12:37
@tomjemmett
tomjemmett requested a review from a team as a code owner June 17, 2026 12:37

Copilot AI left a comment

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.

Pull request overview

This PR addresses a Delta MERGE failure in the inpatients raw-data pipeline when the source DataFrame schema differs from the existing target Delta table schema (e.g., new columns appear in the source before they exist in the target).

Changes:

  • Removes the conditional whenMatchedUpdateAll(...) predicate to avoid referencing target columns that may not yet exist during schema evolution.
  • Makes matched-row updates unconditional during the merge.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/nhp/data/raw_data/inpatients.py Outdated

@yiwen-h yiwen-h left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you - we talked through this on a call

@tomjemmett
tomjemmett merged commit 13ca51c into main Jun 17, 2026
3 checks passed
@tomjemmett
tomjemmett deleted the remove_merge_condition branch June 17, 2026 13:00
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.

3 participants