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

[CT-3034] [Bug] relative path in DBT_PROFILES_DIR fails #8501

Closed
2 tasks done
leo-schick opened this issue Aug 28, 2023 · 6 comments
Closed
2 tasks done

[CT-3034] [Bug] relative path in DBT_PROFILES_DIR fails #8501

leo-schick opened this issue Aug 28, 2023 · 6 comments
Assignees
Labels
bug Something isn't working dbfs Issues that only occur when dbt is running on the Databricks file system Impact: Adapters wontfix Not a bug or out of scope for dbt-core

Comments

@leo-schick
Copy link
Contributor

leo-schick commented Aug 28, 2023

Is this a new bug in dbt-core?

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

Current Behavior

I set globally the environment variable DBT_PROFILES_DIR to ~/.dbt which breaks the execution:

image

But it works when I set the absolute path e.g. DBT_PROFILES_DIR=/root/.dbt.

Expected Behavior

I would expect that dbt resolves the relative path in environment variable DBT_PROFILES_DIR.

Steps To Reproduce

  1. run export DBT_PROFILES_DIR=~/.dbt
  2. run dbt run

Relevant log output

No response

Environment

- OS:Debian 11
- Python: 3.9.2
- dbt: 1.6.1

Which database adapter are you using with dbt?

other (mention it in "Additional Context")

Additional Context

  • dbt-databricks 1.6.1
@leo-schick leo-schick added bug Something isn't working triage labels Aug 28, 2023
@github-actions github-actions bot changed the title [Bug] set profiles dir with ending slash fails [CT-3034] [Bug] set profiles dir with ending slash fails Aug 28, 2023
@leo-schick leo-schick changed the title [CT-3034] [Bug] set profiles dir with ending slash fails [CT-3034] [Bug] relative path in DBT_PROFILES_DIR fails Aug 28, 2023
@leo-schick
Copy link
Contributor Author

leo-schick commented Aug 28, 2023

Note: Found an issue with my description and adjusted the issue accordingly. Relative paths seem to not working anymore since 1.6.1. Before I used dbt version 1.4.6 where this worked out fine.

@jtcohen6
Copy link
Contributor

@leo-schick It looks like you're running dbt inside a Databricks notebook/workflow(?). I don't see this error while running dbt-core locally, including more recent versions. I'm wondering if this error is specific to running against DBFS? We've seen some other issues recently that fall into this category:

$ export DBT_PROFILES_DIR=~/.dbt
$ dbt run --profile sandbox-databricks
10:39:39  Running with dbt=1.6.1
10:39:40  Registered adapter: databricks=1.6.3
10:39:40  Found 1 model, 1 operation, 1 test, 0 sources, 0 exposures, 0 metrics, 686 macros, 0 groups, 0 semantic models
...

@leo-schick
Copy link
Contributor Author

@jtcohen6 Yes this is running inside a Databricks Notebook

@aranke
Copy link
Member

aranke commented Nov 13, 2023

I tried and wasn't able to reproduce this.

@jtcohen6 jtcohen6 added wontfix Not a bug or out of scope for dbt-core dbfs Issues that only occur when dbt is running on the Databricks file system labels Nov 13, 2023
@jtcohen6
Copy link
Contributor

We're going to close this issue, and document it (along with other issues labeled dbfs) as a limitation of running dbt-core inside a Databricks notebook.

@jtcohen6 jtcohen6 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2023
@jaklan
Copy link

jaklan commented Nov 23, 2023

@jtcohen6 it's not related to Databricks - dbt simply doesn't support tilde for neither --project-dir nor --profiles-dir:

Error: Invalid value for '--project-dir': Path '~/.local' does not exist.
Error: Invalid value for '--profiles-dir': Path '~/.local' does not exist.

The path of course exists. Tested with dbt-core 1.7.2.

EDIT: I have just tested environment variables - DBT_PROFILES_DIR and DBT_PROFILES_DIR. In their case tilde works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dbfs Issues that only occur when dbt is running on the Databricks file system Impact: Adapters wontfix Not a bug or out of scope for dbt-core
Projects
None yet
Development

No branches or pull requests

7 participants