From 057742c6fddb3742c84994027f4000ec705214b7 Mon Sep 17 00:00:00 2001 From: Suman Maharana Date: Wed, 25 Jun 2025 02:26:22 +0530 Subject: [PATCH 1/3] Added project to datamodel (#21926) --- .../metadata/ingestion/source/dashboard/tableau/client.py | 8 ++++---- .../ingestion/source/dashboard/tableau/metadata.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/dashboard/tableau/client.py b/ingestion/src/metadata/ingestion/source/dashboard/tableau/client.py index 56b51efb02a..05924946a83 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/tableau/client.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/tableau/client.py @@ -110,7 +110,7 @@ class TableauClient: owner = self.tableau_server.users.get_by_id(owner_id) if owner_id else None if owner and owner.email: owner_obj = TableauOwner( - id=owner.id, name=owner.name, email=owner.email + id=str(owner.id), name=owner.name, email=owner.email ) self.owner_cache[owner_id] = owner_obj return owner_obj @@ -130,7 +130,7 @@ class TableauClient: try: charts.append( TableauChart( - id=view.id, + id=str(view.id), name=view.name, tags=view.tags, owner=self.get_tableau_owner(view.owner_id), @@ -212,10 +212,10 @@ class TableauClient: workbook.views ) workbook = TableauDashboard( - id=workbook.id, + id=str(workbook.id), name=workbook.name, project=TableauBaseModel( - id=workbook.project_id, name=workbook.project_name + id=str(workbook.project_id), name=workbook.project_name ), owner=self.get_tableau_owner(workbook.owner_id), description=workbook.description, diff --git a/ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py b/ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py index d34b7f01953..2f7f3d38386 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py @@ -253,6 +253,7 @@ class TableauSource(DashboardServiceSource): ), sql=self._get_datamodel_sql_query(data_model=data_model), owners=self.get_owner_ref(dashboard_details=dashboard_details), + project=self.get_project_name(dashboard_details=dashboard_details), ) yield Either(right=data_model_request) self.register_record_datamodel(datamodel_request=data_model_request) From 9c6bd9f2b9057cf9a917e13060692361ca6269cf Mon Sep 17 00:00:00 2001 From: SumanMaharana Date: Wed, 25 Jun 2025 02:31:33 +0530 Subject: [PATCH 2/3] Added project to datamodel --- .../ingestion/source/dashboard/tableau/models.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/dashboard/tableau/models.py b/ingestion/src/metadata/ingestion/source/dashboard/tableau/models.py index 5957540f791..731f2eccda9 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/tableau/models.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/tableau/models.py @@ -13,6 +13,7 @@ Tableau Source Model module """ +import uuid from typing import Dict, List, Optional, Set, Union from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -28,9 +29,18 @@ class TableauBaseModel(BaseModel): model_config = ConfigDict(extra="allow") - id: str + # in case of personal space workbooks, the project id is returned as a UUID + id: Union[str, uuid.UUID] name: Optional[str] = None + # pylint: disable=no-self-argument + @field_validator("id", mode="before") + def coerce_uuid_to_string(cls, value): + """Ensure id is always stored as a string internally""" + if isinstance(value, uuid.UUID): + return str(value) + return value + def __hash__(self): return hash(self.id) @@ -187,7 +197,7 @@ class TableauDashboard(TableauBaseModel): tags: Optional[Set] = [] webpageUrl: Optional[str] = None charts: Optional[List[TableauChart]] = None - dataModels: List[DataSource] = [] + dataModels: Optional[List[DataSource]] = [] custom_sql_queries: Optional[List[str]] = None user_views: Optional[int] = None From fa53524fd1aece95975d855bcd6d6c8f36f4de86 Mon Sep 17 00:00:00 2001 From: SumanMaharana Date: Wed, 25 Jun 2025 10:38:36 +0530 Subject: [PATCH 3/3] bump ingestion version 1.7.5.1 --- ingestion/Dockerfile | 2 +- ingestion/operators/docker/Dockerfile | 2 +- ingestion/pyproject.toml | 2 +- openmetadata-airflow-apis/pyproject.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ingestion/Dockerfile b/ingestion/Dockerfile index 310a1e861b7..d29622b188f 100644 --- a/ingestion/Dockerfile +++ b/ingestion/Dockerfile @@ -78,7 +78,7 @@ ARG INGESTION_DEPENDENCY="all" ENV PIP_NO_CACHE_DIR=1 # Make pip silent ENV PIP_QUIET=1 -ARG RI_VERSION="1.7.5.0" +ARG RI_VERSION="1.7.5.1" RUN pip install --upgrade pip RUN pip install "openmetadata-managed-apis~=${RI_VERSION}" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.10.5/constraints-3.10.txt" RUN pip install "openmetadata-ingestion[${INGESTION_DEPENDENCY}]~=${RI_VERSION}" diff --git a/ingestion/operators/docker/Dockerfile b/ingestion/operators/docker/Dockerfile index f865c0eeea3..a5732a0a597 100644 --- a/ingestion/operators/docker/Dockerfile +++ b/ingestion/operators/docker/Dockerfile @@ -84,7 +84,7 @@ ENV PIP_QUIET=1 RUN pip install --upgrade pip ARG INGESTION_DEPENDENCY="all" -ARG RI_VERSION="1.7.5.0" +ARG RI_VERSION="1.7.5.1" RUN pip install --upgrade pip RUN pip install "openmetadata-ingestion[airflow]~=${RI_VERSION}" RUN pip install "openmetadata-ingestion[${INGESTION_DEPENDENCY}]~=${RI_VERSION}" diff --git a/ingestion/pyproject.toml b/ingestion/pyproject.toml index 9087e32251e..dbd4d66b3c3 100644 --- a/ingestion/pyproject.toml +++ b/ingestion/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" # since it helps us organize and isolate version management [project] name = "openmetadata-ingestion" -version = "1.7.5.0" +version = "1.7.5.1" dynamic = ["readme", "dependencies", "optional-dependencies"] authors = [ { name = "OpenMetadata Committers" } diff --git a/openmetadata-airflow-apis/pyproject.toml b/openmetadata-airflow-apis/pyproject.toml index 485bc36805b..a0c82cfa689 100644 --- a/openmetadata-airflow-apis/pyproject.toml +++ b/openmetadata-airflow-apis/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" # since it helps us organize and isolate version management [project] name = "openmetadata_managed_apis" -version = "1.7.5.0" +version = "1.7.5.1" readme = "README.md" authors = [ {name = "OpenMetadata Committers"}