(self, profile_name: Optional[str] = None)
Using either a provided profile name or that specified in dbt_project.yml,
        check if the profile already exists in profiles.yml, and if so ask the
        user whether to proceed and overwrite it.
Using either a provided profile name or that specified in dbt_project.yml,
        check if the profile already exists in profiles.yml, and if so ask the
        user whether to proceed and overwrite it.
Using either a provided profile name or that specified in dbt_project . yml check if the profile already exists in profiles . yml and if so ask the user whether to proceed and overwrite it .
def check_if_can_write_profile(self, profile_name: Optional[str] = None) -> bool:
        """Using either a provided profile name or that specified in dbt_project.yml,
        check if the profile already exists in profiles.yml, and if so ask the
        user whether to proceed and overwrite it."""
        profiles_file = Path(flags.PROFILES_DIR) / Path("profiles.yml")
        if not profiles_file.exists():
            return True
        profile_name = (
            profile_name or self.get_profile_name_from_current_project()
        )
        with open(profiles_file, "r") as f:
            profiles = yaml.safe_load(f) or {}
        if profile_name in profiles.keys():
            response = click.confirm(
                f"The profile {profile_name} already exists in "
                f"{profiles_file}. Continue and overwrite it?"
            )
            return response
        else:
            return True
def check_if_can_write_profile ( self , profile_name : Optional [ str ] = None ) -> bool : profiles_file = Path ( flags . PROFILES_DIR ) / Path ( "profiles.yml" ) if not profiles_file . exists ( ) : return True profile_name = ( profile_name or self . get_profile_name_from_current_project ( ) ) with open ( profiles_file , "r" ) as f : profiles = yaml . safe_load ( f ) or { } if profile_name in profiles . keys ( ) : response = click . confirm ( f"The profile {profile_name} already exists in " f"{profiles_file}. Continue and overwrite it?" ) return response else : return True