fix(ingest/sdk): properly add data platform instance to browsepath for DataFlow #15270
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes DataFlow entities (e.g., Fivetran pipelines) appearing in a "Default" folder in DataHub's browse tree by implementing proper
BrowsePathsV2support in the DataFlow SDK class.Problem
It was reported in Fivetran pipeline entities were appearing in a "Default" folder in the browse tree, while their individual DataJob tasks appeared in the correct locations. This created confusion and duplicate-like entries in the UI.
Root Cause:
DataFlowSDK class did not set aBrowsePathsV2aspect during initializationDataJobentities properly inherit and extend their parent DataFlow's browse path via_set_browse_path_from_flow()Changes
Core Implementation
src/datahub/sdk/dataflow.py:_set_default_browse_path()method to set browse paths based on platform instance__init__to call_set_default_browse_path(platform_instance)during initializationDataPlatformInstanceUrnimportBehavior:
platform_instanceset will appear under that platform instance in browse tree (e.g.,/prod_instance/)platform_instancewill have an empty browse path (not "Default")[platform_instance, dataflow_urn]when platform_instance existsTesting
tests/unit/sdk_v2/test_dataflow.py:test_dataflow_browse_path_with_platform_instance()- verifies browse path is set correctly with platform_instancetest_dataflow_browse_path_without_platform_instance()- verifies empty browse path without platform_instancetests/unit/sdk_v2/test_datajob.py:test_datajob_complex()assertion to match new hierarchical browse path behaviorGolden files updated:
browsePathsV2aspectsImpact
Affected Sources
User Experience
/Default/folder/[platform_instance]/(when platform_instance is configured)Backward Compatibility
Testing
./gradlew lintFix)