-
Notifications
You must be signed in to change notification settings - Fork 3k
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(ui) Handle encoded schemaField urns on the frontend #6321
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import { encodeSchemaField } from '../../../../lineage/utils/columnLineageUtils'; | ||
|
||
export function generateSchemaFieldUrn(fieldPath: string | undefined, resourceUrn: string) { | ||
if (!fieldPath) return null; | ||
return `urn:li:schemaField:(${resourceUrn},${fieldPath})`; | ||
return `urn:li:schemaField:(${resourceUrn},${encodeSchemaField(fieldPath)})`; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import React from 'react'; | |
import styled from 'styled-components/macro'; | ||
import { Entity, EntityType, SchemaFieldEntity } from '../../../types.generated'; | ||
import { downgradeV2FieldPath } from '../../entity/dataset/profile/schema/utils/utils'; | ||
import { decodeSchemaField } from '../../lineage/utils/columnLineageUtils'; | ||
import { useEntityRegistry } from '../../useEntityRegistry'; | ||
|
||
const ColumnNameWrapper = styled.span<{ isBlack?: boolean }>` | ||
|
@@ -25,7 +26,7 @@ export default function DisplayedColumns({ displayedColumns }: Props) { | |
return ( | ||
<ColumnNameWrapper> | ||
{entity.type === EntityType.SchemaField | ||
? downgradeV2FieldPath((entity as SchemaFieldEntity).fieldPath) | ||
? decodeSchemaField(downgradeV2FieldPath((entity as SchemaFieldEntity).fieldPath) || '') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we decode after downgrading or before? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it would really matter as decoding it just converts a few encoded characters back to normal ( |
||
: entityRegistry.getDisplayName(entity.type, entity)} | ||
{index !== displayedColumns.length - 1 && ', '} | ||
</ColumnNameWrapper> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import urllib.parse | ||
from typing import List | ||
|
||
# NOTE: Frontend relies on encoding these three characters. Specifically, we decode and encode schema fields for column level lineage. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question - In such cases, how will these column fields appear in a) Schema Tab Do we also need that encoding there? If yes, maybe consider adding in this PR, or marking TODOs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great question - I believe these tabs do not need to be decoded, since the tables in them are reading from fields in mysql that have the So the only time we have encoded fieldPaths is when we're actually grabbing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
# If this changes, make appropriate changes to datahub-web-react/src/app/lineage/utils/columnLineageUtils.ts | ||
RESERVED_CHARS = [",", "(", ")"] | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!