Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ingest): add ability to preserve dbt table identifier casing #7854

Closed
wants to merge 4 commits into from
Closed
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 @@ -277,6 +277,10 @@ class DBTCommonConfig(
stateful_ingestion: Optional[StatefulStaleMetadataRemovalConfig] = pydantic.Field(
default=None, description="DBT Stateful Ingestion Config."
)
convert_dataset_urns_to_lowercase: bool = Field(
default=True,
description="When enabled, converts dataset URNs to lowercase to ensure cross-platform compatibility. ",
)
convert_column_urns_to_lowercase: bool = Field(
default=False,
description="When enabled, converts column URNs to lowercase to ensure cross-platform compatibility. "
Expand Down Expand Up @@ -403,10 +407,11 @@ def get_urn(
target_platform: str,
env: str,
data_platform_instance: Optional[str],
convert_dataset_urns_to_lowercase: Optional[bool],
) -> str:
db_fqn = self.get_db_fqn()
if target_platform != DBT_PLATFORM:
db_fqn = db_fqn.lower()
db_fqn = db_fqn.lower() if convert_dataset_urns_to_lowercase else db_fqn
return mce_builder.make_dataset_urn_with_platform_instance(
platform=target_platform,
name=db_fqn,
Expand Down Expand Up @@ -446,6 +451,7 @@ def get_upstreams(
target_platform_instance: Optional[str],
environment: str,
platform_instance: Optional[str],
convert_dataset_urns_to_lowercase: Optional[bool],
) -> List[str]:
upstream_urns = []

Expand Down Expand Up @@ -474,6 +480,7 @@ def get_upstreams(
platform_value,
environment,
platform_instance_value,
convert_dataset_urns_to_lowercase,
)
)
return upstream_urns
Expand Down Expand Up @@ -737,6 +744,7 @@ def create_test_entity_mcps(
target_platform_instance=self.config.target_platform_instance,
environment=self.config.env,
platform_instance=None,
convert_dataset_urns_to_lowercase=self.config.convert_dataset_urns_to_lowercase,
)

for upstream_urn in sorted(upstream_urns):
Expand Down Expand Up @@ -978,6 +986,7 @@ def create_platform_mces(
mce_platform,
self.config.env,
mce_platform_instance,
self.config.convert_dataset_urns_to_lowercase,
)
if not self.config.entities_enabled.can_emit_node_type(node.node_type):
logger.debug(
Expand Down Expand Up @@ -1035,6 +1044,7 @@ def create_platform_mces(
DBT_PLATFORM,
self.config.env,
self.config.platform_instance,
self.config.convert_dataset_urns_to_lowercase,
)
upstreams_lineage_class = get_upstream_lineage([upstream_dbt_urn])
if self.config.incremental_lineage:
Expand Down Expand Up @@ -1372,6 +1382,7 @@ def _create_lineage_aspect_for_dbt_node(
self.config.target_platform_instance,
self.config.env,
self.config.platform_instance,
self.config.convert_dataset_urns_to_lowercase,
)

# if a node is of type source in dbt, its upstream lineage should have the corresponding table/view
Expand All @@ -1382,6 +1393,7 @@ def _create_lineage_aspect_for_dbt_node(
self.config.target_platform,
self.config.env,
self.config.target_platform_instance,
self.config.convert_dataset_urns_to_lowercase,
)
)
if upstream_urns:
Expand Down