diff --git a/bootstrap/sql/com.mysql.cj.jdbc.Driver/v014__create_db_connection_info.sql b/bootstrap/sql/com.mysql.cj.jdbc.Driver/v014__create_db_connection_info.sql index 6d1c11afe10..ed552b96e01 100644 --- a/bootstrap/sql/com.mysql.cj.jdbc.Driver/v014__create_db_connection_info.sql +++ b/bootstrap/sql/com.mysql.cj.jdbc.Driver/v014__create_db_connection_info.sql @@ -25,3 +25,7 @@ CREATE TABLE IF NOT EXISTS data_product_entity ( UPDATE dbservice_entity SET json = JSON_REPLACE(json, '$.connection.config.scheme', 'hive') WHERE JSON_EXTRACT(json, '$.connection.config.scheme') IN ('impala', 'impala4'); + +-- remove the dataModel references from Data Models +UPDATE dashboard_data_model_entity +SET json = JSON_REMOVE(json, '$.dataModels'); diff --git a/bootstrap/sql/org.postgresql.Driver/v014__create_db_connection_info.sql b/bootstrap/sql/org.postgresql.Driver/v014__create_db_connection_info.sql index 2ac26988622..e8bf45c660c 100644 --- a/bootstrap/sql/org.postgresql.Driver/v014__create_db_connection_info.sql +++ b/bootstrap/sql/org.postgresql.Driver/v014__create_db_connection_info.sql @@ -25,3 +25,6 @@ CREATE TABLE IF NOT EXISTS data_product_entity ( update dbservice_entity set json = jsonb_set(json::jsonb, '{connection,config,scheme}', '"hive"') where json#>>'{connection,config,scheme}' in ('impala', 'impala4'); + +-- remove the dataModel references from Data Models +UPDATE dashboard_data_model_entity SET json = json #- '{dataModels}'; diff --git a/ingestion/src/metadata/ingestion/source/dashboard/tableau/models.py b/ingestion/src/metadata/ingestion/source/dashboard/tableau/models.py index ee0f82b58f9..32f514d964a 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/tableau/models.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/tableau/models.py @@ -103,7 +103,7 @@ class DatasourceField(BaseModel): class Workbook(BaseModel): id: str luid: str - name: str + name: Optional[str] class UpstreamTableColumn(BaseModel): diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/DashboardDataModelRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/DashboardDataModelRepository.java index a53871fc64c..6006549e2fe 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/DashboardDataModelRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/DashboardDataModelRepository.java @@ -19,7 +19,6 @@ import static org.openmetadata.service.Entity.FIELD_TAGS; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; -import java.util.Collections; import java.util.List; import javax.json.JsonPatch; import lombok.SneakyThrows; @@ -45,8 +44,6 @@ import org.openmetadata.service.util.JsonUtils; @Slf4j public class DashboardDataModelRepository extends EntityRepository { - private static final String DATA_MODELS_FIELD = "dataModels"; - private static final String DATA_MODEL_UPDATE_FIELDS = "owner,tags,followers"; private static final String DATA_MODEL_PATCH_FIELDS = "owner,tags,followers"; @@ -116,16 +113,15 @@ public class DashboardDataModelRepository extends EntityRepository tags = dashboardDataModel.getTags(); - List dataModels = dashboardDataModel.getDataModels(); EntityReference service = dashboardDataModel.getService(); // Don't store owner, database, href and tags as JSON. Build it on the fly based on relationships - dashboardDataModel.withOwner(null).withService(null).withHref(null).withTags(null).withDataModels(null); + dashboardDataModel.withOwner(null).withService(null).withHref(null).withTags(null); store(dashboardDataModel, update); // Restore the relationships - dashboardDataModel.withOwner(owner).withService(service).withTags(tags).withDataModels(dataModels); + dashboardDataModel.withOwner(owner).withService(service).withTags(tags); } @Override @@ -146,8 +142,7 @@ public class DashboardDataModelRepository extends EntityRepository getDataModels(DashboardDataModel dashboardDataModel) throws IOException { - if (dashboardDataModel == null) { - return Collections.emptyList(); - } - List tableIds = - findTo(dashboardDataModel.getId(), entityType, Relationship.USES, Entity.DASHBOARD_DATA_MODEL); - return EntityUtil.populateEntityReferences(tableIds, Entity.TABLE); - } - private void getColumnTags(boolean setTags, List columns) { for (Column c : listOrEmpty(columns)) { c.setTags(setTags ? getTags(c.getFullyQualifiedName()) : null); diff --git a/openmetadata-spec/src/main/resources/json/schema/entity/data/dashboardDataModel.json b/openmetadata-spec/src/main/resources/json/schema/entity/data/dashboardDataModel.json index 595dc903276..fc5debc8990 100644 --- a/openmetadata-spec/src/main/resources/json/schema/entity/data/dashboardDataModel.json +++ b/openmetadata-spec/src/main/resources/json/schema/entity/data/dashboardDataModel.json @@ -130,10 +130,6 @@ }, "default": null }, - "dataModels": { - "description": "List of data models used by this data model.", - "$ref": "../../type/entityReferenceList.json#/definitions/entityReferenceList" - }, "project": { "description": "Name of the project / workspace / collection in which the dataModel is contained", "type": "string"