Updated Generated types from schema (#1164)

This commit is contained in:
darth-coder00 2021-11-12 11:19:32 +05:30 committed by GitHub
parent ab836ac26f
commit 6c18bf5d3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 238 additions and 88 deletions

View File

@ -19,7 +19,12 @@ import { getByTestId, getByText, render } from '@testing-library/react';
import { TableDetail } from 'Models';
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { Column, DataType } from '../../generated/entity/data/table';
import {
Column,
DataType,
LabelType,
State,
} from '../../generated/entity/data/table';
import SchemaTab from './SchemaTab.component';
const mockColumns: Column[] = [
{
@ -27,7 +32,14 @@ const mockColumns: Column[] = [
dataType: DataType.String,
description: 'string',
fullyQualifiedName: 'string',
tags: [{ tagFQN: 'string' }, { tagFQN: 'string2' }],
tags: [
{ tagFQN: 'string', labelType: LabelType.Manual, state: State.Confirmed },
{
tagFQN: 'string2',
labelType: LabelType.Derived,
state: State.Confirmed,
},
],
ordinalPosition: 2,
},
];

View File

@ -19,7 +19,13 @@ import { getAllByTestId, render } from '@testing-library/react';
import { TableDetail } from 'Models';
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { Constraint, DataType, Table } from '../../generated/entity/data/table';
import {
Constraint,
DataType,
LabelType,
State,
Table,
} from '../../generated/entity/data/table';
import SchemaTable from './SchemaTable';
jest.mock('../common/rich-text-editor/RichTextEditorPreviewer', () => {
@ -35,7 +41,14 @@ const mockColumns: Table['columns'] = [
fullyQualifiedName: 'bigquery.shopify.dim_address.address_id',
name: 'address_id',
ordinalPosition: 1,
tags: [{ tagFQN: 'string' }, { tagFQN: 'string2' }],
tags: [
{ tagFQN: 'string', labelType: LabelType.Manual, state: State.Confirmed },
{
tagFQN: 'string2',
labelType: LabelType.Derived,
state: State.Confirmed,
},
],
},
];

View File

@ -117,6 +117,10 @@ export interface EntityReference {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -128,13 +132,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -98,6 +98,10 @@ export interface EntityReference {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -109,13 +113,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -96,6 +96,10 @@ export interface EntityReference {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -107,13 +111,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -17,11 +17,11 @@
*/
/**
* Create Model entity request
* Create ML Model entity request
*/
export interface CreateModel {
export interface CreateMLModel {
/**
* Algorithm used to train the model
* Algorithm used to train the ML model
*/
algorithm: string;
/**
@ -29,11 +29,11 @@ export interface CreateModel {
*/
dashboard?: EntityReference;
/**
* Description of the model instance. How it was trained and for what it is used.
* Description of the ML model instance. How it was trained and for what it is used.
*/
description?: string;
/**
* Display Name that identifies this model. It could be title or label from the source
* Display Name that identifies this ML model. It could be title or label from the source
* services
*/
displayName?: string;
@ -46,7 +46,7 @@ export interface CreateModel {
*/
mlHyperParameters?: MlHyperParameter[];
/**
* Name that identifies this model.
* Name that identifies this ML model.
*/
name: string;
/**
@ -54,7 +54,7 @@ export interface CreateModel {
*/
owner?: EntityReference;
/**
* Tags for this model
* Tags for this ML Model
*/
tags?: TagLabel[];
}
@ -99,7 +99,7 @@ export interface EntityReference {
}
/**
* This schema defines the type for a ML Feature used in a Model.
* This schema defines the type for a ML Feature used in a MLModel.
*/
export interface MlFeature {
/**
@ -176,6 +176,10 @@ export enum FeatureSourceDataType {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -187,13 +191,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**
@ -220,7 +224,7 @@ export enum State {
}
/**
* This schema defines the type for a ML HyperParameter used in a Model.
* This schema defines the type for a ML HyperParameter used in a MLModel.
*/
export interface MlHyperParameter {
/**

View File

@ -110,6 +110,10 @@ export interface EntityReference {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -121,13 +125,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -165,6 +165,10 @@ export enum Constraint {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -176,13 +180,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -144,6 +144,10 @@ export enum SchemaType {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -155,13 +159,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -67,6 +67,7 @@ export interface JDBCInfo {
export enum DatabaseServiceType {
Athena = 'Athena',
BigQuery = 'BigQuery',
Glue = 'Glue',
Hive = 'Hive',
Mssql = 'MSSQL',
MySQL = 'MySQL',

View File

@ -61,5 +61,6 @@ export interface Schedule {
*/
export enum PipelineServiceType {
Airflow = 'Airflow',
Glue = 'Glue',
Prefect = 'Prefect',
}

View File

@ -192,6 +192,10 @@ export interface EntityReference {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -203,13 +207,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -176,6 +176,10 @@ export interface EntityReference {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -187,13 +191,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -174,6 +174,10 @@ export enum LocationType {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -185,13 +189,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -162,6 +162,10 @@ export interface EntityReference {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -173,13 +177,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -20,9 +20,9 @@
* This schema defines the Model entity. Models are algorithms trained on data to find
* patterns or make predictions.
*/
export interface Model {
export interface Mlmodel {
/**
* Algorithm used to train the model.
* Algorithm used to train the MLModel.
*/
algorithm: string;
/**
@ -34,19 +34,19 @@ export interface Model {
*/
dashboard?: EntityReference;
/**
* Description of the model, what it is, and how to use it.
* Description of the MLModel, what it is, and how to use it.
*/
description?: string;
/**
* Display Name that identifies this model.
* Display Name that identifies this MLModel.
*/
displayName?: string;
/**
* Followers of this model.
* Followers of this MLModel.
*/
followers?: EntityReference[];
/**
* A unique name that identifies a model.
* A unique name that identifies a MLModel.
*/
fullyQualifiedName?: string;
/**
@ -54,7 +54,7 @@ export interface Model {
*/
href?: string;
/**
* Unique identifier of a model instance.
* Unique identifier of a MLModel instance.
*/
id: string;
/**
@ -66,15 +66,15 @@ export interface Model {
*/
mlHyperParameters?: MlHyperParameter[];
/**
* Name that identifies this model.
* Name that identifies this MLModel.
*/
name: string;
/**
* Owner of this model.
* Owner of this MLModel.
*/
owner?: EntityReference;
/**
* Tags for this model.
* Tags for this MLModel.
*/
tags?: TagLabel[];
/**
@ -86,7 +86,7 @@ export interface Model {
*/
updatedBy?: string;
/**
* Latest usage information for this model.
* Latest usage information for this MLModel.
*/
usageSummary?: TypeUsedToReturnUsageDetailsOfAnEntity;
/**
@ -141,9 +141,9 @@ export interface FieldChange {
* example, a table has an attribute called database of type EntityReference that captures
* the relationship of a table `belongs to a` database.
*
* Followers of this model.
* Followers of this MLModel.
*
* Owner of this model.
* Owner of this MLModel.
*/
export interface EntityReference {
/**
@ -175,7 +175,7 @@ export interface EntityReference {
}
/**
* This schema defines the type for a ML Feature used in a Model.
* This schema defines the type for a ML Feature used in a MLModel.
*/
export interface MlFeature {
/**
@ -252,6 +252,10 @@ export enum FeatureSourceDataType {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -263,13 +267,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**
@ -296,7 +300,7 @@ export enum State {
}
/**
* This schema defines the type for a ML HyperParameter used in a Model.
* This schema defines the type for a ML HyperParameter used in a MLModel.
*/
export interface MlHyperParameter {
/**
@ -314,7 +318,7 @@ export interface MlHyperParameter {
}
/**
* Latest usage information for this model.
* Latest usage information for this MLModel.
*
* This schema defines the type for usage details. Daily, weekly, and monthly aggregation of
* usage is computed along with the percentile rank based on the usage for a given day.

View File

@ -184,6 +184,10 @@ export interface EntityReference {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -195,13 +199,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -268,6 +268,10 @@ export enum Constraint {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -279,13 +283,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -222,6 +222,10 @@ export enum SchemaType {
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -233,13 +237,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**

View File

@ -143,6 +143,7 @@ export interface JDBCInfo {
export enum DatabaseServiceType {
Athena = 'Athena',
BigQuery = 'BigQuery',
Glue = 'Glue',
Hive = 'Hive',
Mssql = 'MSSQL',
MySQL = 'MySQL',

View File

@ -133,5 +133,6 @@ export interface Schedule {
*/
export enum PipelineServiceType {
Airflow = 'Airflow',
Glue = 'Glue',
Prefect = 'Prefect',
}

View File

@ -25,36 +25,93 @@
* be used to build apps and bots that respond to the change from activities.
*/
export interface ChangeEvent {
/**
* For `eventType` `entityUpdated` this field captures details about what fields were
* added/updated/deleted. For `eventType` `entityCreated` or `entityDeleted` this field is
* null.
*/
changeDescription?: ChangeDescription;
/**
* Current version of the entity after this change. Note that not all changes result in
* entity version change. When entity version is not changed, `previousVersion` is same as
* `currentVersion`
*/
currentVersion?: number;
/**
* Date and time when the change was made.
*/
dateTime: Date;
/**
* Entity that changed.
* For `eventType` `entityCreated`, this field captures JSON coded string of the entity
* using the schema corresponding to `entityType`
*/
entity: any;
entity?: any;
/**
* Identifier of entity that was modified by the operation.
*/
entityId: string;
/**
* Entity type that changed. Use the schema of this entity to process the entity attribute.
*/
entityType?: string;
entityType: string;
eventType: EventType;
/**
* API operation that was result of user activity resulted in the change.
* Version of the entity before this change. Note that not all changes result in entity
* version change. When entity version is not changed, `previousVersion` is same as
* `currentVersion`
*/
operation: any;
previousVersion?: number;
/**
* Name of the user whose activity resulted in the change.
*/
userName: string;
userName?: string;
}
/**
* For `eventType` `entityUpdated` this field captures details about what fields were
* added/updated/deleted. For `eventType` `entityCreated` or `entityDeleted` this field is
* null.
*
* Description of the change.
*/
export interface ChangeDescription {
/**
* Names of fields added during the version changes.
*/
fieldsAdded?: FieldChange[];
/**
* Fields deleted during the version changes with old value before deleted.
*/
fieldsDeleted?: FieldChange[];
/**
* Fields modified during the version changes with old and new values.
*/
fieldsUpdated?: FieldChange[];
previousVersion?: number;
}
export interface FieldChange {
/**
* Name of the entity field that changed
*/
name?: string;
/**
* New value of the field. Note that this is a JSON string and use the corresponding field
* type to deserialize it.
*/
newValue?: any;
/**
* Previous value of the field. Note that this is a JSON string and use the corresponding
* field type to deserialize it.
*/
oldValue?: any;
}
/**
* Type of event
*/
export enum EventType {
EntityCreated = 'ENTITY_CREATED',
EntityDeleted = 'ENTITY_DELETED',
EntityFollowed = 'ENTITY_FOLLOWED',
EntityUnfollowed = 'ENTITY_UNFOLLOWED',
EntityUpdated = 'ENTITY_UPDATED',
EntityCreated = 'entityCreated',
EntityDeleted = 'entityDeleted',
EntityUpdated = 'entityUpdated',
}

View File

@ -20,6 +20,10 @@
* This schema defines the type for labeling an entity with a Tag.
*/
export interface TagLabel {
/**
* Unique name of the tag category.
*/
description?: string;
/**
* Link to the tag resource.
*/
@ -31,13 +35,13 @@ export interface TagLabel {
* was propagated from upstream based on lineage. 'Automated' is used when a tool was used
* to determine the tag label.
*/
labelType?: LabelType;
labelType: LabelType;
/**
* 'Suggested' state is used when a tag label is suggested by users or tools. Owner of the
* entity must confirm the suggested labels before it is marked as 'Confirmed'.
*/
state?: State;
tagFQN?: string;
state: State;
tagFQN: string;
}
/**