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

Dbarok/athena dbt utils #380

Closed
wants to merge 3 commits into from

Conversation

dbarok
Copy link

@dbarok dbarok commented Jun 7, 2021

This is a:

  • bug fix PR with no breaking changes — please ensure the base branch is master
  • new functionality — please ensure the base branch is the latest dev/ branch
  • a breaking change — please ensure the base branch is the latest dev/ branch

Description & motivation

In our team we use dbt extensively hence we found it useful to have dbt-utils available also for Athena.

Checklist

  • I have verified that these changes work locally on the following warehouses (Note: it's okay if you do not have access to all warehouses, this helps us understand what has been covered)

    • BigQuery
    • Postgres
    • Redshift
    • Snowflake
    • Athena
  • I have "dispatched" any new macro(s) so non-core adapters can also use them (e.g. the star() source)

  • I have updated the README.md (if applicable)

  • I have added tests & descriptions to my models (and macros if applicable)

  • I have added an entry to CHANGELOG.md

@dbarok
Copy link
Author

dbarok commented Jun 7, 2021

Hi thank you very much for dbt-utils, I added these changes so that we can use this also on Athena. Doing this for the first time so I'll appreciate any feedback or comments. Cheers! :)

@dbarok dbarok changed the base branch from master to dev/0.7.0 June 7, 2021 15:43
@dbarok dbarok changed the base branch from dev/0.7.0 to master June 7, 2021 15:44
@jtcohen6
Copy link
Contributor

jtcohen6 commented Jun 7, 2021

@dbarok This looks awesome! I'm glad you were able to add Athena support with just a handful of macros.

We're trying to be really careful about the scope of this package, which has ballooned significantly over the past few years. As such, we've invested in functionality that enables adapter-specific macros to live in external "shim" packages. These packages can be installed alongside dbt-utils and, by setting a project-level var (before v0.19.2) or dispatch config (v0.19.2 and going forwards), users can tell dbt to look for implementations of dbt_utils macros in these "shim" packages, too.

You can check out some example "shim" packages that are already up & running:

A hypothetical athena-utils package would be responsible for:

  • Defining just the athena__ version of each macro
  • Setting up CI to run integration tests against an Athena cluster

How does that sound to you?

@dbarok
Copy link
Author

dbarok commented Jun 8, 2021

Great thanks for the explanation and the advice @jtcohen6 🙂 ! I will try to do it that way then.

courentin added a commit to dbt-athena/athena-utils that referenced this pull request Jul 30, 2021
@courentin
Copy link
Contributor

Thank you @dbarok for your work! I implemented the suggested solution of @jtcohen6 in the repository https://github.com/lalalilo/athena-utils
Please note that there are no integration tests for now, but it's a first draft and any PRs are welcome!

Thanks again!

@jasnonaz
Copy link
Contributor

Thanks for moving to the separate package!! Going to close this PR.

@jasnonaz jasnonaz closed this Aug 30, 2021
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.

4 participants