mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-02 21:53:30 +00:00
Added Include Tags in Ingestion UI (#5694)
* Added Include Tags in Ingestion UI * Fix ConfigureIngestionProps * Test Fix * Fix Cypress
This commit is contained in:
parent
3158cfee99
commit
dc5dfae3b8
@ -122,6 +122,8 @@ class BigquerySource(CommonDbSourceService):
|
|||||||
:param _:
|
:param _:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
if not self.source_config.includeTags:
|
||||||
|
return
|
||||||
taxonomies = PolicyTagManagerClient().list_taxonomies(
|
taxonomies = PolicyTagManagerClient().list_taxonomies(
|
||||||
parent=f"projects/{self.project_id}/locations/{self.service_connection.taxonomyLocation}"
|
parent=f"projects/{self.project_id}/locations/{self.service_connection.taxonomyLocation}"
|
||||||
)
|
)
|
||||||
@ -155,6 +157,8 @@ class BigquerySource(CommonDbSourceService):
|
|||||||
This will only get executed if the tags context
|
This will only get executed if the tags context
|
||||||
is properly informed
|
is properly informed
|
||||||
"""
|
"""
|
||||||
|
if not self.source_config.includeTags:
|
||||||
|
return
|
||||||
if column.get("policy_tags"):
|
if column.get("policy_tags"):
|
||||||
return [
|
return [
|
||||||
TagLabel(
|
TagLabel(
|
||||||
|
@ -161,6 +161,9 @@ const AddIngestion = ({
|
|||||||
const [includeView, setIncludeView] = useState(
|
const [includeView, setIncludeView] = useState(
|
||||||
Boolean((data?.sourceConfig.config as ConfigClass)?.includeViews)
|
Boolean((data?.sourceConfig.config as ConfigClass)?.includeViews)
|
||||||
);
|
);
|
||||||
|
const [includeTag, setIncludeTags] = useState(
|
||||||
|
Boolean((data?.sourceConfig.config as ConfigClass)?.includeTags)
|
||||||
|
);
|
||||||
const [includeLineage, setIncludeLineage] = useState(
|
const [includeLineage, setIncludeLineage] = useState(
|
||||||
Boolean((data?.sourceConfig.config as ConfigClass)?.includeLineage ?? true)
|
Boolean((data?.sourceConfig.config as ConfigClass)?.includeLineage ?? true)
|
||||||
);
|
);
|
||||||
@ -391,6 +394,7 @@ const AddIngestion = ({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
includeViews: includeView,
|
includeViews: includeView,
|
||||||
|
includeTags: includeTag,
|
||||||
databaseFilterPattern: getFilterPatternData(
|
databaseFilterPattern: getFilterPatternData(
|
||||||
databaseFilterPattern,
|
databaseFilterPattern,
|
||||||
showDatabaseFilter
|
showDatabaseFilter
|
||||||
@ -618,6 +622,7 @@ const AddIngestion = ({
|
|||||||
handleDescription={(val) => setDescription(val)}
|
handleDescription={(val) => setDescription(val)}
|
||||||
handleEnableDebugLog={() => setEnableDebugLog((pre) => !pre)}
|
handleEnableDebugLog={() => setEnableDebugLog((pre) => !pre)}
|
||||||
handleIncludeLineage={() => setIncludeLineage((pre) => !pre)}
|
handleIncludeLineage={() => setIncludeLineage((pre) => !pre)}
|
||||||
|
handleIncludeTags={() => setIncludeTags((pre) => !pre)}
|
||||||
handleIncludeView={() => setIncludeView((pre) => !pre)}
|
handleIncludeView={() => setIncludeView((pre) => !pre)}
|
||||||
handleIngestSampleData={() => setIngestSampleData((pre) => !pre)}
|
handleIngestSampleData={() => setIngestSampleData((pre) => !pre)}
|
||||||
handleIngestionName={(val) => setIngestionName(val)}
|
handleIngestionName={(val) => setIngestionName(val)}
|
||||||
@ -627,6 +632,7 @@ const AddIngestion = ({
|
|||||||
handleShowFilter={handleShowFilter}
|
handleShowFilter={handleShowFilter}
|
||||||
handleStageFileLocation={(val) => setStageFileLocation(val)}
|
handleStageFileLocation={(val) => setStageFileLocation(val)}
|
||||||
includeLineage={includeLineage}
|
includeLineage={includeLineage}
|
||||||
|
includeTags={includeTag}
|
||||||
includeView={includeView}
|
includeView={includeView}
|
||||||
ingestSampleData={ingestSampleData}
|
ingestSampleData={ingestSampleData}
|
||||||
ingestionName={ingestionName}
|
ingestionName={ingestionName}
|
||||||
|
@ -64,6 +64,7 @@ const mockConfigureIngestion: ConfigureIngestionProps = {
|
|||||||
},
|
},
|
||||||
includeLineage: false,
|
includeLineage: false,
|
||||||
includeView: false,
|
includeView: false,
|
||||||
|
includeTags: false,
|
||||||
pipelineType: PipelineType.Metadata,
|
pipelineType: PipelineType.Metadata,
|
||||||
queryLogDuration: 1,
|
queryLogDuration: 1,
|
||||||
resultLimit: 100,
|
resultLimit: 100,
|
||||||
@ -79,6 +80,7 @@ const mockConfigureIngestion: ConfigureIngestionProps = {
|
|||||||
showFqnFilter: false,
|
showFqnFilter: false,
|
||||||
handleIncludeLineage: jest.fn(),
|
handleIncludeLineage: jest.fn(),
|
||||||
handleIncludeView: jest.fn(),
|
handleIncludeView: jest.fn(),
|
||||||
|
handleIncludeTags: jest.fn(),
|
||||||
handleIngestionName: jest.fn(),
|
handleIngestionName: jest.fn(),
|
||||||
handleMarkDeletedTables: jest.fn(),
|
handleMarkDeletedTables: jest.fn(),
|
||||||
handleQueryLogDuration: jest.fn(),
|
handleQueryLogDuration: jest.fn(),
|
||||||
@ -124,6 +126,6 @@ describe('Test ConfigureIngestion component', () => {
|
|||||||
expect(backButton).toBeInTheDocument();
|
expect(backButton).toBeInTheDocument();
|
||||||
expect(nextButton).toBeInTheDocument();
|
expect(nextButton).toBeInTheDocument();
|
||||||
expect(filterPatternComponents.length).toBe(3);
|
expect(filterPatternComponents.length).toBe(3);
|
||||||
expect(toggleSwitchs.length).toBe(3);
|
expect(toggleSwitchs.length).toBe(4);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -39,6 +39,7 @@ const ConfigureIngestion = ({
|
|||||||
fqnFilterPattern,
|
fqnFilterPattern,
|
||||||
includeLineage,
|
includeLineage,
|
||||||
includeView,
|
includeView,
|
||||||
|
includeTags,
|
||||||
markDeletedTables,
|
markDeletedTables,
|
||||||
serviceCategory,
|
serviceCategory,
|
||||||
pipelineType,
|
pipelineType,
|
||||||
@ -63,6 +64,7 @@ const ConfigureIngestion = ({
|
|||||||
handleShowFilter,
|
handleShowFilter,
|
||||||
handleIncludeLineage,
|
handleIncludeLineage,
|
||||||
handleIncludeView,
|
handleIncludeView,
|
||||||
|
handleIncludeTags,
|
||||||
handleMarkDeletedTables,
|
handleMarkDeletedTables,
|
||||||
handleIngestSampleData,
|
handleIngestSampleData,
|
||||||
handleDatasetServiceName,
|
handleDatasetServiceName,
|
||||||
@ -128,6 +130,20 @@ const ConfigureIngestion = ({
|
|||||||
</p>
|
</p>
|
||||||
{getSeparator('')}
|
{getSeparator('')}
|
||||||
</Field>
|
</Field>
|
||||||
|
<Field>
|
||||||
|
<div className="tw-flex tw-gap-1">
|
||||||
|
<label>Include tags</label>
|
||||||
|
<ToggleSwitchV1
|
||||||
|
checked={includeTags}
|
||||||
|
handleCheck={handleIncludeTags}
|
||||||
|
testId="include-tags"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<p className="tw-text-grey-muted tw-mt-3">
|
||||||
|
Enable extracting tags from the data source
|
||||||
|
</p>
|
||||||
|
{getSeparator('')}
|
||||||
|
</Field>
|
||||||
{getDebugLogToggle()}
|
{getDebugLogToggle()}
|
||||||
{!isNil(markDeletedTables) && (
|
{!isNil(markDeletedTables) && (
|
||||||
<Field>
|
<Field>
|
||||||
|
@ -69,6 +69,7 @@ export interface ConfigureIngestionProps {
|
|||||||
fqnFilterPattern: FilterPattern;
|
fqnFilterPattern: FilterPattern;
|
||||||
includeLineage: boolean;
|
includeLineage: boolean;
|
||||||
includeView: boolean;
|
includeView: boolean;
|
||||||
|
includeTags: boolean;
|
||||||
markDeletedTables?: boolean;
|
markDeletedTables?: boolean;
|
||||||
enableDebugLog: boolean;
|
enableDebugLog: boolean;
|
||||||
ingestSampleData: boolean;
|
ingestSampleData: boolean;
|
||||||
@ -89,6 +90,7 @@ export interface ConfigureIngestionProps {
|
|||||||
handleDescription?: (value: string) => void;
|
handleDescription?: (value: string) => void;
|
||||||
handleIncludeLineage: () => void;
|
handleIncludeLineage: () => void;
|
||||||
handleIncludeView: () => void;
|
handleIncludeView: () => void;
|
||||||
|
handleIncludeTags: () => void;
|
||||||
handleMarkDeletedTables?: () => void;
|
handleMarkDeletedTables?: () => void;
|
||||||
handleEnableDebugLog: () => void;
|
handleEnableDebugLog: () => void;
|
||||||
handleIngestSampleData: () => void;
|
handleIngestSampleData: () => void;
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
import { cloneDeep } from 'lodash';
|
import { cloneDeep } from 'lodash';
|
||||||
import { COMMON_UI_SCHEMA } from '../constants/services.const';
|
import { COMMON_UI_SCHEMA } from '../constants/services.const';
|
||||||
import { PipelineServiceType } from '../generated/entity/services/pipelineService';
|
import { PipelineServiceType } from '../generated/entity/services/pipelineService';
|
||||||
|
import airbyteConnection from '../jsons/connectionSchemas/connections/pipeline/airbyteConnection.json';
|
||||||
import airflowConnection from '../jsons/connectionSchemas/connections/pipeline/airflowConnection.json';
|
import airflowConnection from '../jsons/connectionSchemas/connections/pipeline/airflowConnection.json';
|
||||||
import glueConnection from '../jsons/connectionSchemas/connections/pipeline/glueConnection.json';
|
import glueConnection from '../jsons/connectionSchemas/connections/pipeline/glueConnection.json';
|
||||||
|
|
||||||
@ -21,6 +22,12 @@ export const getPipelineConfig = (type: PipelineServiceType) => {
|
|||||||
let schema = {};
|
let schema = {};
|
||||||
const uiSchema = { ...COMMON_UI_SCHEMA };
|
const uiSchema = { ...COMMON_UI_SCHEMA };
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case PipelineServiceType.Airbyte: {
|
||||||
|
schema = airbyteConnection;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PipelineServiceType.Airflow: {
|
case PipelineServiceType.Airflow: {
|
||||||
schema = airflowConnection;
|
schema = airflowConnection;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user