diff --git a/.changes/0.12.8.md b/.changes/0.12.8.md new file mode 100644 index 0000000..0651235 --- /dev/null +++ b/.changes/0.12.8.md @@ -0,0 +1,3 @@ +## 0.12.8 - 2024-03-29 +### Added +* Add a `--skip-add-data-types` flag diff --git a/CHANGELOG.md b/CHANGELOG.md index 67729f9..b87adb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## 0.12.8 - 2024-03-29 +### Added +* Add a `--skip-add-data-types` flag + ## 0.12.7 - 2024-03-28 ### Added * Add a --use-unrendered-descriptions flag which allows doc block propagation diff --git a/pyproject.toml b/pyproject.toml index 4045f48..2aea4eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dbt-osmosis" -version = "0.12.7" +version = "0.12.8" description = "A dbt server and suite of optional developer tools to make developing with dbt delightful." authors = ["z3z1ma "] license = "Apache-2.0" diff --git a/src/dbt_osmosis/core/osmosis.py b/src/dbt_osmosis/core/osmosis.py index f62416f..d83e266 100644 --- a/src/dbt_osmosis/core/osmosis.py +++ b/src/dbt_osmosis/core/osmosis.py @@ -103,6 +103,7 @@ def __init__( models: Optional[List[str]] = None, skip_add_columns: bool = False, skip_add_tags: bool = False, + skip_add_data_types: bool = False, skip_merge_meta: bool = False, add_progenitor_to_meta: bool = False, vars: Optional[str] = None, @@ -118,6 +119,7 @@ def __init__( self._catalog: Optional[CatalogArtifact] = None self.skip_add_columns = skip_add_columns self.skip_add_tags = skip_add_tags + self.skip_add_data_types = skip_add_data_types self.skip_merge_meta = skip_merge_meta self.add_progenitor_to_meta = add_progenitor_to_meta self.use_unrendered_descriptions = use_unrendered_descriptions @@ -999,6 +1001,8 @@ def update_columns_data_type( columns_db_meta: Dict[str, ColumnMetadata], ) -> int: changes_committed = 0 + if not self.skip_add_data_types: + return changes_committed for column in columns_db_meta: cased_column_name = self.column_casing(column) if cased_column_name in node.columns: diff --git a/src/dbt_osmosis/main.py b/src/dbt_osmosis/main.py index 3d805df..87ef64e 100644 --- a/src/dbt_osmosis/main.py +++ b/src/dbt_osmosis/main.py @@ -136,6 +136,11 @@ def wrapper(*args, **kwargs): is_flag=True, help="If specified, we will skip adding tags to the models.", ) +@click.option( + "--skip-add-data-types", + is_flag=True, + help="If specified, we will skip adding data types to the models.", +) @click.option( "--skip-merge-meta", is_flag=True, @@ -184,6 +189,7 @@ def refactor( check: bool = False, skip_add_columns: bool = False, skip_add_tags: bool = False, + skip_add_data_types: bool = False, skip_merge_meta: bool = False, add_progenitor_to_meta: bool = False, models: Optional[List[str]] = None, @@ -215,6 +221,7 @@ def refactor( catalog_file=catalog_file, skip_add_columns=skip_add_columns, skip_add_tags=skip_add_tags, + skip_add_data_types=skip_add_data_types, skip_merge_meta=skip_merge_meta, add_progenitor_to_meta=add_progenitor_to_meta, profile=profile, @@ -267,6 +274,11 @@ def refactor( is_flag=True, help="If specified, we will skip adding tags to the models.", ) +@click.option( + "--skip-add-data-types", + is_flag=True, + help="If specified, we will skip adding data types to the models.", +) @click.option( "--skip-merge-meta", is_flag=True, @@ -306,6 +318,7 @@ def organize( models: Optional[List[str]] = None, skip_add_columns: bool = False, skip_add_tags: bool = False, + skip_add_data_types: bool = False, skip_merge_meta: bool = False, add_progenitor_to_meta: bool = False, profile: Optional[str] = None, @@ -333,6 +346,7 @@ def organize( models=models, skip_add_columns=skip_add_columns, skip_add_tags=skip_add_tags, + skip_add_data_types=skip_add_data_types, skip_merge_meta=skip_merge_meta, add_progenitor_to_meta=add_progenitor_to_meta, profile=profile, @@ -399,6 +413,11 @@ def organize( is_flag=True, help="If specified, we will skip adding tags to the models.", ) +@click.option( + "--skip-add-data-types", + is_flag=True, + help="If specified, we will skip adding data types to the models.", +) @click.option( "--skip-merge-meta", is_flag=True, @@ -448,6 +467,7 @@ def document( models: Optional[List[str]] = None, skip_add_columns: bool = False, skip_add_tags: bool = False, + skip_add_data_types: bool = False, skip_merge_meta: bool = False, add_progenitor_to_meta: bool = False, profile: Optional[str] = None, @@ -477,6 +497,7 @@ def document( catalog_file=catalog_file, skip_add_columns=skip_add_columns, skip_add_tags=skip_add_tags, + skip_add_data_types=skip_add_data_types, skip_merge_meta=skip_merge_meta, add_progenitor_to_meta=add_progenitor_to_meta, profile=profile,