Skip to content

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

Open
@dbeatty10

Description

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

Metadata

Assignees

No one assigned

    Labels

    tech_debtBehind-the-scenes changes, with little direct impact on end-user functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions