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

Consider changes related to native DBT_PROJECT_DIR support in dbt-core #28

Open
aaronsteers opened this issue Mar 9, 2023 · 2 comments

Comments

@aaronsteers
Copy link
Contributor

aaronsteers commented Mar 9, 2023

Follows from:

I don't know if any changes are needed, especially because we want to be mindful of preserving backwards compatibility.

As of now, we have:

https://github.com/meltano/hub/blob/main/_data/meltano/utilities/dbt-snowflake/dbt-labs.yml#L86-L88

settings:
// ...
- label: Projects Directory
  name: project_dir
  value: $MELTANO_PROJECT_ROOT/transform

This almost maps to DBT_PROJECT_DIR except that the name of the plugin is dbt-snowflake (or similar), so the mapped env var would be something like DBT_SNOWFLAKE_PROJECT_DIR.

@aaronsteers
Copy link
Contributor Author

aaronsteers commented Mar 9, 2023

Correction: our source code does already use this env var (same name).

self.dbt_project_dir = Path(os.getenv("DBT_PROJECT_DIR", "transform"))
self.dbt_profiles_dir = Path(
os.getenv("DBT_PROFILES_DIR", self.dbt_project_dir / "profiles")
)

And this Hub-side PR merging today will ensure it gets mapped from the related setting names:

@aaronsteers
Copy link
Contributor Author

@tayloramurphy and @pnadolny13 - I don't think there's anything for us to do here, but just wanted to call it out in case you see something I don't see.

As of the next dbt-core release, DBT_PROJECT_DIR will be parsed natively, meaning for those versions of dbt that support it, we will no longer need to cd into the directory or pass --project_dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant