Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
elic-eon committed Aug 30, 2024
1 parent 3e2d1f9 commit 18aac85
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions metaphor/dbt/cloud/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
)
from metaphor.models.metadata_change_event import DataPlatform

ADAPTER_TYPE_MAPPING = {
"DATABRICKS": DataPlatform.UNITY_CATALOG,
"POSTGRES": DataPlatform.POSTGRESQL,
}


def parse_environment(environment: GetEnvironmentAdapterTypeEnvironment):
adapter_type = (
environment.adapter_type or "unknown"
) # It's possible for the environment to not have an adapter type!
adapter_type = adapter_type.upper()
if adapter_type == "DATABRICKS":
platform = DataPlatform.UNITY_CATALOG
elif adapter_type == "POSTGRES":
platform = DataPlatform.POSTGRESQL
if adapter_type in ADAPTER_TYPE_MAPPING:
platform = ADAPTER_TYPE_MAPPING[adapter_type]

Check warning on line 18 in metaphor/dbt/cloud/utils.py

View check run for this annotation

Codecov / codecov/patch

metaphor/dbt/cloud/utils.py#L18

Added line #L18 was not covered by tests
else:
assert (
adapter_type in DataPlatform.__members__
Expand Down

0 comments on commit 18aac85

Please sign in to comment.