Skip to content

Conversation

chriscollins3456
Copy link
Collaborator

This PR creates a new graphql endpoint for deleting page modules. There are a few stipulations:

  1. You cannot delete one of the default modules we create on ingest
  2. You can only delete PERSONAL modules that you yourself created

There is a ticket for adding the manage permissions for modules that will update the logic here and a few other places soon.

@github-actions github-actions bot added product PR or Issue related to the DataHub UI/UX devops PR or Issue related to DataHub backend & deployment labels Jul 9, 2025
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Jul 9, 2025
Copy link

codecov bot commented Jul 9, 2025

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
3060 6 3054 41
View the full list of 3 ❄️ flaky tests
tests.lineage.test_lineage_sdk::test_column_level_lineage_from_schema_field

Flake rate in main: 9.09% (Passed 40 times, Failed 4 times)

Stack Traces | 0.019s run time
test_client = <datahub.sdk.main_client.DataHubClient object at 0x7f3dad127290>
test_datasets = {'downstream1': Dataset('urn:li:dataset:(urn:li:dataPlatform:snowflake,test_lineage_downstream_001,PROD)'), 'downstrea...ream_003,PROD)'), 'upstream': Dataset('urn:li:dataset:(urn:li:dataPlatform:snowflake,test_lineage_upstream_001,PROD)')}

    def test_column_level_lineage_from_schema_field(
        test_client: DataHubClient, test_datasets: Dict[str, Dataset]
    ):
        source_schema_field = SchemaFieldUrn(test_datasets["upstream"].urn, "id")
        column_lineage_results = test_client.lineage.get_lineage(
            source_urn=str(source_schema_field), direction="downstream", max_hops=3
        )
    
>       assert len(column_lineage_results) == 3
E       assert 0 == 3
E        +  where 0 = len([])

tests/lineage/test_lineage_sdk.py:203: AssertionError
tests.lineage.test_lineage_sdk::test_filtered_column_level_lineage

Flake rate in main: 9.09% (Passed 40 times, Failed 4 times)

Stack Traces | 0.02s run time
test_client = <datahub.sdk.main_client.DataHubClient object at 0x7f3dad127290>
test_datasets = {'downstream1': Dataset('urn:li:dataset:(urn:li:dataPlatform:snowflake,test_lineage_downstream_001,PROD)'), 'downstrea...ream_003,PROD)'), 'upstream': Dataset('urn:li:dataset:(urn:li:dataPlatform:snowflake,test_lineage_upstream_001,PROD)')}

    def test_filtered_column_level_lineage(
        test_client: DataHubClient, test_datasets: Dict[str, Dataset]
    ):
        filtered_column_lineage_results = test_client.lineage.get_lineage(
            source_urn=str(test_datasets["upstream"].urn),
            source_column="id",
            direction="downstream",
            max_hops=3,
            filter=F.and_(F.platform("mysql"), F.entity_type("dataset")),
        )
    
>       assert len(filtered_column_lineage_results) == 1
E       assert 0 == 1
E        +  where 0 = len([])

tests/lineage/test_lineage_sdk.py:185: AssertionError
tests.lineage.test_lineage_sdk::test_table_level_lineage

Flake rate in main: 9.09% (Passed 40 times, Failed 4 times)

Stack Traces | 0.161s run time
test_client = <datahub.sdk.main_client.DataHubClient object at 0x7f3dad127290>
test_datasets = {'downstream1': Dataset('urn:li:dataset:(urn:li:dataPlatform:snowflake,test_lineage_downstream_001,PROD)'), 'downstrea...ream_003,PROD)'), 'upstream': Dataset('urn:li:dataset:(urn:li:dataPlatform:snowflake,test_lineage_upstream_001,PROD)')}

    def test_table_level_lineage(
        test_client: DataHubClient, test_datasets: Dict[str, Dataset]
    ):
        table_lineage_results = test_client.lineage.get_lineage(
            source_urn=str(test_datasets["upstream"].urn),
            direction="downstream",
            max_hops=3,
        )
    
>       assert len(table_lineage_results) == 3
E       assert 0 == 3
E        +  where 0 = len([])

tests/lineage/test_lineage_sdk.py:109: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@datahub-cyborg datahub-cyborg bot added pending-submitter-merge and removed needs-review Label for PRs that need review from a maintainer. labels Jul 9, 2025
entityClient.deleteEntity(opContext, moduleUrn);

// Asynchronously delete all references to the entity (to return quickly)
CompletableFuture.runAsync(
Copy link
Contributor

Choose a reason for hiding this comment

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

just a question: should we handle somehow the case when the module was deleted but references steel there?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we should indeed. i'll create a ticket for this

Base automatically changed from cc--ch-505-upsert-module to master July 9, 2025 16:17
@chriscollins3456 chriscollins3456 merged commit cd717b0 into master Jul 16, 2025
32 of 35 checks passed
@chriscollins3456 chriscollins3456 deleted the cc--ch-506-delete-page-module branch July 16, 2025 15:08
kartikey-visa pushed a commit to kartikey-visa/datahub that referenced this pull request Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops PR or Issue related to DataHub backend & deployment pending-submitter-merge product PR or Issue related to the DataHub UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants