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

fix(ingest): add test for lowercase #11914

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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 @@ -7,7 +7,10 @@

import datahub.metadata.schema_classes as models
from datahub.configuration.time_window_config import BaseTimeWindowConfig
from datahub.emitter.mce_builder import make_dataset_urn
from datahub.emitter.mce_builder import (
make_dataset_urn,
make_dataset_urn_with_platform_instance,
)
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from datahub.ingestion.api.auto_work_units.auto_dataset_properties_aspect import (
auto_patch_last_modified,
Expand Down Expand Up @@ -99,6 +102,39 @@ def test_auto_status_aspect():
assert list(auto_status_aspect(initial_wu)) == expected


def test_auto_lowercase_aspects_with_platform_instance():
mcws = auto_workunit(
[
MetadataChangeProposalWrapper(
entityUrn=make_dataset_urn_with_platform_instance(
"hive", "mySchema.myTable", platform_instance="Orgeon", env="PROD"
),
aspect=models.DatasetKeyClass(
"urn:li:dataPlatform:hive", "Orgeon.mySchema.myTable", "PROD"
),
),
]
)

expected = [
*list(
Comment on lines +119 to +120
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expected = [
*list(
expected = list(

auto_workunit(
[
MetadataChangeProposalWrapper(
entityUrn="urn:li:dataset:(urn:li:dataPlatform:hive,orgeon.myschema.mytable,PROD)",
aspect=models.DatasetKeyClass(
"urn:li:dataPlatform:hive",
"orgeon.myschema.mytable",
"PROD",
),
)
]
)
),
]
assert list(auto_lowercase_urns(mcws)) == expected


def test_auto_lowercase_aspects():
mcws = auto_workunit(
[
Expand Down
Loading