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

[ADAP-902] [Bug] pip install dev-requirements only works on the second attempt #784

Closed
2 tasks done
Tracked by #8678
joshuataylor opened this issue Sep 20, 2023 · 2 comments
Closed
2 tasks done
Tracked by #8678
Labels
bug Something isn't working

Comments

@joshuataylor
Copy link
Contributor

Is this a new bug in dbt-snowflake?

  • I believe this is a new bug in dbt-snowflake
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Running pip install -e . -r dev-requirements.txt followed by dbt debug results in the following error:

+ dbt debug
02:25:50  Running with dbt=1.7.0-b2
02:25:50  dbt version: 1.7.0-b2
02:25:50  python version: 3.11.5
02:25:50  python path: /home/josh/dev/project/.venv/bin/python
02:25:50  os info: Linux-6.2.0-1011-aws-aarch64-with-glibc2.35
02:25:50  Error importing adapter: No module named 'dbt.adapters.snowflake'
02:25:50  Using profiles dir at /home/josh/.dbt
02:25:50  Using profiles.yml file at /home/josh/.dbt/profiles.yml
02:25:50  Using dbt_project.yml file at /home/josh/dev/project/dbt_project.yml
02:25:50  Configuration:
02:25:50    profiles.yml file [ERROR invalid]
02:25:50    dbt_project.yml file [OK found and valid]
02:25:50  Required dependencies:
02:25:50   - git [OK found]

02:25:50  Connection test skipped since no profile was found
02:25:50  1 check failed:
02:25:50  Profile loading failed for the following reason:
Runtime Error
  Credentials in profile "default", target "full" invalid: Runtime Error
    Could not find adapter type snowflake!

This happens on MacOS ARM64 ("Apple Silicon") & Linux ARM64/AMD64 with Python 3.11.

The second time the command is run, everything works fine.

Expected Behavior

It works on the first install.

Steps To Reproduce

  1. Clone the repository
  2. Follow the steps at https://github.com/dbt-labs/dbt-snowflake/blob/main/CONTRIBUTING.md#running-dbt-snowflake-in-development
  3. Run dbt debug in a project

Relevant log output

No response

Environment

- OS: ArchLinux/Ubuntu/MacOS
- Python: 3.11
- dbt-core: 1.7.0-b2
- dbt-snowflake: 1.7.0-b2 (main?)

Additional Context

No response

@joshuataylor joshuataylor added bug Something isn't working triage labels Sep 20, 2023
@github-actions github-actions bot changed the title [Bug] pip install dev-requirements only works on the second attempt [ADAP-902] [Bug] pip install dev-requirements only works on the second attempt Sep 20, 2023
@dbeatty10
Copy link
Contributor

Good call @joshuataylor !

I think the most immediate solution would be to update the CONTRIBUTING file to include instructions like these:

python3 -m pip install -e . -r dev-requirements.txt
python3 -m pip install -e .

⚠️ Note that pip install -e . is duplicated twice! The 2nd one is the key one in relation to the issue you are reporting. The 1st one is to avoid dependency conflicts with the way pip's dependency resolver works.

I think this would affect all dbt adapters, so I created this tasklist to track them all: dbt-labs/dbt-core#8678

An even better solution would be if it didn't need to be executed twice for the adapter to be seen. More helpful info here: dbt-labs/dbt-core#8504 (comment)

@joshuataylor
Copy link
Contributor Author

joshuataylor commented Sep 20, 2023

Great, also the Makefile will need to be updated for make dev.

Not sure if the other adapters have those though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants