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

Feature/sunset full statement version #109

Merged
merged 13 commits into from
Jul 9, 2024

Conversation

fivetran-catfritz
Copy link
Contributor

@fivetran-catfritz fivetran-catfritz commented Jun 27, 2024

PR Overview

This PR will address the following Issue/Feature:

This PR will result in the following new package version:

  • v0.10.0 breaking because of deprecation

Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:

🚨 Breaking Changes 🚨

  • The parameter full_statement_version=false has been fully sunset from the sfdc_formula_view macro. You will now need to remove this parameter to avoid a compilation error.

Under the hood

  • Included auto-releaser GitHub Actions workflow to automate future releases.
  • Updated maintainer pull request template.

PR Checklist

Basic Validation

Please acknowledge that you have successfully performed the following commands locally:

  • dbt run –full-refresh && dbt test
  • dbt run (if incremental models are present) && dbt test

Before marking this PR as "ready for review" the following have been applied:

  • The appropriate issue has been linked, tagged, and properly assigned
  • All necessary documentation and version upgrades have been applied
  • docs were regenerated (unless this PR does not include any code or yml updates)
  • BuildKite integration tests are passing
  • Detailed validation steps have been provided below

Detailed Validation

Please share any and all of your validation steps:

  • Consistency tests pass

    • Screenshot 2024-06-27 at 4 16 46 PM
  • When setting full_statement_version=false in a model, a compilation error is successfully thrown.

    • Screenshot 2024-06-27 at 12 09 08 PM

Additional notes

  • full_statement_version=true continues to be allowed so that users do not experience the below compilation failure since the macro cannot take an unexpected argument.
    • Screenshot 2024-06-27 at 12 04 20 PM

If you had to summarize this PR in an emoji, which would it be?

💃

@fivetran-catfritz fivetran-catfritz self-assigned this Jun 27, 2024
Copy link
Collaborator

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

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

@fivetran-catfritz thanks for addressing this update so quickly! I have a few comments and requests before approval.

While we are sunsetting functionality, I don't want a customer to upgrade and it possibly cause catastrophic failures in their dbt project. Ideally, we create "soft" failures and provide informative messages so customers know what actions they need to take if the release notes were not reviewed prior to upgrading.

Let me know if you want to sync on my comments and if you want to brainstorm some ideas. Thanks!

CHANGELOG.md Outdated Show resolved Hide resolved
macros/sfdc_formula_view.sql Outdated Show resolved Hide resolved
macros/sfdc_formula_view.sql Show resolved Hide resolved
macros/sfdc_formula_view.sql Outdated Show resolved Hide resolved
macros/sfdc_formula_view.sql Outdated Show resolved Hide resolved
macros/sfdc_formula_view.sql Outdated Show resolved Hide resolved
macros/sfdc_formula_view.sql Outdated Show resolved Hide resolved
Copy link
Contributor Author

@fivetran-catfritz fivetran-catfritz left a comment

Choose a reason for hiding this comment

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

@fivetran-joemarkiewicz thank you for the review comments! I have made the updates, and this is ready for re-review.

CHANGELOG.md Outdated Show resolved Hide resolved
macros/sfdc_formula_view.sql Outdated Show resolved Hide resolved
macros/sfdc_formula_view.sql Show resolved Hide resolved
macros/sfdc_formula_view.sql Outdated Show resolved Hide resolved
macros/sfdc_formula_view.sql Outdated Show resolved Hide resolved
macros/sfdc_formula_view.sql Outdated Show resolved Hide resolved
macros/sfdc_formula_view.sql Outdated Show resolved Hide resolved
Copy link
Collaborator

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

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

@fivetran-catfritz great work on this PR! This is nearly ready, I just have a few final comments before this is ready for approval and release.

README.md Outdated
@@ -21,14 +21,15 @@ This package includes macros and scipts to be used within a dbt project to accur
To use this dbt package, you must have the following:
- At least one Fivetran Salesforce connector syncing data into your destination.
- A **BigQuery**, **Snowflake**, **Redshift**, **PostgreSQL**, or **Databricks** destination.
- **dbt Core**: This package is designed to work with dbt Core and is **not** compatible with dbt Cloud.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The package is technically compatibile with dbt Core. It is only this section that is not. Could we remove this change and instead update this section to callout that it is only compatible with dbt Core.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. Updated!

macros/sfdc_formula_view.sql Show resolved Hide resolved
macros/sfdc_formula_view.sql Outdated Show resolved Hide resolved
-- Raise a warning if users are trying to use full_statement_version=false. We are keeping the variable in the macro, however, since we don't want errors if they previously set it to true.
{% if not full_statement_version %}
{{ exceptions.warn("\ERROR: The full_statement_version=false, reserved_table_name, and fields_to_include parameters are no longer supported. Please update your " ~ this.identifier|upper ~ " model to remove these parameters.\n") }}
* See full model error in log.
Copy link
Collaborator

Choose a reason for hiding this comment

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

