From 78154e4ca27652023726aed638dc14e81c822c52 Mon Sep 17 00:00:00 2001 From: Riccardo Iacomini Date: Thu, 28 Nov 2024 15:14:46 +0100 Subject: [PATCH] Added missing file_type param in one of MultiProjectManager object creation. Fixed wrong defaults for MultiProjectManager (#183) --- brickflow/cli/projects.py | 5 +++-- brickflow/codegen/databricks_bundle.py | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/brickflow/cli/projects.py b/brickflow/cli/projects.py index 49da37c..78ac2c3 100644 --- a/brickflow/cli/projects.py +++ b/brickflow/cli/projects.py @@ -87,8 +87,9 @@ def has_projects(self) -> bool: class MultiProjectManager: def __init__( self, - config_file_name: str = BrickflowProjectConstants.DEFAULT_MULTI_PROJECT_CONFIG_FILE_NAME.value, - file_type: ConfigFileType = ConfigFileType.YAML, + config_file_name: str = f"{BrickflowProjectConstants.DEFAULT_MULTI_PROJECT_CONFIG_FILE_NAME.value}." + f"{BrickflowProjectConstants.DEFAULT_CONFIG_FILE_TYPE.value}", + file_type: ConfigFileType = BrickflowProjectConstants.DEFAULT_CONFIG_FILE_TYPE, ) -> None: self.file_type = file_type self._config_file: Path = Path(config_file_name) diff --git a/brickflow/codegen/databricks_bundle.py b/brickflow/codegen/databricks_bundle.py index 88ef7d8..42a9031 100644 --- a/brickflow/codegen/databricks_bundle.py +++ b/brickflow/codegen/databricks_bundle.py @@ -24,6 +24,7 @@ ctx, get_brickflow_version, get_bundles_project_env, + get_config_file_type, ) from brickflow.bundles.model import ( Bundle, @@ -462,8 +463,10 @@ def adjust_file_path(self, file_path: str) -> str: ] ).replace("//", "/") + brickflow_root = str(get_brickflow_root()) multi_project_manager = MultiProjectManager( - config_file_name=str(get_brickflow_root()) + config_file_name=brickflow_root, + file_type=get_config_file_type(brickflow_root), ) bf_project = multi_project_manager.get_project(self.project.name)