Skip to content

fix(destination-motherduck): fix for camelCase columns being NULL - #70438

Merged
Aaron ("AJ") Steers (aaronsteers) merged 16 commits into
airbytehq:masterfrom
Donnype:donnypy/fix-for-empty-columns-motherduck-destination
Mar 17, 2026
Merged

fix(destination-motherduck): fix for camelCase columns being NULL#70438
Aaron ("AJ") Steers (aaronsteers) merged 16 commits into
airbytehq:masterfrom
Donnype:donnypy/fix-for-empty-columns-motherduck-destination

Conversation

@Donnype

@Donnype Donny Peeters (Donnype) commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

What

More generally:

The UnicodeAwareNormalizer changes the column names in the target schema based on a set of rules:

class UnicodeAwareNormalizer:
    """Normalizer that preserves Unicode characters while following LowerCaseNormalizer behavior for ASCII."""

    def normalize(self, name: str) -> str:
        """
        Normalize name while preserving Unicode characters.

        Behavior:
        - Converts ASCII letters to lowercase
        - Replaces whitespace with underscores
        - Preserves Unicode letters and numbers
        - Adds underscore prefix if name starts with ASCII digit
        - Replaces other special characters with underscores
        """
        ...

The current implementation of the destination code has a bug where the values in the columns that get a new name after normalization will be set to NULL always, because the normalized names were checked against the original column names.

How

This fix creates a mapping between the old and new column names to use the right names (see normalized_keys). It also checks if we "lose" columns in this normalization step, meaning the source data keys/columns were not unique after normalization, e.g.:

{
  "userid": 1, 
  "userId": 2
}

(I am not aware of any guarantee that this cannot happen within Airbyte, in which case we could remove the check.)

I updated the test to incorporate a camel case key and verified that invalid source data is skipped.

Review guide

User Impact

The columns should be ingested properly after this fix. This might require a full refresh.

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

Open with Devin

…olumn definition, fixing e.g. the issue that columns with camel-cased names would always be null if the source has case-sensitive columns names.

Added integration tests for this behavior as well, and make sure we skip ambiguous data such as {"a": 1, "A": 2}.
@CLAassistant

CLAassistant commented Dec 8, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

github-actions Bot commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

👋 Welcome to Airbyte!

Thank you for your contribution from Donnype/airbyte! We're excited to have you in the Airbyte community.

Helpful Resources

PR Slash Commands

As needed or by request, Airbyte Maintainers can execute the following slash commands on your PR:

  • /format-fix - Fixes most formatting issues.
  • /bump-version - Bumps connector versions.
  • /run-connector-tests - Runs connector tests.
  • /run-cat-tests - Runs CAT tests.
  • /run-live-tests - Runs live tests for the modified connector(s).
  • /run-regression-tests - Runs regression tests for the modified connector(s).
  • /build-connector-images - Builds and publishes a pre-release docker image for the modified connector(s).
  • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-dev.{git-sha}) for all modified connectors in the PR.

If you have any questions, feel free to ask in the PR comments or join our Slack community.

Tips for Working with CI

  1. Pre-Release Checks. Please pay attention to these, as they contain standard checks on the metadata.yaml file, docs requirements, etc. If you need help resolving a pre-release check, please ask a maintainer.
    • Note: If you are creating a new connector, please be sure to replace the default logo.svg file with a suitable icon.
  2. Connector CI Tests. Some failures here may be expected if your tests require credentials. Please review these results to ensure (1) unit tests are passing, if applicable, and (2) integration tests pass to the degree possible and expected.
  3. (Optional.) BYO Connector Credentials for tests in your fork. You can optionally set up your fork with BYO credentials for your connector. This can significantly speed up your review, ensuring your changes are fully tested before the maintainers begin their review.

📝 Edit this welcome message.

@DanyloGL

Danylo Jablonski (DanyloGL) commented Dec 9, 2025

Copy link
Copy Markdown
Collaborator

/run-connector-tests

Connector CI Tests Started

These tests will leverage Airbyte's integration test credentials.

Check job output.
✅ Connector CI Tests job completed successfully. See logs for details.

@DanyloGL Danylo Jablonski (DanyloGL) moved this from New PRs to Waiting Eng Team in 🧑‍🏭 Community Pull Requests Dec 10, 2025
@devin-ai-integration devin-ai-integration Bot mentioned this pull request Jan 28, 2026
1 task

@devin-ai-integration devin-ai-integration Bot 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional flags.

Open in Devin Review

@aaronsteers

Copy link
Copy Markdown
Member

Donny Peeters (@Donnype) - This unfortunately got hit by a merge conflict when we merged+released the other. Do you mind updating and pinging me here when I can re-review?

@aaronsteers

Aaron ("AJ") Steers (aaronsteers) commented Jan 29, 2026

Copy link
Copy Markdown
Member

/ai-prove-fix

AI Prove Fix Started

Running readiness checks and testing against customer connections.
View workflow run
🔍 AI Prove Fix session starting... Running readiness checks and testing against customer connections. View playbook

Devin AI session created successfully!

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🧪 AI Prove Fix - Validation In Progress

Session URL: https://app.devin.ai/sessions/bc255d4b838642939ff31ac7162c4eb3

I'm validating PR #70438 (Destination MotherDuck: fix for camelCase columns being NULL).

Current Status

Investigating the fix and preparing test plan...

📋 Initial Assessment

PR Summary: This fix addresses a bug where columns with camelCase names (e.g., keyUpperCase) would always be NULL after ingestion. The issue occurs because the UnicodeAwareNormalizer transforms column names (e.g., to lowercase), but the original code compared normalized schema column names against original data keys.

Fix Approach: Creates a mapping (normalized_keys) between normalized and original column names to correctly match data fields to the schema. Also adds validation to detect and skip records where column names collide after normalization (e.g., userid and userId both becoming userid).