In BigQuery this error is a bit confusion.

image

What if we do this instead?

Suggested change
* See full model error in log.
See_full_model_error_in_log

Which provides the following error.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. That works for me!

Copy link
Contributor Author

@fivetran-catfritz fivetran-catfritz left a comment

Choose a reason for hiding this comment

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

Thanks for the comments @fivetran-joemarkiewicz! I have made the updates, and it's ready for re-review!

README.md Outdated
@@ -21,14 +21,15 @@ This package includes macros and scipts to be used within a dbt project to accur
To use this dbt package, you must have the following:
- At least one Fivetran Salesforce connector syncing data into your destination.
- A **BigQuery**, **Snowflake**, **Redshift**, **PostgreSQL**, or **Databricks** destination.
- **dbt Core**: This package is designed to work with dbt Core and is **not** compatible with dbt Cloud.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. Updated!

macros/sfdc_formula_view.sql Show resolved Hide resolved
macros/sfdc_formula_view.sql Outdated Show resolved Hide resolved
-- Raise a warning if users are trying to use full_statement_version=false. We are keeping the variable in the macro, however, since we don't want errors if they previously set it to true.
{% if not full_statement_version %}
{{ exceptions.warn("\ERROR: The full_statement_version=false, reserved_table_name, and fields_to_include parameters are no longer supported. Please update your " ~ this.identifier|upper ~ " model to remove these parameters.\n") }}
* See full model error in log.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. That works for me!

Copy link
Collaborator

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

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

@fivetran-catfritz just a few last comments. Let me know once ready for re-review.

@@ -1,4 +1,4 @@
{%- macro sfdc_formula_view(source_table, source_name='salesforce', reserved_table_name=source_table, fields_to_include=none, full_statement_version=true, materialization='view', using_quoted_identifiers=False) -%}
{%- macro sfdc_formula_view(source_table, source_name='salesforce', materialization='view', using_quoted_identifiers=False, full_statement_version=true) -%}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I was doing some final tests and noticed a major compilation error when testing what happens when I still have reserved_table_name or fields_to_include as a parameter. For example the following code:

{{ salesforce_formula_utils.sfdc_formula_view(
    source_table='task_priority',
    fields_to_include=['new_field','cool_field']) 
}}

Results in the following full dbt project level compilation error (nothing else in the project can compile).

image

This error completely ignores the informative error message you provide in the logs. I don't want to risk potentially breaking an entire workflow because we wanted to remove these parameters. I know I recommended removing these, but given this error message this is too dangerous. I recommend we keep all the terminology that these fields are deprecated (because they are and don't do anything).

Suggested change
{%- macro sfdc_formula_view(source_table, source_name='salesforce', materialization='view', using_quoted_identifiers=False, full_statement_version=true) -%}
{%- macro sfdc_formula_view(source_table, source_name='salesforce', reserved_table_name=source_table, fields_to_include=none, full_statement_version=true, materialization='view', using_quoted_identifiers=False) -%}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From our discussion, I added the defaults for the variables back in but keeping the conditions for the warning the same.

Copy link
Contributor Author

@fivetran-catfritz fivetran-catfritz left a comment

Choose a reason for hiding this comment

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

@fivetran-joemarkiewicz this is ready for re-review!

@@ -1,4 +1,4 @@
{%- macro sfdc_formula_view(source_table, source_name='salesforce', reserved_table_name=source_table, fields_to_include=none, full_statement_version=true, materialization='view', using_quoted_identifiers=False) -%}
{%- macro sfdc_formula_view(source_table, source_name='salesforce', materialization='view', using_quoted_identifiers=False, full_statement_version=true) -%}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

From our discussion, I added the defaults for the variables back in but keeping the conditions for the warning the same.

Copy link
Collaborator

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

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

LGTM Thanks for all your work on this PR @fivetran-catfritz I have just one final CHANGELOG request but that won't block the approval. Once that last CHANGELOG update is applied this will be good for release review.

CHANGELOG.md Outdated

## 🚨 Breaking Changes 🚨
- As announced in the [v0.9.2 August 2023 release](https://github.com/fivetran/dbt_salesforce_formula_utils/releases/tag/v0.9.2), the parameter `full_statement_version=false` has now been fully sunset from the `sfdc_formula_view` macro. You will now need to remove this parameter to avoid a compilation error.
- As part of this deprecation, the parameters `reserved_table_name` and `fields_to_include` have also been deprecated and will also need to be removed.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you also include a sub bullet mentioning all of the macros that were removed as part of this update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. Updated!

Copy link
Collaborator

@fivetran-jamie fivetran-jamie left a comment

Choose a reason for hiding this comment

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

lgtm! just one suggestion to insert a link in one more place

.github/ISSUE_TEMPLATE/bug-report.yml Outdated Show resolved Hide resolved
@fivetran-catfritz fivetran-catfritz merged commit c12dc44 into main Jul 9, 2024
7 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.

3 participants