Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"""
try:
response = self.metadata.client.get(
f"/metadata/types/name/table?fields=customProperties" # noqa: F541

Check warning on line 162 in ingestion/src/metadata/ingestion/source/database/dbt/metadata.py

View check run for this annotation

SonarQubeCloud / [open-metadata-ingestion] SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ingestion&issues=AZ3OqUAPnfcqDAlAP-a5&open=AZ3OqUAPnfcqDAlAP-a5&pullRequest=26458
)

if response and "customProperties" in response:
Expand Down Expand Up @@ -197,7 +197,7 @@

return None

def get_dbt_owner(self, manifest_node: Any, catalog_node: Optional[Any]) -> Optional[EntityReferenceList]:

Check failure on line 200 in ingestion/src/metadata/ingestion/source/database/dbt/metadata.py

View check run for this annotation

SonarQubeCloud / [open-metadata-ingestion] SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 40 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ingestion&issues=AZ3OqUAPnfcqDAlAP-a6&open=AZ3OqUAPnfcqDAlAP-a6&pullRequest=26458
"""
Returns dbt owner with priority:
1. manifest_node.meta.openmetadata.owner (OpenMetadata docs format - HIGHEST PRIORITY)
Expand Down Expand Up @@ -525,7 +525,7 @@

return valid_custom_properties if valid_custom_properties else None

def yield_dbt_tags(self, dbt_objects: DbtObjects) -> Iterable[Either[OMetaTagAndClassification]]:

Check failure on line 528 in ingestion/src/metadata/ingestion/source/database/dbt/metadata.py

View check run for this annotation

SonarQubeCloud / [open-metadata-ingestion] SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ingestion&issues=AZ3OqUAPnfcqDAlAP-a7&open=AZ3OqUAPnfcqDAlAP-a7&pullRequest=26458
"""
Create and yield tags from DBT
"""
Expand Down Expand Up @@ -720,7 +720,7 @@
return None

# pylint: disable=too-many-locals, too-many-branches
def yield_data_models(self, dbt_objects: DbtObjects) -> Iterable[Either[DataModelLink]]:

Check failure on line 723 in ingestion/src/metadata/ingestion/source/database/dbt/metadata.py

View check run for this annotation

SonarQubeCloud / [open-metadata-ingestion] SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 67 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ingestion&issues=AZ3OqUAPnfcqDAlAP-a8&open=AZ3OqUAPnfcqDAlAP-a8&pullRequest=26458
"""
Yield the data models
"""
Expand Down Expand Up @@ -946,7 +946,7 @@

return upstream_nodes

def parse_data_model_columns(self, manifest_node: Any, catalog_node: Any) -> List[Column]:

Check failure on line 949 in ingestion/src/metadata/ingestion/source/database/dbt/metadata.py

View check run for this annotation

SonarQubeCloud / [open-metadata-ingestion] SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 51 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ingestion&issues=AZ3OqUAPnfcqDAlAP-a9&open=AZ3OqUAPnfcqDAlAP-a9&pullRequest=26458
"""
Method to parse the DBT columns
"""
Expand Down Expand Up @@ -1201,7 +1201,7 @@
entity_type=Table,
fqn_search_string=upstream_node,
)
from_entity: Optional[Union[Table, List[Table]]] = get_entity_from_es_result(

Check warning on line 1204 in ingestion/src/metadata/ingestion/source/database/dbt/metadata.py

View check run for this annotation

SonarQubeCloud / [open-metadata-ingestion] SonarCloud Code Analysis

Use a union type expression for this type hint.

See more on https://sonarcloud.io/project/issues?id=open-metadata-ingestion&issues=AZ3OqUAPnfcqDAlAP-a-&open=AZ3OqUAPnfcqDAlAP-a-&pullRequest=26458
entity_list=from_es_result, fetch_multiple_entities=False
)
if from_entity and to_entity:
Expand Down Expand Up @@ -1486,7 +1486,7 @@
logger.debug(f"Adding DBT Test Case Results for node: {manifest_node.name}")
dbt_test_result = dbt_test.get(DbtCommonEnum.RESULTS.value)
if not dbt_test_result:
logger.warning(f"DBT Test Case Results not found for node: {manifest_node.name}")
logger.debug(f"DBT Test Case Results not found for node: {manifest_node.name}")
return

# Skip compiled-only entries: `dbt run` includes test nodes in
Expand Down
Loading