Skip to content

Commit

Permalink
Apply black formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
nijigen-plot committed Nov 13, 2024
1 parent 43623e0 commit 0c08a83
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions src/dbt_osmosis/core/osmosis.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,21 +908,21 @@ def _run(
return

should_dump = False
n_cols_added, n_cols_doc_inherited, n_cols_removed, n_cols_data_type_changed, n_cols_description_changed = (
0,
0,
0,
0,
0
)
(
n_cols_added,
n_cols_doc_inherited,
n_cols_removed,
n_cols_data_type_changed,
n_cols_description_changed,
) = (0, 0, 0, 0, 0)
if len(missing_columns) > 0 or len(undocumented_columns) or len(extra_columns) > 0:
# Update schema file
(
n_cols_added,
n_cols_doc_inherited,
n_cols_removed,
n_cols_data_type_changed,
n_cols_description_changed
n_cols_description_changed,
) = self.update_schema_file_and_node(
missing_columns,
undocumented_columns,
Expand All @@ -932,7 +932,11 @@ def _run(
columns_db_meta,
)
if (
n_cols_added + n_cols_doc_inherited + n_cols_removed + n_cols_data_type_changed + n_cols_description_changed
n_cols_added
+ n_cols_doc_inherited
+ n_cols_removed
+ n_cols_data_type_changed
+ n_cols_description_changed
> 0
):
should_dump = True
Expand Down Expand Up @@ -1036,7 +1040,7 @@ def update_columns_attribute(
columns_db_meta: Dict[str, ColumnMetadata],
attribute_name: str,
meta_key: str,
skip_attribute_update: Any
skip_attribute_update: Any,
) -> int:
changes_committed = 0
if (skip_attribute_update is True) or (skip_attribute_update is None):
Expand All @@ -1046,10 +1050,10 @@ def update_columns_attribute(
if cased_column_name in node.columns:
column_meta_obj = columns_db_meta.get(cased_column_name)
if column_meta_obj:
column_meta = getattr(column_meta_obj, meta_key, '')
column_meta = getattr(column_meta_obj, meta_key, "")
if column_meta is None:
column_meta = ''
current_value = getattr(node.columns[cased_column_name], attribute_name, '')
column_meta = ""
current_value = getattr(node.columns[cased_column_name], attribute_name, "")
if current_value == column_meta:
continue
setattr(node.columns[cased_column_name], attribute_name, column_meta)
Expand Down Expand Up @@ -1127,23 +1131,19 @@ def update_schema_file_and_node(
)
)
n_cols_data_type_updated = self.update_columns_attribute(
node,
section,
columns_db_meta,
"data_type",
"type",
self.skip_add_data_types
node, section, columns_db_meta, "data_type", "type", self.skip_add_data_types
)
n_cols_description_updated = self.update_columns_attribute(
node,
section,
columns_db_meta,
"description",
"comment",
self.catalog_file
node, section, columns_db_meta, "description", "comment", self.catalog_file
)
n_cols_removed = self.remove_columns_not_in_database(extra_columns, node, section)
return n_cols_added, n_cols_doc_inherited, n_cols_removed, n_cols_data_type_updated, n_cols_description_updated
return (
n_cols_added,
n_cols_doc_inherited,
n_cols_removed,
n_cols_data_type_updated,
n_cols_description_updated,
)

@staticmethod
def maybe_get_section_from_schema_file(
Expand Down

0 comments on commit 0c08a83

Please sign in to comment.