Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow querying SCDs without metric_time #1621

Merged
merged 6 commits into from
Jan 25, 2025
Merged

Allow querying SCDs without metric_time #1621

merged 6 commits into from
Jan 25, 2025

Conversation

courtneyholcomb
Copy link
Contributor

@courtneyholcomb courtneyholcomb commented Jan 22, 2025

Remove query validation that requires including metric_time in the group by if your query includes an SCD. After much product discussion, we've decided this aligns the behavior users expect for SCDs.

@cla-bot cla-bot bot added the cla:yes label Jan 22, 2025
@dbt-labs dbt-labs deleted a comment from github-actions bot Jan 24, 2025
@dbt-labs dbt-labs deleted a comment from github-actions bot Jan 24, 2025
@courtneyholcomb courtneyholcomb changed the title SCD Tests Allow querying SCDs without metric_time Jan 24, 2025
@courtneyholcomb courtneyholcomb marked this pull request as ready for review January 24, 2025 21:46
@courtneyholcomb courtneyholcomb requested a review from a team as a code owner January 24, 2025 21:46
@courtneyholcomb courtneyholcomb added the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Jan 24, 2025
@github-actions github-actions bot removed the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Jan 24, 2025
Copy link
Contributor

@tlento tlento left a comment

Choose a reason for hiding this comment

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

Ted Lasso Likes This



@pytest.mark.sql_engine_snapshot
@pytest.mark.duckdb_only
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh nice! When did we add this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Fairly recently: #1565


@pytest.mark.sql_engine_snapshot
@pytest.mark.duckdb_only
def test_scd_with_coarser_grain( # noqa: D103
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be worth grouping by the listing as well so we can see when the same one is listed multiple times, and then have the docstring explain what's expected. Up to you if you want to do this.

Comment on lines +6 to +8
2020-01-01T00:00:00 3 2
2020-01-01T00:00:00 4 5
2020-01-01T00:00:00 5 2
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. This one is also interesting because the input data is actually truncated by the filter. This is the behavior we're implementing here but I suspect it's worth documenting these cases in some detail when we update the docs page.

@@ -192,19 +189,4 @@ def validate_measure_in_resolution_dag(
measure_reference: MeasureReference,
resolution_path: MetricFlowQueryResolutionPath,
) -> MetricFlowQueryResolutionIssueSet:
scd_linkable_elemenent_set_for_measure = self._scd_linkable_element_set_for_measure(measure_reference)
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like we can now remove _scd_linkable_element_set_for_measure and the mention of SCD in the class docstring?

@courtneyholcomb courtneyholcomb enabled auto-merge (squash) January 25, 2025 01:38
@courtneyholcomb courtneyholcomb merged commit fb421a5 into main Jan 25, 2025
11 checks passed
@courtneyholcomb courtneyholcomb deleted the court/scd branch January 25, 2025 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants