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

Flytekit dbt plugin #1150

Merged
merged 28 commits into from
Sep 17, 2022
Merged

Flytekit dbt plugin #1150

merged 28 commits into from
Sep 17, 2022

Conversation

eapolinario
Copy link
Collaborator

@eapolinario eapolinario commented Sep 8, 2022

TL;DR

This PR introduces a flytekit plugin for dbt

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

This PR is heavily based on #886, with two exceptions: (1) we're using the sqlite adapter to test the integration, and (2) minor changes to follow flytekit's style guide.

It's worth noting that dbtlabs suggests we rely on parsing the output of the CLI as their python SDK is still very much in flux.

In terms of dbt functionality, this PR adds support for dbt run and dbt test.

You'll notice that we're using the jaffle shop example in the tests.

Tracking Issue

flyteorg/flyte#2202

Follow-up issue

NA

ariefrahmansyah and others added 26 commits March 10, 2022 09:22
* Supports dbt run and dbt test tasks
* The plugin includes integration test that need local PostgreSQL database

Signed-off-by: ariefrahmansyah <[email protected]>
Signed-off-by: ariefrahmansyah <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
This reverts commit 134fa1c.

Signed-off-by: Eduardo Apolinario <[email protected]>
This reverts commit 02ef380.

Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Merging #1150 (e6e2ed8) into master (6f19d74) will increase coverage by 0.18%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1150      +/-   ##
==========================================
+ Coverage   68.35%   68.53%   +0.18%     
==========================================
  Files         287      288       +1     
  Lines       25911    26197     +286     
  Branches     2900     2924      +24     
==========================================
+ Hits        17711    17954     +243     
- Misses       7721     7765      +44     
+ Partials      479      478       -1     
Impacted Files Coverage Δ
plugins/setup.py 0.00% <ø> (ø)
flytekit/types/structured/basic_dfs.py 50.76% <0.00%> (-3.33%) ⬇️
flytekit/tools/repo.py 73.68% <0.00%> (ø)
flytekit/remote/remote.py 41.11% <0.00%> (ø)
flytekit/extras/sqlite3/task.py 90.74% <0.00%> (ø)
flytekit/extras/pytorch/__init__.py 0.00% <0.00%> (ø)
flytekit/tools/fast_registration.py 89.06% <0.00%> (ø)
tests/flytekit/unit/deck/test_renderer.py 100.00% <0.00%> (ø)
flytekit/clis/sdk_in_container/constants.py 100.00% <0.00%> (ø)
tests/flytekit/unit/models/test_execution.py 100.00% <0.00%> (ø)
... and 22 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: Eduardo Apolinario <[email protected]>
plugins/flytekit-dbt/setup.py Outdated Show resolved Hide resolved
.
-e file:.#egg=flytekitplugins-dbt
# dbt-sqlite and dbt-core should be compatible
dbt-core==1.2.1
Copy link
Contributor

Choose a reason for hiding this comment

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

can we not pin reqs in the .in file?

pip install flytekitplugins-dbt
```

_Example coming soon!_
Copy link
Contributor

Choose a reason for hiding this comment

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

how long do you think this will be here for? over under on a year?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question. Do you think it's worth pointing this to a blog post or the flytesnacks examples? (when those are created obviously).

wild-endeavor
wild-endeavor previously approved these changes Sep 16, 2022
@eapolinario eapolinario merged commit cfcccb8 into master Sep 17, 2022
@eapolinario eapolinario mentioned this pull request Oct 7, 2022
8 tasks
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