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

[Tech debt] Remove duplicated definition of default_profiles_dir (without adding circular dependency) #11142

Closed
3 tasks done
dbeatty10 opened this issue Dec 12, 2024 · 0 comments · Fixed by #11137
Closed
3 tasks done
Labels
tech_debt Behind-the-scenes changes, with little direct impact on end-user functionality

Comments

@dbeatty10
Copy link
Contributor

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

The following code duplicated the definition of default_profiles_dir within #6788 in order to avoid a circular dependency issue.

# TODO: Duplicating this method as direct copy of the implementation in dbt.cli.resolvers
# dbt.cli.resolvers implementation can't be used because it causes a circular dependency.
# This should be removed and use a safe default access on the Flags module when
# https://github.com/dbt-labs/dbt-core/issues/6259 is closed.
def default_profiles_dir():
from pathlib import Path
return Path.cwd() if (Path.cwd() / "profiles.yml").exists() else Path.home() / ".dbt"

We'd like to remove this duplication while still avoiding any circular dependencies.

Describe alternatives you've considered

No response

Who will this benefit?

No response

Are you interested in contributing this feature?

See proposed implementation in #11137

Anything else?

No response

@dbeatty10 dbeatty10 added triage tech_debt Behind-the-scenes changes, with little direct impact on end-user functionality and removed triage labels Dec 12, 2024
@dbeatty10 dbeatty10 mentioned this issue Dec 12, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech_debt Behind-the-scenes changes, with little direct impact on end-user functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant