diff --git a/ingestion/src/metadata/ingestion/ometa/mixins/patch_mixin.py b/ingestion/src/metadata/ingestion/ometa/mixins/patch_mixin.py index c217732de22..a99c47ca3aa 100644 --- a/ingestion/src/metadata/ingestion/ometa/mixins/patch_mixin.py +++ b/ingestion/src/metadata/ingestion/ometa/mixins/patch_mixin.py @@ -397,9 +397,9 @@ class OMetaPatchMixin(Generic[T]): # Don't change existing data without force if instance.owner and not force: - logger.error( + logger.warning( f"The entity with id [{model_str(entity_id)}] already has an owner." - " To overwrite it, set `force` to True." + " To overwrite it, set `overrideOwner` to True." ) return None diff --git a/ingestion/src/metadata/ingestion/source/dashboard/dashboard_service.py b/ingestion/src/metadata/ingestion/source/dashboard/dashboard_service.py index 31e5c64e3d3..ee2f53002ca 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/dashboard_service.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/dashboard_service.py @@ -30,6 +30,7 @@ from metadata.generated.schema.entity.services.dashboardService import ( DashboardConnection, DashboardService, ) +from metadata.generated.schema.entity.teams.user import User from metadata.generated.schema.metadataIngestion.dashboardServiceMetadataPipeline import ( DashboardServiceMetadataPipeline, ) @@ -112,6 +113,12 @@ class DashboardServiceTopology(ServiceTopology): processor="yield_dashboard", consumer=["dashboard_service"], ), + NodeStage( + type_=User, + context="owner", + processor="process_owner", + consumer=["dashboard_service"], + ), NodeStage( type_=AddLineageRequest, context="lineage", diff --git a/ingestion/src/metadata/ingestion/source/dashboard/domodashboard/metadata.py b/ingestion/src/metadata/ingestion/source/dashboard/domodashboard/metadata.py index 5c8569b5166..e5c1715e90e 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/domodashboard/metadata.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/domodashboard/metadata.py @@ -27,6 +27,7 @@ from metadata.generated.schema.api.data.createChart import CreateChartRequest from metadata.generated.schema.api.data.createDashboard import CreateDashboardRequest from metadata.generated.schema.api.lineage.addLineage import AddLineageRequest from metadata.generated.schema.entity.data.chart import Chart +from metadata.generated.schema.entity.data.dashboard import Dashboard from metadata.generated.schema.entity.services.connections.dashboard.domoDashboardConnection import ( DomoDashboardConnection, ) @@ -101,8 +102,8 @@ class DomodashboardSource(DashboardServiceSource): if owner_details.get("email"): user = self.metadata.get_user_by_email(owner_details["email"]) if user: - return EntityReference(id=user["id"], type="user") - logger.debug( + return EntityReference(id=user.id.__root__, type="user") + logger.warning( f"No user for found for email {owner_details['email']} in OMD" ) except Exception as exc: @@ -111,6 +112,18 @@ class DomodashboardSource(DashboardServiceSource): ) return None + def process_owner( + self, dashboard_details: DomoDashboardDetails + ) -> Optional[Dashboard]: + owner = self.get_owner_details(owners=dashboard_details.owners) + if owner and self.source_config.overrideOwner: + self.metadata.patch_owner( + entity=Dashboard, + entity_id=self.context.dashboard.id, + owner=owner, + force=True, + ) + def yield_dashboard( self, dashboard_details: DomoDashboardDetails ) -> Iterable[CreateDashboardRequest]: @@ -134,7 +147,6 @@ class DomodashboardSource(DashboardServiceSource): for chart in self.context.charts ], service=self.context.dashboard_service.fullyQualifiedName.__root__, - owner=self.get_owner_details(dashboard_details.owners), ) except KeyError as err: logger.warning( diff --git a/ingestion/src/metadata/ingestion/source/dashboard/looker/metadata.py b/ingestion/src/metadata/ingestion/source/dashboard/looker/metadata.py index 4294f3606b8..39320aca113 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/looker/metadata.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/looker/metadata.py @@ -159,7 +159,6 @@ class LookerSource(DashboardServiceSource): Returns: Optional[EntityReference] """ - try: if ( dashboard_details.user_id is not None @@ -183,6 +182,18 @@ class LookerSource(DashboardServiceSource): return self._owners_ref.get(dashboard_details.user_id) + def process_owner( + self, dashboard_details: LookerDashboard + ) -> Optional[MetadataDashboard]: + owner = self.get_owner_details(dashboard_details=dashboard_details) + if owner and self.source_config.overrideOwner: + self.metadata.patch_owner( + entity=MetadataDashboard, + entity_id=self.context.dashboard.id, + owner=owner, + force=True, + ) + def yield_dashboard( self, dashboard_details: LookerDashboard ) -> CreateDashboardRequest: @@ -205,7 +216,6 @@ class LookerSource(DashboardServiceSource): ], dashboardUrl=f"/dashboards/{dashboard_details.id}", service=self.context.dashboard_service.fullyQualifiedName.__root__, - owner=self.get_owner_details(dashboard_details), ) @staticmethod diff --git a/ingestion/src/metadata/ingestion/source/dashboard/superset/api_source.py b/ingestion/src/metadata/ingestion/source/dashboard/superset/api_source.py index 3520f4bbfa6..dfe5fc32484 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/superset/api_source.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/superset/api_source.py @@ -71,7 +71,6 @@ class SupersetAPISource(SupersetSourceMixin): displayName=dashboard_details["dashboard_title"], description="", dashboardUrl=dashboard_details["url"], - owner=self.get_owner_details(dashboard_details), charts=[ fqn.build( self.metadata, diff --git a/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py b/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py index b58575e2930..57cc131c67a 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py @@ -77,7 +77,6 @@ class SupersetDBSource(SupersetSourceMixin): displayName=dashboard_details["dashboard_title"], description="", dashboardUrl=f"/superset/dashboard/{dashboard_details['id']}/", - owner=self.get_owner_details(dashboard_details), charts=[ fqn.build( self.metadata, diff --git a/ingestion/src/metadata/ingestion/source/dashboard/superset/mixin.py b/ingestion/src/metadata/ingestion/source/dashboard/superset/mixin.py index e9c626d01d9..49e1242a637 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/superset/mixin.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/superset/mixin.py @@ -88,6 +88,16 @@ class SupersetSourceMixin(DashboardServiceSource): return None + def process_owner(self, dashboard_details: dict) -> Optional[Lineage_Dashboard]: + owner = self.get_owner_details(dashboard_details=dashboard_details) + if owner and self.source_config.overrideOwner: + self.metadata.patch_owner( + self.metadata, + entity=Lineage_Dashboard, + entity_id=self.context.dashboard.id, + force=True, + ) + def get_owner_details(self, dashboard_details: dict) -> EntityReference: for owner in dashboard_details.get("owners", []): user = self._get_user_by_email(owner["email"]) diff --git a/ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py b/ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py index 98e893cd1f9..6e04a514cd4 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py @@ -251,6 +251,18 @@ class TableauSource(DashboardServiceSource): return EntityReference(id=user.id.__root__, type="user") return None + def process_owner( + self, dashboard_details: TableauDashboard + ) -> Optional[LineageDashboard]: + owner = self.get_owner_details(dashboard_details=dashboard_details) + if owner and self.source_config.overrideOwner: + self.metadata.patch_owner( + entity=LineageDashboard, + entity_id=self.context.dashboard.id, + owner=owner, + force=True, + ) + def yield_tag(self, *_, **__) -> OMetaTagAndClassification: """ Fetch Dashboard Tags @@ -297,7 +309,6 @@ class TableauSource(DashboardServiceSource): name=dashboard_details.id, displayName=dashboard_details.name, description=dashboard_details.description, - owner=self.get_owner_details(dashboard_details), charts=[ fqn.build( self.metadata, diff --git a/ingestion/tests/unit/topology/dashboard/test_superset.py b/ingestion/tests/unit/topology/dashboard/test_superset.py index 1312fc070e4..68f69fb77b7 100644 --- a/ingestion/tests/unit/topology/dashboard/test_superset.py +++ b/ingestion/tests/unit/topology/dashboard/test_superset.py @@ -147,7 +147,6 @@ EXPECTED_DASH = CreateDashboardRequest( displayName="My DASH", description="", dashboardUrl="/superset/dashboard/14/", - owner=EXPECTED_USER, charts=[chart.fullyQualifiedName for chart in EXPECTED_CHATRT_ENTITY], service=EXPECTED_DASH_SERVICE.fullyQualifiedName, ) diff --git a/openmetadata-docs/content/connectors/dashboard/domo-dashboard/airflow.md b/openmetadata-docs/content/connectors/dashboard/domo-dashboard/airflow.md index 67e941b5ef2..b305d88fa1c 100644 --- a/openmetadata-docs/content/connectors/dashboard/domo-dashboard/airflow.md +++ b/openmetadata-docs/content/connectors/dashboard/domo-dashboard/airflow.md @@ -67,6 +67,7 @@ source: sourceConfig: config: type: DashboardMetadata + overrideOwner: True # dbServiceNames: # - service1 # - service2 @@ -108,6 +109,7 @@ The `sourceConfig` is defined [here](https://github.com/open-metadata/OpenMetada - `dbServiceNames`: Database Service Name for the creation of lineage, if the source supports it. - `dashboardFilterPattern` and `chartFilterPattern`: Note that the `dashboardFilterPattern` and `chartFilterPattern` both support regex as include or exclude. E.g., +- `overrideOwner`: Flag to override current owner by new owner from source, if found during metadata ingestion ```yaml dashboardFilterPattern: diff --git a/openmetadata-docs/content/connectors/dashboard/domo-dashboard/cli.md b/openmetadata-docs/content/connectors/dashboard/domo-dashboard/cli.md index b1bbe418a61..a839cac3827 100644 --- a/openmetadata-docs/content/connectors/dashboard/domo-dashboard/cli.md +++ b/openmetadata-docs/content/connectors/dashboard/domo-dashboard/cli.md @@ -67,6 +67,7 @@ source: sourceConfig: config: type: DashboardMetadata + overrideOwner: True # dbServiceNames: # - service1 # - service2 @@ -109,6 +110,7 @@ The `sourceConfig` is defined [here](https://github.com/open-metadata/OpenMetada - `dbServiceNames`: Database Service Name for the creation of lineage, if the source supports it. - `dashboardFilterPattern` and `chartFilterPattern`: Note that the `dashboardFilterPattern` and `chartFilterPattern` both support regex as include or exclude. E.g. +- `overrideOwner`: Flag to override current owner by new owner from source, if found during metadata ingestion ```yaml dashboardFilterPattern: diff --git a/openmetadata-docs/content/connectors/dashboard/domo-dashboard/index.md b/openmetadata-docs/content/connectors/dashboard/domo-dashboard/index.md index e0942cf2462..15d97d8b98c 100644 --- a/openmetadata-docs/content/connectors/dashboard/domo-dashboard/index.md +++ b/openmetadata-docs/content/connectors/dashboard/domo-dashboard/index.md @@ -163,6 +163,8 @@ Please follow the instructions below - **Include**: Explicitly include charts by adding a list of comma-separated regular expressions to the Include field. OpenMetadata will include all charts with names matching one or more of the supplied regular expressions. All other charts will be excluded. - **Exclude**: Explicitly exclude charts by adding a list of comma-separated regular expressions to the Exclude field. OpenMetadata will exclude all charts with names matching one or more of the supplied regular expressions. All other charts will be included. - **Database Service Name (Optional)**: Enter the name of Database Service which is already ingested in OpenMetadata to create lineage between dashboards and database tables. +- **Override Current Owner(toggle)**: Set the Override Current Owner toggle to override current owner with new owner, if that is fetched during metadata ingestion +For first time of metadata ingestion, kindly make sure to keep it enabled to get the owner. - **Enable Debug Log (toggle)**: Set the Enable Debug Log toggle to set the default log level to debug, these logs can be viewed later in Airflow. ### 7. Schedule the Ingestion and Deploy diff --git a/openmetadata-docs/content/connectors/dashboard/looker/airflow.md b/openmetadata-docs/content/connectors/dashboard/looker/airflow.md index 3c919b2bd77..08afe2f80f9 100644 --- a/openmetadata-docs/content/connectors/dashboard/looker/airflow.md +++ b/openmetadata-docs/content/connectors/dashboard/looker/airflow.md @@ -58,6 +58,7 @@ source: sourceConfig: config: type: DashboardMetadata + overrideOwner: True # dbServiceNames: # - service1 # - service2 @@ -98,6 +99,7 @@ The `sourceConfig` is defined [here](https://github.com/open-metadata/OpenMetada - `dbServiceNames`: Database Service Name for the creation of lineage, if the source supports it. - `dashboardFilterPattern` and `chartFilterPattern`: Note that the `dashboardFilterPattern` and `chartFilterPattern` both support regex as include or exclude. E.g., +- `overrideOwner`: Flag to override current owner by new owner from source, if found during metadata ingestion ```yaml dashboardFilterPattern: diff --git a/openmetadata-docs/content/connectors/dashboard/looker/cli.md b/openmetadata-docs/content/connectors/dashboard/looker/cli.md index 1cf394eda04..555ec266334 100644 --- a/openmetadata-docs/content/connectors/dashboard/looker/cli.md +++ b/openmetadata-docs/content/connectors/dashboard/looker/cli.md @@ -58,6 +58,7 @@ source: sourceConfig: config: type: DashboardMetadata + overrideOwner: True # dbServiceNames: # - service1 # - service2 @@ -98,6 +99,7 @@ The `sourceConfig` is defined [here](https://github.com/open-metadata/OpenMetada - `dbServiceNames`: Database Service Name for the creation of lineage, if the source supports it. - `dashboardFilterPattern` and `chartFilterPattern`: Note that the `dashboardFilterPattern` and `chartFilterPattern` both support regex as include or exclude. E.g., +- `overrideOwner`: Flag to override current owner by new owner from source, if found during metadata ingestion ```yaml dashboardFilterPattern: diff --git a/openmetadata-docs/content/connectors/dashboard/looker/index.md b/openmetadata-docs/content/connectors/dashboard/looker/index.md index 0e0c7a52800..b23145efa36 100644 --- a/openmetadata-docs/content/connectors/dashboard/looker/index.md +++ b/openmetadata-docs/content/connectors/dashboard/looker/index.md @@ -156,6 +156,8 @@ Please follow the instructions below - **Exclude**: Explicitly exclude charts by adding a list of comma-separated regular expressions to the Exclude field. OpenMetadata will exclude all charts with names matching one or more of the supplied regular expressions. All other charts will be included. - **Database Service Name (Optional)**: Enter the name of Database Service which is already ingested in OpenMetadata to create lineage between dashboards and database tables. - **Enable Debug Log (toggle)**: Set the Enable Debug Log toggle to set the default log level to debug, these logs can be viewed later in Airflow. +- **Override Current Owner(toggle)**: Set the Override Current Owner toggle to override current owner with new owner, if that is fetched during metadata ingestion +For first time of metadata ingestion, kindly make sure to keep it enabled to get the owner. ### 7. Schedule the Ingestion and Deploy diff --git a/openmetadata-docs/content/connectors/dashboard/superset/airflow.md b/openmetadata-docs/content/connectors/dashboard/superset/airflow.md index 6e452d00031..9420254bf67 100644 --- a/openmetadata-docs/content/connectors/dashboard/superset/airflow.md +++ b/openmetadata-docs/content/connectors/dashboard/superset/airflow.md @@ -89,6 +89,7 @@ source: sourceConfig: config: type: DashboardMetadata + overrideOwner: True # dbServiceNames: # - service1 # - service2 @@ -159,6 +160,7 @@ The `sourceConfig` is defined [here](https://github.com/open-metadata/OpenMetada - `dbServiceNames`: Database Service Name for the creation of lineage, if the source supports it. - `dashboardFilterPattern` and `chartFilterPattern`: Note that the `dashboardFilterPattern` and `chartFilterPattern` both support regex as include or exclude. E.g., +- `overrideOwner`: Flag to override current owner by new owner from source, if found during metadata ingestion ```yaml dashboardFilterPattern: diff --git a/openmetadata-docs/content/connectors/dashboard/superset/cli.md b/openmetadata-docs/content/connectors/dashboard/superset/cli.md index 101cf1f59a6..5a90d8f0819 100644 --- a/openmetadata-docs/content/connectors/dashboard/superset/cli.md +++ b/openmetadata-docs/content/connectors/dashboard/superset/cli.md @@ -89,6 +89,7 @@ source: sourceConfig: config: type: DashboardMetadata + overrideOwner: True # dbServiceNames: # - service1 # - service2 @@ -160,6 +161,7 @@ The `sourceConfig` is defined [here](https://github.com/open-metadata/OpenMetada - `dbServiceNames`: Database Service Name for the creation of lineage, if the source supports it. - `dashboardFilterPattern` and `chartFilterPattern`: Note that the `dashboardFilterPattern` and `chartFilterPattern` both support regex as include or exclude. E.g., +- `overrideOwner`: Flag to override current owner by new owner from source, if found during metadata ingestion ```yaml dashboardFilterPattern: diff --git a/openmetadata-docs/content/connectors/dashboard/superset/index.md b/openmetadata-docs/content/connectors/dashboard/superset/index.md index db013f482c7..b5b1bd23cc2 100644 --- a/openmetadata-docs/content/connectors/dashboard/superset/index.md +++ b/openmetadata-docs/content/connectors/dashboard/superset/index.md @@ -199,6 +199,8 @@ caption="Configure Metadata Ingestion Page" - **Exclude**: Explicitly exclude charts by adding a list of comma-separated regular expressions to the Exclude field. OpenMetadata will exclude all charts with names matching one or more of the supplied regular expressions. All other charts will be included. - **Database Service Name (Optional)**: Enter the name of Database Service which is already ingested in OpenMetadata to create lineage between dashboards and database tables. - **Enable Debug Log (toggle)**: Set the Enable Debug Log toggle to set the default log level to debug, these logs can be viewed later in Airflow. +- **Override Current Owner(toggle)**: Set the Override Current Owner toggle to override current owner with new owner, if that is fetched during metadata ingestion +For first time of metadata ingestion, kindly make sure to keep it enabled to get the owner. ### 7. Schedule the Ingestion and Deploy diff --git a/openmetadata-docs/content/connectors/dashboard/tableau/airflow.md b/openmetadata-docs/content/connectors/dashboard/tableau/airflow.md index dae6b73cf16..ddc36e5793c 100644 --- a/openmetadata-docs/content/connectors/dashboard/tableau/airflow.md +++ b/openmetadata-docs/content/connectors/dashboard/tableau/airflow.md @@ -180,6 +180,7 @@ source: sourceConfig: config: type: DashboardMetadata + overrideOwner: True # dbServiceNames: # - service1 # - service2 @@ -226,6 +227,7 @@ The `sourceConfig` is defined [here](https://github.com/open-metadata/OpenMetada - `dbServiceNames`: Database Service Name for the creation of lineage, if the source supports it. - `dashboardFilterPattern` and `chartFilterPattern`: Note that the `dashboardFilterPattern` and `chartFilterPattern` both support regex as include or exclude. E.g., +- `overrideOwner`: Flag to override current owner by new owner from source, if found during metadata ingestion ```yaml dashboardFilterPattern: diff --git a/openmetadata-docs/content/connectors/dashboard/tableau/cli.md b/openmetadata-docs/content/connectors/dashboard/tableau/cli.md index 5c3010f8b88..0aff9440af9 100644 --- a/openmetadata-docs/content/connectors/dashboard/tableau/cli.md +++ b/openmetadata-docs/content/connectors/dashboard/tableau/cli.md @@ -180,6 +180,7 @@ source: sourceConfig: config: type: DashboardMetadata + overrideOwner: True # dbServiceNames: # - service1 # - service2 @@ -225,6 +226,7 @@ The `sourceConfig` is defined [here](https://github.com/open-metadata/OpenMetada - `dbServiceNames`: Database Service Name for the creation of lineage, if the source supports it. - `dashboardFilterPattern` and `chartFilterPattern`: Note that the `dashboardFilterPattern` and `chartFilterPattern` both support regex as include or exclude. E.g., +- `overrideOwner`: Flag to override current owner by new owner from source, if found during metadata ingestion ```yaml dashboardFilterPattern: diff --git a/openmetadata-docs/content/connectors/dashboard/tableau/index.md b/openmetadata-docs/content/connectors/dashboard/tableau/index.md index f35e9b44d0d..b62cdb64466 100644 --- a/openmetadata-docs/content/connectors/dashboard/tableau/index.md +++ b/openmetadata-docs/content/connectors/dashboard/tableau/index.md @@ -189,6 +189,8 @@ caption="Configure Metadata Ingestion Page" - **Exclude**: Explicitly exclude charts by adding a list of comma-separated regular expressions to the Exclude field. OpenMetadata will exclude all charts with names matching one or more of the supplied regular expressions. All other charts will be included. - **Database Service Name (Optional)**: Enter the name of Database Service which is already ingested in OpenMetadata to create lineage between dashboards and database tables. - **Enable Debug Log (toggle)**: Set the Enable Debug Log toggle to set the default log level to debug, these logs can be viewed later in Airflow. +- **Override Current Owner(toggle)**: Set the Override Current Owner toggle to override current owner with new owner, if that is fetched during metadata ingestion +For first time of metadata ingestion, kindly make sure to keep it enabled to get the owner. ### 7. Schedule the Ingestion and Deploy diff --git a/openmetadata-docs/images/openmetadata/connectors/configure-metadata-ingestion-dashboard.png b/openmetadata-docs/images/openmetadata/connectors/configure-metadata-ingestion-dashboard.png index 76ab17b7f2b..58d0e0f4701 100644 Binary files a/openmetadata-docs/images/openmetadata/connectors/configure-metadata-ingestion-dashboard.png and b/openmetadata-docs/images/openmetadata/connectors/configure-metadata-ingestion-dashboard.png differ diff --git a/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/dashboardServiceMetadataPipeline.json b/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/dashboardServiceMetadataPipeline.json index 408cf1f5858..e12a770fa5b 100644 --- a/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/dashboardServiceMetadataPipeline.json +++ b/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/dashboardServiceMetadataPipeline.json @@ -29,6 +29,12 @@ "title": "Database Service Name List", "description": "List of Database Service Name for creation of lineage", "type": "array" + }, + "overrideOwner": { + "title": "Override Current Owner", + "description": "Enabling this flag will override current owner with new owner from the source,if that is fetched during metadata ingestion. Kindly make to keep it enabled, to get the owner, for first time metadata ingestion.", + "type": "boolean", + "default": "false" } }, "additionalProperties": false diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/AddIngestion.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/AddIngestion.component.tsx index 50cf0278c5f..85a859d8c76 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/AddIngestion.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/AddIngestion.component.tsx @@ -171,6 +171,7 @@ const AddIngestion = ({ : undefined, includeView: Boolean(sourceConfig?.includeViews), includeTags: Boolean(sourceConfig?.includeTags), + overrideOwner: Boolean(sourceConfig?.overrideOwner), includeLineage: Boolean(sourceConfig?.includeLineage ?? true), enableDebugLog: data?.loggerLevel === LogLevels.Debug, profileSample: sourceConfig?.profileSample, @@ -329,6 +330,7 @@ const AddIngestion = ({ tableFilterPattern, topicFilterPattern, useFqnFilter, + overrideOwner, } = state; switch (serviceCategory) { @@ -375,6 +377,7 @@ const AddIngestion = ({ showDashboardFilter ), dbServiceNames: databaseServiceNames, + overrideOwner, type: ConfigType.DashboardMetadata, }; } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/Steps/ConfigureIngestion.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/Steps/ConfigureIngestion.tsx index b07322465c1..c87c9a67417 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/Steps/ConfigureIngestion.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/Steps/ConfigureIngestion.tsx @@ -85,6 +85,7 @@ const ConfigureIngestion = ({ topicFilterPattern, useFqnFilter, processPii, + overrideOwner, } = useMemo( () => ({ chartFilterPattern: data.chartFilterPattern, @@ -122,6 +123,7 @@ const ConfigureIngestion = ({ topicFilterPattern: data.topicFilterPattern, useFqnFilter: data.useFqnFilter, processPii: data.processPii, + overrideOwner: data.overrideOwner, }), [data] ); @@ -166,6 +168,8 @@ const ConfigureIngestion = ({ const handleEnableDebugLogCheck = () => toggleField('enableDebugLog'); + const handleOverrideOwner = () => toggleField('overrideOwner'); + const handleIncludeLineage = () => toggleField('includeLineage'); const handleIncludeTags = () => toggleField('includeTags'); @@ -232,6 +236,25 @@ const ConfigureIngestion = ({ ); }; + const getOverrideOwnerToggle = () => { + return ( + +
+ + +
+

+ {t('message.enable-override-owner')} +

+ {getSeparator('')} +
+ ); + }; + const getProfileSample = () => { return ( <> @@ -582,6 +605,7 @@ const ConfigureIngestion = ({ {getSeparator('')} {getDashboardDBServiceName()} {getDebugLogToggle()} + {getOverrideOwnerToggle()} ); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/addIngestion.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/addIngestion.interface.ts index aed1ee67177..1717f012bf5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/addIngestion.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/addIngestion.interface.ts @@ -134,6 +134,7 @@ export interface AddIngestionState { topicFilterPattern: FilterPattern; useFqnFilter: boolean; processPii: boolean; + overrideOwner: boolean; } export enum ShowFilter { diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json index 6fff494c808..3876dcb4696 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json @@ -502,6 +502,7 @@ "option": "Option", "or-lowercase": "or", "org-url": "OrgUrl", + "override-current-owner": "Override Current Owner", "owned-lowercase": "owned", "owner": "Owner", "owner-lowercase": "owner", @@ -915,6 +916,7 @@ "email-verification-token-expired": "Email Verification Token Expired", "enable-column-profile": "Enable column profile", "enable-debug-logging": "Enable debug logging", + "enable-override-owner": "Enabling this flag will override current owner with new owner ,if that is fetched during metadata ingestion. Kindly make to keep it enabled for first time metadata ingestion to get the owner.", "enables-end-to-end-metadata-management": "Enables end-to-end metadata management with data discovery, data quality, observability, and people collaboration", "endpoint-should-be-valid": "Endpoint should be valid URL.", "ensure-airflow-set-up-correctly-before-heading-to-ingest-metadata": "Ensure that you have Airflow set up correctly before heading to ingest metadata.",