Skip to content

Commit

Permalink
[#3940] Use flags.PROFILES_DIR in a few more places
Browse files Browse the repository at this point in the history
automatic commit by git-black, original commits:
  fda17b4
  • Loading branch information
gshank authored and iknox-fa committed Feb 8, 2022
1 parent 99b5d72 commit c5d8de9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/dbt/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def set_from_args(args, user_config):
WRITE_JSON = get_flag_value("WRITE_JSON", args, user_config)
PARTIAL_PARSE = get_flag_value("PARTIAL_PARSE", args, user_config)
USE_COLORS = get_flag_value("USE_COLORS", args, user_config)
PROFILES_DIR = get_flag_value('PROFILES_DIR', args, user_config)
PROFILES_DIR = get_flag_value("PROFILES_DIR", args, user_config)
DEBUG = get_flag_value("DEBUG", args, user_config)
LOG_FORMAT = get_flag_value("LOG_FORMAT", args, user_config)
VERSION_CHECK = get_flag_value("VERSION_CHECK", args, user_config)
Expand Down Expand Up @@ -157,7 +157,7 @@ def get_flag_value(flag, args, user_config):
flag_value = flag_defaults[flag]
if flag in ["PRINTER_WIDTH", "EVENT_BUFFER_SIZE"]: # must be ints
flag_value = int(flag_value)
if flag == 'PROFILES_DIR':
if flag == "PROFILES_DIR":
flag_value = os.path.abspath(flag_value)

return flag_value
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ def parse_args(args, cls=DBTArgumentParser):
if parsed.sub_profiles_dir is not None:
parsed.profiles_dir = parsed.sub_profiles_dir
delattr(parsed, "sub_profiles_dir")
if hasattr(parsed, 'profiles_dir'):
if hasattr(parsed, "profiles_dir"):
if parsed.profiles_dir is None:
parsed.profiles_dir = flags.PROFILES_DIR
else:
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/parser/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ def build_manifest_state_check(self):
profile_env_vars_hash = FileHash.from_contents(env_var_str)

# Create a FileHash of the profile file
profile_path = os.path.join(flags.PROFILES_DIR, 'profiles.yml')
profile_path = os.path.join(flags.PROFILES_DIR, "profiles.yml")
with open(profile_path) as fp:
profile_hash = FileHash.from_contents(fp.read())

Expand Down

0 comments on commit c5d8de9

Please sign in to comment.