Skip to content

Fix temporal partition resolution when source column has multiple dimension links#2052

Merged
shangyian merged 1 commit intoDataJunction:mainfrom
shangyian:dim-link-reverse-map
Apr 24, 2026
Merged

Fix temporal partition resolution when source column has multiple dimension links#2052
shangyian merged 1 commit intoDataJunction:mainfrom
shangyian:dim-link-reverse-map

Conversation

@shangyian
Copy link
Copy Markdown
Collaborator

@shangyian shangyian commented Apr 24, 2026

Summary

This PR fixes temporal partition resolution when a column has multiple dimension links. The issue was that get_temporal_partitions collapsed the source-column to dimension attribute mapping into a single-valued dict, so when the same FK column (e.g., region_date) was referenced by multiple dimension links (e.g., one simple and one multi-column), only the last link survived.

If the user selected the other link's dimension attribute in the cube grain, the temporal partition output column was left as the source name, causing materialization to fail with:

Detected temporal partition column 'region_date' is not in the combined query output columns.

The change now iterates over every candidate dimension attribute and picks the first one that matches grain columns.

Test Plan

Added a new TestGetTemporalPartitionsMultipleDimLinks that constructs a fact with both link shapes sharing region_date and verifies output name resolves to dateint.

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2026

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 6762475
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/69eb33d07985330008dc723e

@shangyian shangyian force-pushed the dim-link-reverse-map branch from c88601a to 6762475 Compare April 24, 2026 09:11
@shangyian shangyian marked this pull request as ready for review April 24, 2026 23:15
@shangyian shangyian merged commit 695f0d8 into DataJunction:main Apr 24, 2026
25 checks passed
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.

1 participant