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

dbt support #11

Open
jtzero opened this issue Nov 19, 2021 · 3 comments
Open

dbt support #11

jtzero opened this issue Nov 19, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@jtzero
Copy link

jtzero commented Nov 19, 2021

Is your feature request related to a problem? Please describe.

The linking doesn't seem to work with DBT, and as dbt isn't in the list of Compatible Python Applications I'm assuming it's not "officially" supported, and thus a feature and not a bug.

Describe the solution you'd like

the dbt command available as a shim

asdf plugin add dbt-snowflake https://github.com/amrox/asdf-pyapp.git
ls ~/.asdf/installs/dbt-snowflake/1.0.0rc1/venv/bin lists dbt as a binary there
ls ~/.asdf/installs/dbt-snowflake/1.0.0rc1/bin but is not linked here, thus no shim

perhaps because the egg/wheel is named dbt-snowflake and not just dbt ? (not sure haven't verified in the code as of yet, and not sure if this is something you would want to officially support)

Describe alternatives you've considered

I could set up another asdf plugin exclusively for dbt.

Additional context

@jtzero jtzero added the enhancement New feature or request label Nov 19, 2021
@amrox
Copy link
Owner

amrox commented Dec 2, 2021

Hi @jtzero - thanks for the feature request.

I'm not too familiar with dbt / dbt-snowflake. What is the "normal" way to install it? Does it work with pipx?

This plugin uses pipx under the hood, so if it works with pipx, but not with this plugin, I'd consider it a bug.

I'm interested in supporting it if we can though!

@amrox
Copy link
Owner

amrox commented Dec 4, 2021

dug into this a little.

Installing dbt via pipx yields this:

❯ pipx install dbt
Note: Dependent package 'dbt-core' contains 1 apps
  - dbt
Note: Dependent package 'sqlparse' contains 1 apps
  - sqlformat
Note: Dependent package 'chardet' contains 1 apps
  - chardetect
Note: Dependent package 'babel' contains 1 apps
  - pybabel
Note: Dependent package 'python-slugify' contains 1 apps
  - slugify
Note: Dependent package 'jsonschema' contains 1 apps
  - jsonschema
Note: Dependent package 'jmespath' contains 1 apps
  - jp.py
Note: Dependent package 'docutils' contains 12 apps
  - rst2html.py
  - rst2html4.py
  - rst2html5.py
  - rst2latex.py
  - rst2man.py
  - rst2odt.py
  - rst2odt_prepstyles.py
  - rst2pseudoxml.py
  - rst2s5.py
  - rst2xetex.py
  - rst2xml.py
  - rstpep2html.py
Note: Dependent package 'snowflake-connector-python' contains 4 apps
  - snowflake-dump-certs
  - snowflake-dump-ocsp-response
  - snowflake-dump-ocsp-response-cache
  - snowflake-export-certs
Note: Dependent package 'pyjwt' contains 1 apps
  - pyjwt
Note: Dependent package 'keyring' contains 1 apps
  - keyring
Note: Dependent package 'rsa' contains 6 apps
  - pyrsa-decrypt
  - pyrsa-encrypt
  - pyrsa-keygen
  - pyrsa-priv2pub
  - pyrsa-sign
  - pyrsa-verify

No apps associated with package dbt. Try again with '--include-deps' to
include apps of dependent packages, which are listed above. If you are
attempting to install a library, pipx should not be used. Consider using pip
or a similar tool instead."

Next I tried installing dbt-core:

❯ pipx install dbt-core
  installed package dbt-core 1.0.0, Python 3.10.0
  These apps are now globally available
    - dbt
⚠️  Note: '/Users/amrox/.local/bin' is not on your PATH environment variable. These apps will
    not be globally accessible until your PATH is updated. Run `pipx ensurepath` to
    automatically add it, or manually modify your PATH in your shell's config file (i.e.
    ~/.bashrc).
done! ✨ 🌟 ✨

And it worked!

Finally:

❯ asdf plugin add dbt-core https://github.com/amrox/asdf-pyapp.git
❯ asdf install dbt-core 1.0.0
❯ ls ~/.asdf/installs/dbt-core/1.0.0/bin
dbt

So there are a couple ways forward:

  1. Add support for --include-deps in asdf-pyapp (probably should be optional somehow).

  2. Install dbt-core - but I'm not sure this has all the dependencies you need.

@jtzero
Copy link
Author

jtzero commented Dec 13, 2021

interesting...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants