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

Bug fix: apply time constraints after time offsets #1544

Merged
merged 4 commits into from
Dec 9, 2024

Conversation

courtneyholcomb
Copy link
Contributor

@courtneyholcomb courtneyholcomb commented Nov 21, 2024

Time constraints were being applied before time offsets in some scenarios. This is incorrect because the values will change during the offset. This fixes that. Customers likely never saw this bug because time constraints are only available to open source users, and this may never have been released to them.

@courtneyholcomb courtneyholcomb changed the title WIP - bug fix for time constraints on offset metrics. need to validat… Bug fix: apply time constraints after time offsets Nov 21, 2024
@dbt-labs dbt-labs deleted a comment from github-actions bot Nov 21, 2024
@courtneyholcomb courtneyholcomb marked this pull request as ready for review November 21, 2024 22:24
@courtneyholcomb courtneyholcomb added the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Nov 21, 2024
@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 Nov 21, 2024
if metric_spec.has_time_offset:
queried_agg_time_dimension_specs = queried_linkable_specs.included_agg_time_dimension_specs_for_metric(
metric_reference=metric_spec.reference, metric_lookup=self._metric_lookup
)
output_node = JoinToTimeSpineNode.create(
parent_node=output_node,
requested_agg_time_dimension_specs=queried_agg_time_dimension_specs,
time_range_constraint=predicate_pushdown_state.time_range_constraint,
Copy link
Contributor

Choose a reason for hiding this comment

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

Without the filter, is the join producing a lot more rows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be! But with it, the results might be inaccurate.

Base automatically changed from court/simp4 to main December 9, 2024 19:51
Time constraints were being applied before time offsets in some scenarios. This is incorrect because the values will change during the offset. This fixes that. Customers likely never saw this bug because time constraints are only available to open source users, and this may never have been released to them.
@cla-bot cla-bot bot added the cla:yes label Dec 9, 2024
@courtneyholcomb courtneyholcomb enabled auto-merge (squash) December 9, 2024 21:05
@courtneyholcomb courtneyholcomb merged commit c262086 into main Dec 9, 2024
25 checks passed
@courtneyholcomb courtneyholcomb deleted the court/simp4.5 branch December 9, 2024 21:09
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.

2 participants