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

Behavior change for mf timespine without yaml configuration #10857

Merged

Conversation

DevonFulcher
Copy link
Contributor

@DevonFulcher DevonFulcher commented Oct 15, 2024

Linear issue #SL-2935
Github issue #10959
docs: dbt-labs/docs.getdbt.com#6387

Problem

The configuration for the MetricFlow timespine has changed in a previous release. This deprecation warning was previously surfaced in DSI, but that is non-standard for dbt-core usage.

Solution

This PR implements a behavior change to inform users of the deprecation of the old time spine config.

Tests:

  • I ran dbt parse on jaffle-sl-template and saw no warnings
  • I updated jaffle-sl-template to have a metricflow_time_spine.sql model and saw the deprecation warning.
  • I changed the time spine configuration to have a granularity other than day and I saw no warnings.
  • I added this to dbt_project.yaml in jaffle-sl-template and saw no warning for dbt parse:
flags:
  require_yaml_configuration_for_mf_time_spines: True

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

@cla-bot cla-bot bot added the cla:yes label Oct 15, 2024
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.07%. Comparing base (8c6bec4) to head (45a99a0).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10857      +/-   ##
==========================================
- Coverage   89.15%   89.07%   -0.09%     
==========================================
  Files         183      183              
  Lines       23529    23550      +21     
==========================================
- Hits        20977    20976       -1     
- Misses       2552     2574      +22     
Flag Coverage Δ
integration 86.37% <100.00%> (-0.17%) ⬇️
unit 62.28% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 62.28% <100.00%> (+0.01%) ⬆️
Integration Tests 86.37% <100.00%> (-0.17%) ⬇️

@DevonFulcher DevonFulcher marked this pull request as ready for review October 22, 2024 14:46
@DevonFulcher DevonFulcher requested a review from a team as a code owner October 22, 2024 14:46
@github-actions github-actions bot added the community This PR is from a community member label Oct 22, 2024
Copy link
Contributor

@courtneyholcomb courtneyholcomb left a comment

Choose a reason for hiding this comment

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

The parts of the code that I'm familiar with look good to me! Not sure about the protos changes, etc so will need core eyes on those.

In the PR description, I would clarify that the schema has not changed again in case your core reviewer thinks there is a schema change involved in this PR - this is referencing a schema change that has already been released to users.

core/dbt/contracts/graph/semantic_manifest.py Outdated Show resolved Hide resolved
core/dbt/contracts/graph/semantic_manifest.py Show resolved Hide resolved
@DevonFulcher DevonFulcher force-pushed the Behavior_change_for_mf_timespine_without_yaml_configuration branch from e8f65d3 to 6da0bc6 Compare October 29, 2024 16:28
@@ -344,6 +344,7 @@ class ProjectFlags(ExtensibleDbtClassMixin):
skip_nodes_if_on_run_start_fails: bool = False
state_modified_compare_more_unrendered_values: bool = False
state_modified_compare_vars: bool = False
allow_mf_time_spines_without_yaml_configuration: bool = False
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about the naming, require_yaml_configuration_for_mf_time_spines: False instead?

It would be a more conventional nam and better follow our guides: https://github.com/dbt-labs/dbt-core/blob/main/docs/guides/behavior-change-flags.md#rules-for-introducing-a-new-flag

@@ -1,5 +1,5 @@
# Events Module
The Events module is responsible for communicating internal dbt structures into a consumable interface. Because the "event" classes are based entirely on protobuf definitions, the interface is really clearly defined, whether or not protobufs are used to consume it. We use Betterproto for compiling the protobuf message definitions into Python classes.
The Events module is responsible for communicating internal dbt structures into a consumable interface. Because the "event" classes are based entirely on protobuf definitions, the interface is really clearly defined, whether or not protobufs are used to consume it. We use protoc for compiling the protobuf message definitions into Python classes.
Copy link
Contributor

Choose a reason for hiding this comment

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

thank you for these updates <3

):
deprecations.warn(
"mf-timespine-without-yaml-configuration",
)
Copy link
Contributor

@MichelleArk MichelleArk Oct 29, 2024

Choose a reason for hiding this comment

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

Presumably this warning would not be terribly noisy -- (at most) one per invocation? Let me know if I'm off!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is validation for the semantic manifest which there is only one of per project. I can't think of a way that this would fire more than once per invocation.

@MichelleArk
Copy link
Contributor

Could you please create/link a corresponding issue in docs.getdbt.com so the docs team can work on documenting the new behaviour once this is merged?

@MichelleArk MichelleArk merged commit 8a17a0d into main Oct 31, 2024
59 of 60 checks passed
@MichelleArk MichelleArk deleted the Behavior_change_for_mf_timespine_without_yaml_configuration branch October 31, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes community This PR is from a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants