Skip to content
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/data-contract): fix freshness & schema assertion is not working #10795

Merged

Conversation

amit-apptware
Copy link
Contributor

@amit-apptware amit-apptware commented Jun 27, 2024

Screencast.from.27-06-24.09_13_35.PM.IST.webm

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added product PR or Issue related to the DataHub UI/UX community-contribution PR or Issue raised by member(s) of DataHub Community labels Jun 27, 2024
@@ -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);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sometime it throwing error because of the modify an array that has been marked as read-only

assertionInfo={record.datasetAssertionInfo}
/>
) : (
<AssertionDescriptionContainer>{description}</AssertionDescriptionContainer>
Copy link
Collaborator

Choose a reason for hiding this comment

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

if there is no description, can we fallback on || 'No description provided'

@@ -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;
Copy link
Collaborator

@jayacryl jayacryl Jun 27, 2024

Choose a reason for hiding this comment

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

does this mean user can only select one assertion of each type? Is that the expected behavior - or do we want users to select multiple assertions for each type?

Copy link
Contributor Author

@amit-apptware amit-apptware Jun 27, 2024

Choose a reason for hiding this comment

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

the logic is reused.. it will check for particular assertions to satisfy only one assertion for freshness and Schema.

}
tags {
...globalTagsFields
}
}

fragment assertionDetailsWithRunEvents on Assertion {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we already have this defined in OSS? Would this be duplicate?

@jayacryl jayacryl marked this pull request as ready for review June 27, 2024 15:32
@@ -61,9 +61,7 @@ export const Assertions = () => {
const assertions =
(combinedData && combinedData.dataset?.assertions?.assertions?.map((assertion) => assertion as Assertion)) ||
[];
const filteredAssertions = assertions.filter(
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. make sure we display non-dataset assertions on the list

) : (
<AssertionDescriptionContainer>
{description ?? 'No description provided'}
</AssertionDescriptionContainer>
Copy link
Collaborator

@jayacryl jayacryl Jun 27, 2024

Choose a reason for hiding this comment

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

  1. fallback for description if this is not a dataset assertion (temporary handling until we port assertions list UI over form saas)

@@ -1,3 +1,173 @@
fragment assertionInfo on AssertionInfo {
Copy link
Collaborator

@jayacryl jayacryl Jun 27, 2024

Choose a reason for hiding this comment

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

  1. fetch data for schema/freshness assertions to display contracts correctly

@jayacryl jayacryl merged commit 6712226 into datahub-project:master Jun 27, 2024
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution PR or Issue raised by member(s) of DataHub Community product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants