Skip to content

Commit

Permalink
add decoding coverage to assertions and foreign keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Collins authored and Chris Collins committed Nov 3, 2022
1 parent 2c61f61 commit dbe889f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Link } from 'react-router-dom';
import styled from 'styled-components';
import { GetDatasetQuery } from '../../../../../../../graphql/dataset.generated';
import { EntityType } from '../../../../../../../types.generated';
import { decodeSchemaField } from '../../../../../../lineage/utils/columnLineageUtils';
import CompactContext from '../../../../../../shared/CompactContext';
import { useEntityRegistry } from '../../../../../../useEntityRegistry';
import { ANTD_GRAY } from '../../../../constants';
Expand Down Expand Up @@ -130,7 +131,7 @@ export const SchemaRow = ({
<TableTitle>{baseEntity.dataset?.name}</TableTitle>
{selectedFk?.constraint?.sourceFields?.map((field) => (
<div key={field?.fieldPath}>
<FieldBadge count={field?.fieldPath} />
<FieldBadge count={decodeSchemaField(field?.fieldPath || '')} />
</div>
))}
</div>
Expand All @@ -139,7 +140,7 @@ export const SchemaRow = ({
<TableTitle>{selectedFk?.constraint?.foreignDataset?.name}</TableTitle>
{selectedFk?.constraint?.foreignFields?.map((field) => (
<div key={field?.fieldPath}>
<FieldBadge count={field?.fieldPath} />
<FieldBadge count={decodeSchemaField(field?.fieldPath || '')} />
</div>
))}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
DatasetAssertionScope,
SchemaFieldRef,
} from '../../../../../../types.generated';
import { decodeSchemaField } from '../../../../../lineage/utils/columnLineageUtils';
import { getFormattedParameterValue } from './assertionUtils';
import { DatasetAssertionLogicModal } from './DatasetAssertionLogicModal';

Expand Down Expand Up @@ -37,7 +38,7 @@ const getSchemaAggregationText = (
case AssertionStdAggregation.Columns:
return <Typography.Text>Dataset columns are</Typography.Text>;
case AssertionStdAggregation.Native: {
const fieldNames = fields?.map((field) => field.path) || [];
const fieldNames = fields?.map((field) => decodeSchemaField(field.path)) || [];
return (
<Typography.Text>
Dataset columns <Typography.Text strong>{JSON.stringify(fieldNames)}</Typography.Text> are
Expand Down Expand Up @@ -76,7 +77,7 @@ const getColumnAggregationText = (
aggregation: AssertionStdAggregation | undefined | null,
field: SchemaFieldRef | undefined,
) => {
let columnText = field?.path;
let columnText = decodeSchemaField(field?.path || '');
if (field === undefined) {
columnText = 'undefined';
console.error(`Invalid field provided for Dataset Assertion with scope Column ${JSON.stringify(field)}`);
Expand Down

0 comments on commit dbe889f

Please sign in to comment.