Blockers Identified:

  1. Merge Conflict: The PR has a merge conflict with master that needs resolution
  2. Metadata Validation Error: breakingChanges in metadata.yaml should be a dictionary, not an empty list

This comment will be updated with the full test plan and results. Stand by...

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🧪 Fix Validation Summary

Verdict: NO DECISION - MORE DATA NEEDED

Test Phase Result
Isolated Regression SKIPPED (destination connector)
Live Singleton BLOCKED
Live Batch BLOCKED

Evidence: PR has blockers that prevent live testing - merge conflict and version conflict need resolution.

Next Steps:

  1. Resolve merge conflict with master
  2. Bump version to 0.2.2 (0.2.1 is already published)
  3. Fix metadata.yaml validation error
  4. Re-run /ai-prove-fix once unblocked

📋 Connector & PR Details

Details

Connector: destination-motherduck
PR: #70438
Pre-release Version Tested: N/A (blocked)
Current Published Version: 0.2.1 (published 2026-01-29)

🎯 Validation Thesis & Test Plan

Success Thesis

If this fix works, columns with camelCase names (e.g., keyUpperCase, userId) should be correctly populated with their values instead of being NULL. The fix creates a mapping between normalized column names and original data keys, allowing the destination to correctly match data fields to the schema.

Failure Thesis

If this fix doesn't work, camelCase columns would still be NULL after sync. If the fix introduces regressions, previously working syncs with all-lowercase column names may fail or produce incorrect data.

Test Plan (Blocked)

Primary Test Connections Identified:

  • Internal Airbyte connections (12 connections found in @airbyte-internal org)
  • MotherDuck partner connections (13 workspaces found with @motherduck.com emails)
  • 50+ customer connections available for testing

Healthy Connection for Regression Testing:

  • GitHub Issues, Comments, and Discussions → MotherDuck (connection de26a533-9c17-45cc-a4cd-c724fb1e5340)
  • Recent syncs: All successful (20+ consecutive successes)
  • Last sync: 2026-01-29 02:42:50 UTC

Testing Scope Rationale: This is a functional code change that modifies how data fields are matched to schema columns. Batch testing on 2-3 additional connections would be needed to verify no regressions across different source types and configurations.

✅ Pre-flight Checks

Checks

  • Viability: Fix addresses the reported issue

    • Creates normalized_keys mapping to correctly match data fields to normalized schema columns
    • Adds validation to detect and skip records with duplicate column names after normalization
    • Tests updated to include camelCase columns (keyUpperCase)
  • Safety: No malicious code or dangerous patterns

    • Changes are focused on the specific bug fix
    • No suspicious code patterns or external network calls
    • No credential handling or data exfiltration
  • Reversibility: Can be safely downgraded/reverted

    • Patch version bump (0.2.0 → 0.2.1)
    • No state format changes
    • No schema or config format changes
    • Rolling back would simply revert to previous behavior
🚫 Blockers Preventing Live Testing

1. Merge Conflict

The PR has a merge conflict with master that needs to be resolved by the contributor. AJ noted this in comment.

2. Version Conflict

The PR bumps to version 0.2.1, but version 0.2.1 is already published (published 2026-01-29T17:16:08.851000Z). The PR needs to bump to 0.2.2 instead.

3. Metadata Validation Error

The metadata.yaml file has a validation error:

Metadata file is invalid: Validation error: 1 validation error for ConnectorMetadataDefinitionV0
data.releases.breakingChanges
  Input should be a valid dictionary [type=dict_type, input_value=[], input_type=list]

The breakingChanges field should be a dictionary {}, not an empty list [].


Session URL: https://app.devin.ai/sessions/bc255d4b838642939ff31ac7162c4eb3

Once the blockers are resolved, I can publish a pre-release and run live connection tests to validate the fix.

…f github.com:Donnype/airbyte into donnypy/fix-for-empty-columns-motherduck-destination

@devin-ai-integration devin-ai-integration Bot 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.

Devin Review found 1 new potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

@Donnype

Copy link
Copy Markdown
Contributor Author

Aaron ("AJ") Steers (@aaronsteers) I fixed the conflicts, although I did not redirected the errors yet like you suggested, not sure where to put the error array yet.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🙋 Escalating per Hands-Free AI Triage Project triage.

Reason: Community PR has been stalled 21+ days. Merge conflict and version conflict (0.2.1 already published) remain unresolved since Jan 29 request. Escalated to #human-in-the-loop for a maintainer to either assist the contributor or take over the fix.

#72410

Requested by Aaron ("AJ") Steers (@aaronsteers).

Devin session

@Donnype

Copy link
Copy Markdown
Contributor Author

Aaron ("AJ") Steers (@aaronsteers) Conflicts had been resolved earlier, can we move this forward and discuss redirecting the errors in a separate PR?

@aaronsteers Aaron ("AJ") Steers (aaronsteers) changed the title Destination MotherDuck: fix for camelCase columns being NULL fix(destination-motherduck): fix for camelCase columns being NULL Mar 17, 2026
@aaronsteers

Aaron ("AJ") Steers (aaronsteers) commented Mar 17, 2026

Copy link
Copy Markdown
Member

/run-connector-tests

Connector CI Tests Started

These tests will leverage Airbyte's integration test credentials.

Check job output.
✅ Connector CI Tests job completed successfully. See logs for details.

@github-project-automation github-project-automation Bot moved this from Waiting Eng Team to Ready to Ship in 🧑‍🏭 Community Pull Requests Mar 17, 2026
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) merged commit eecb22a into airbytehq:master Mar 17, 2026
33 of 35 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Ship to Done in 🧑‍🏭 Community Pull Requests Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

5 participants