mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-02 03:29:03 +00:00
Fix #660 Return fully qualified name in EntityReference for all the data assets
This commit is contained in:
parent
9c5df8df7c
commit
ce3fbe17ec
@ -468,27 +468,27 @@ public final class EntityUtil {
|
||||
|
||||
public static EntityReference getEntityReference(Database database) {
|
||||
return new EntityReference().withDescription(database.getDescription()).withId(database.getId())
|
||||
.withName(database.getName()).withType(Entity.DATABASE);
|
||||
.withName(database.getFullyQualifiedName()).withType(Entity.DATABASE);
|
||||
}
|
||||
|
||||
public static EntityReference getEntityReference(Table table) {
|
||||
return new EntityReference().withDescription(table.getDescription()).withId(table.getId())
|
||||
.withName(table.getName()).withType(Entity.TABLE);
|
||||
.withName(table.getFullyQualifiedName()).withType(Entity.TABLE);
|
||||
}
|
||||
|
||||
public static EntityReference getEntityReference(Report report) {
|
||||
return new EntityReference().withDescription(report.getDescription()).withId(report.getId())
|
||||
.withName(report.getName()).withType(Entity.REPORT);
|
||||
.withName(report.getFullyQualifiedName()).withType(Entity.REPORT);
|
||||
}
|
||||
|
||||
public static EntityReference getEntityReference(Metrics metrics) {
|
||||
return new EntityReference().withDescription(metrics.getDescription()).withId(metrics.getId())
|
||||
.withName(metrics.getName()).withType(Entity.METRICS);
|
||||
.withName(metrics.getFullyQualifiedName()).withType(Entity.METRICS);
|
||||
}
|
||||
|
||||
public static EntityReference getEntityReference(Dashboard dashboard) {
|
||||
return new EntityReference().withDescription(dashboard.getDescription()).withId(dashboard.getId())
|
||||
.withName(dashboard.getName()).withType(Entity.DASHBOARD);
|
||||
.withName(dashboard.getFullyQualifiedName()).withType(Entity.DASHBOARD);
|
||||
}
|
||||
|
||||
public static EntityReference getEntityReference(Team team) {
|
||||
|
||||
@ -870,7 +870,7 @@ public class TableResourceTest extends CatalogApplicationTest {
|
||||
assertEquals(table.getOwner().getId(), USER_OWNER1.getId());
|
||||
assertEquals(table.getOwner().getType(), USER_OWNER1.getType());
|
||||
assertEquals(table.getDatabase().getId(), DATABASE.getId());
|
||||
assertEquals(table.getDatabase().getName(), DATABASE.getName());
|
||||
assertEquals(table.getDatabase().getName(), DATABASE.getFullyQualifiedName());
|
||||
}
|
||||
|
||||
// List tables with databaseFQN as filter
|
||||
@ -1198,7 +1198,7 @@ public class TableResourceTest extends CatalogApplicationTest {
|
||||
assertEquals(table.getOwner().getId(), USER_OWNER1.getId());
|
||||
assertEquals(table.getOwner().getType(), USER_OWNER1.getType());
|
||||
assertEquals(table.getDatabase().getId(), DATABASE.getId());
|
||||
assertEquals(table.getDatabase().getName(), DATABASE.getName());
|
||||
assertEquals(table.getDatabase().getName(), DATABASE.getFullyQualifiedName());
|
||||
}
|
||||
|
||||
public static Table createTable(CreateTable create, Map<String, String> authHeaders) throws HttpResponseException {
|
||||
|
||||
@ -194,8 +194,8 @@ public final class TestUtils {
|
||||
assertNotNull(ref.getType());
|
||||
// Ensure data entities use fully qualified name
|
||||
if (List.of("table", "database", "metrics", "dashboard", "pipeline", "report", "topic", "chart")
|
||||
.contains(ref.getName())) {
|
||||
ref.getName().contains("."); // FullyQualifiedName has "." as separator
|
||||
.contains(ref.getType())) {
|
||||
assertTrue(ref.getName().contains(".")); // FullyQualifiedName has "." as separator
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user