def write_data_to_file(self, replace_if_exists: bool = True) -> None: """""" if self._config_file_exists() and self._config_data_exists( ) and not replace_if_exists: logger.warning( "Dbtea config file already exists, ignoring write config data to file step" ) else: logger.info("Creating {} file at path: {}".format( self.file_name, self.config_dir)) utils.write_to_yaml_file(self.config_data, self.config_name_and_path)
def _parse_artifact(self, artifact_file: str): """""" if artifact_file not in ARTIFACT_DATA_FILES.values(): logger.warning( "You have specified an artifact file which is not in the list of known dbt artifacts" ) artifact_path = utils.assemble_path( self.project_root, self.target_path, artifact_file ) if not utils.file_exists(artifact_path): raise DbteaException( name="artifact-file-missing", title="Artifact file {} is missing".format(artifact_file), detail="There is no artifact {} at path {}. You may not have yet generated this artifact and " "need to run models, source freshness or docs generation".format( artifact_file, artifact_path ), ) return utils.parse_json_file(artifact_path)