def base_directory(self): """ Accessor method for base_directory. If directory is a relative path, interpret it as relative to the root directory. If it is absolute, then keep as-is. """ return normalize_directory_path( dir_path=self._base_directory, root_directory_path=self.data_context_root_directory, )
def _get_full_file_path_for_asset(self, path: str, asset: Optional[Asset] = None) -> str: base_directory: str = self.base_directory if asset is not None: if asset.base_directory: base_directory = normalize_directory_path( dir_path=asset.base_directory, root_directory_path=base_directory, ) return str(Path(base_directory).joinpath(path))
def _get_data_reference_list_for_asset(self, asset: Optional[Asset]) -> List[str]: base_directory: str = self.base_directory glob_directive: str = self._glob_directive if asset is not None: if asset.base_directory: base_directory = normalize_directory_path( dir_path=asset.base_directory, root_directory_path=base_directory ) if asset.glob_directive: glob_directive = asset.glob_directive path_list: List[str] = get_filesystem_one_level_directory_glob_path_list( base_directory_path=base_directory, glob_directive=glob_directive ) return sorted(path_list)
def base_directory(self): return normalize_directory_path( dir_path=self._base_directory, root_directory_path=self.data_context_root_directory, )