open-metadata / OpenMetadata

OpenMetadata is a unified metadata platform for data discovery, data observability, and data governance powered by a central metadata repository, in-depth column level lineage, and seamless team collaboration.
https://open-metadata.org
Apache License 2.0
5.59k stars 1.05k forks source link

DashboardDataModel is not properly updated when sql changes #18656

Closed aballiet closed 2 days ago

aballiet commented 6 days ago

Affected module Does it impact the UI, backend or Ingestion Framework?

Backend

Describe the bug A clear and concise description of what the bug is.

When doing a patch to the server with

from_entity: Optional[DashboardDataModel] = self.metadata.get_by_name(
                entity=DashboardDataModel,
                fqn=f"{self.config.serviceName}.model.MY_MODEL_NAME",
)

to_entity: DashboardDataModel = deepcopy(from_entity)
to_entity.sql.root = "updated sql !"

self.metadata.patch(
     entity=DashboardDataModel,
     source=from_entity,
     destination=to_entity,
)

It does not update the entity in OMD. The response from patch contains same old sql value.

To Reproduce

Screenshots or steps to reproduce

Expected behavior A clear and concise description of what you expected to happen.

We expect the backend to update the entity in DB

Version:

Additional context Add any other context about the problem here.