Skip to content

Commit

Permalink
resolve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
sid-acryl committed Jun 28, 2024
2 parents 36c688a + 6f1f769 commit c28e4f2
Show file tree
Hide file tree
Showing 57 changed files with 5,694 additions and 13,033 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ project.ext.externalDependency = [
'hazelcastTest':"com.hazelcast:hazelcast:$hazelcastVersion:tests",
'hibernateCore': 'org.hibernate:hibernate-core:5.2.16.Final',
'httpClient': 'org.apache.httpcomponents.client5:httpclient5:5.3',
'httpAsyncClient': 'org.apache.httpcomponents:httpasyncclient:4.1.5',
'iStackCommons': 'com.sun.istack:istack-commons-runtime:4.0.1',
'jacksonJDK8': "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion",
'jacksonDataPropertyFormat': "com.fasterxml.jackson.dataformat:jackson-dataformat-properties:$jacksonVersion",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ export const Assertions = () => {
const assertions =
(combinedData && combinedData.dataset?.assertions?.assertions?.map((assertion) => assertion as Assertion)) ||
[];
const filteredAssertions = assertions.filter(
(assertion) => !removedUrns.includes(assertion.urn) && !!assertion.info?.datasetAssertion,
);
const filteredAssertions = assertions.filter((assertion) => !removedUrns.includes(assertion.urn));

// Pre-sort the list of assertions based on which has been most recently executed.
assertions.sort(sortAssertions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ const DataContractLogo = styled(AuditOutlined)`
color: ${REDESIGN_COLORS.BLUE};
`;

const AssertionDescriptionContainer = styled.div`
display: flex;
justify-content: right;
align-items: center;
`;

type Props = {
assertions: Array<Assertion>;
onDelete?: (urn: string) => void;
Expand Down Expand Up @@ -162,10 +168,17 @@ export const DatasetAssertionsList = ({
</Tag>
</Tooltip>
</div>
<DatasetAssertionDescription
description={description}
assertionInfo={record.datasetAssertionInfo}
/>
{record.datasetAssertionInfo ? (
<DatasetAssertionDescription
description={description}
assertionInfo={record.datasetAssertionInfo}
/>
) : (
<AssertionDescriptionContainer>
{description ?? 'No description provided'}
</AssertionDescriptionContainer>
)}

{(isPartOfContract && entityData?.urn && (
<Tooltip
title={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,21 @@ export const DataContractBuilder = ({ entityUrn, initialState, onSubmit, onCance

const hasAssertions = freshnessAssertions.length || schemaAssertions.length || dataQualityAssertions.length;

const onSelectFreshnessOrSchemaAssertion = (assertionUrn: string, type: string) => {
const selected = builderState[type]?.assertionUrn === assertionUrn;
if (selected) {
setBuilderState({
...builderState,
[type]: undefined,
});
} else {
setBuilderState({
...builderState,
[type]: { assertionUrn },
});
}
};

return (
<>
{(hasAssertions && <HeaderText>Select the assertions that will make up your contract.</HeaderText>) || (
Expand All @@ -124,7 +139,7 @@ export const DataContractBuilder = ({ entityUrn, initialState, onSubmit, onCance
selectedUrns={
(builderState.freshness?.assertionUrn && [builderState.freshness?.assertionUrn]) || []
}
onSelect={(selectedUrn: string) => onSelectDataAssertion(selectedUrn, 'freshness')}
onSelect={(selectedUrn: string) => onSelectFreshnessOrSchemaAssertion(selectedUrn, 'freshness')}
/>
)) ||
undefined}
Expand All @@ -134,7 +149,7 @@ export const DataContractBuilder = ({ entityUrn, initialState, onSubmit, onCance
assertions={schemaAssertions}
multiple={false}
selectedUrns={(builderState.schema?.assertionUrn && [builderState.schema?.assertionUrn]) || []}
onSelect={(selectedUrn: string) => onSelectDataAssertion(selectedUrn, 'schema')}
onSelect={(selectedUrn: string) => onSelectFreshnessOrSchemaAssertion(selectedUrn, 'schema')}
/>
)) ||
undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ export const getAssertionsSummary = (assertions: Assertion[]): AssertionStatusSu
// */
export const createAssertionGroups = (assertions: Array<Assertion>): AssertionGroup[] => {
// Pre-sort the list of assertions based on which has been most recently executed.
assertions.sort(sortAssertions);
const newAssertions = [...assertions].sort(sortAssertions);

const typeToAssertions = new Map();
assertions
newAssertions
.filter((assertion) => assertion.info?.type)
.forEach((assertion) => {
const groupType = assertion.info?.type;
Expand Down
229 changes: 198 additions & 31 deletions datahub-web-react/src/graphql/assertion.graphql
Original file line number Diff line number Diff line change
@@ -1,3 +1,173 @@
fragment assertionInfo on AssertionInfo {
type
description
lastUpdated {
time
actor
}
datasetAssertion {
datasetUrn
scope
aggregation
operator
parameters {
value {
value
type
}
minValue {
value
type
}
maxValue {
value
type
}
}
fields {
urn
path
}
nativeType
nativeParameters {
key
value
}
logic
}
freshnessAssertion {
type
entityUrn
schedule {
type
cron {
cron
timezone
}
fixedInterval {
unit
multiple
}
}
filter {
type
sql
}
}
sqlAssertion {
type
entityUrn
statement
changeType
operator
parameters {
...assertionStdParametersDetails
}
}
fieldAssertion {
type
entityUrn
filter {
type
sql
}
fieldValuesAssertion {
field {
path
type
nativeType
}
transform {
type
}
operator
parameters {
...assertionStdParametersDetails
}
failThreshold {
type
value
}
excludeNulls
}
fieldMetricAssertion {
field {
path
type
nativeType
}
metric
operator
parameters {
...assertionStdParametersDetails
}
}
}
volumeAssertion {
type
entityUrn
filter {
type
sql
}
rowCountTotal {
operator
parameters {
...assertionStdParametersDetails
}
}
rowCountChange {
type
operator
parameters {
...assertionStdParametersDetails
}
}
incrementingSegmentRowCountTotal {
operator
parameters {
...assertionStdParametersDetails
}
segment {
...incrementingSegmentSpecDetails
}
}
incrementingSegmentRowCountChange {
type
operator
parameters {
...assertionStdParametersDetails
}
segment {
...incrementingSegmentSpecDetails
}
}
}
schemaAssertion {
entityUrn
compatibility
fields {
path
type
nativeType
}
schema {
fields {
fieldPath
type
nativeDataType
}
}
}
source {
type
created {
time
actor
}
}
}

fragment assertionDetails on Assertion {
urn
type
Expand All @@ -16,43 +186,40 @@ fragment assertionDetails on Assertion {
...dataPlatformInstanceFields
}
info {
type
datasetAssertion {
scope
aggregation
operator
parameters {
value {
value
type
}
minValue {
value
type
}
maxValue {
value
type
}
}
fields {
urn
path
}
nativeType
nativeParameters {
key
value
}
logic
}
description
...assertionInfo
}
tags {
...globalTagsFields
}
}

fragment incrementingSegmentSpecDetails on IncrementingSegmentSpec {
field {
path
type
nativeType
}
transformer {
type
nativeType
}
}

fragment assertionStdParametersDetails on AssertionStdParameters {
value {
value
type
}
minValue {
value
type
}
maxValue {
value
type
}
}

fragment assertionRunEventDetails on AssertionRunEvent {
timestampMillis
lastObservedMillis
Expand Down
Loading

0 comments on commit c28e4f2

Please sign in to comment.