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/add union data #44

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Feature/add union data #44

wants to merge 17 commits into from

Conversation

fivetran-jamie
Copy link
Contributor

@fivetran-jamie fivetran-jamie commented Dec 26, 2023

PR Overview

This PR will address the following Issue/Feature:
fivetran/dbt_zendesk#124

This PR will result in the following new package version:

v0.14.0

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

for now, i have a very very brief entry that points to the README

dbt_zendesk_source v0.11.0

🎉 Feature Update 🎉

This release supports running the package on multiple Zendesk sources at once! See the README for details on how to leverage this feature (PR #44).

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)

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) -- waiting on approval
  • BuildKite integration tests are passing
  • Detailed validation steps have been provided below

Detailed Validation

Please share any and all of your validation steps:

See hex notebook linked in Height

Copy link
Contributor

@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.

These changes look great to me! I have a few small comments below, but otherwise this is good to generate the docs and be approved!

As discussed during standup, we will hold off merging and releasing this until all other union data updates are completed this quarter.

README.md Outdated Show resolved Hide resolved
Comment on lines +2 to +7
# - package: fivetran/fivetran_utils
# version: [">=0.4.0", "<0.5.0"]
# - local: ../../dbt_fivetran_utils
- git: https://github.com/fivetran/dbt_fivetran_utils.git
revision: feature/enhance-union-data
warn-unpinned: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder to swap before release

models/stg_zendesk__ticket_field_history.sql Outdated Show resolved Hide resolved
Copy link
Contributor

@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-jamie thanks for working through this PR! I do have a few comments and questions below that I would like for you to take a look at before approving. Let me know if you would like to discuss any of these in more detail. Thanks!

README.md Outdated

<details><summary><i>Expand for source configuration template</i></summary><p>

> **Note**: If there are source tables you do not have (see [Step 4](https://github.com/fivetran/dbt_zendesk_source?tab=readme-ov-file#step-4-disable-models-for-non-existent-sources)), you may still include them, as long as you have set the right variables to `False`. Otherwise, you may remove them from your source definition.
Copy link
Contributor

Choose a reason for hiding this comment

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

Contradicting my previous comment, I am worried this addition will become unmanageable to maintain over time. What are some possible alternatives?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

are you referring to the source template or the note on line 80 specifically?

if it's the source template, we could just link to the src_zendesk.yml file and instruct users to copy/paste and replace certain attributes (like source name, database, schema)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

Comment on lines +373 to +377
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- time_zone
- source_relation
Copy link
Contributor

Choose a reason for hiding this comment

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

This test is resulting in a failure when running on the zendesk_yashwanth schema. Do you have any understanding why this is failing?

image

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this is the result of the time_zone name creating a struct when we don't want it to. I recall you had a fix for this. Do you know if that may have been missed for some reason?

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Could it be that we need to add the alias to the union_data macro here.

So it would be:

{%- if table_exists -%}
    select
        {{ dbt_utils.star(from=relation.value) }}
    from {{ relation.value }} as {{ table_identifier }}_table

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yes i missed adding this to the single-connector use-case inside union_data

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that did the trick!

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.

2 participants