mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-27 00:31:42 +00:00
fix: conditioned call to getColumnTags to columns fields (#13652)
This commit is contained in:
parent
096a08ce57
commit
feb52647d2
@ -367,7 +367,7 @@ class OMetaPatchMixin(OMetaPatchMixinBase):
|
||||
Updated Entity
|
||||
"""
|
||||
instance: Optional[Table] = self._fetch_entity_if_exists(
|
||||
entity=Table, entity_id=table.id, fields=["tags"]
|
||||
entity=Table, entity_id=table.id, fields=["tags", "columns"]
|
||||
)
|
||||
|
||||
if not instance:
|
||||
|
||||
@ -88,9 +88,9 @@ import org.openmetadata.service.util.ResultList;
|
||||
public class TableRepository extends EntityRepository<Table> {
|
||||
|
||||
// Table fields that can be patched in a PATCH request
|
||||
static final String PATCH_FIELDS = "tableConstraints,tablePartition";
|
||||
static final String PATCH_FIELDS = "tableConstraints,tablePartition,columns";
|
||||
// Table fields that can be updated in a PUT request
|
||||
static final String UPDATE_FIELDS = "tableConstraints,tablePartition,dataModel,sourceUrl";
|
||||
static final String UPDATE_FIELDS = "tableConstraints,tablePartition,dataModel,sourceUrl,columns";
|
||||
|
||||
public static final String FIELD_RELATION_COLUMN_TYPE = "table.columns.column";
|
||||
public static final String FIELD_RELATION_TABLE_TYPE = "table";
|
||||
@ -126,7 +126,10 @@ public class TableRepository extends EntityRepository<Table> {
|
||||
? EntityUtil.getLatestUsage(daoCollection.usageDAO(), table.getId())
|
||||
: table.getUsageSummary());
|
||||
}
|
||||
getColumnTags(fields.contains(FIELD_TAGS), table.getColumns());
|
||||
if (fields.contains(COLUMN_FIELD)) {
|
||||
// We'll get column tags only if we are getting the column fields
|
||||
getColumnTags(fields.contains(FIELD_TAGS), table.getColumns());
|
||||
}
|
||||
table.setJoins(fields.contains("joins") ? getJoins(table) : table.getJoins());
|
||||
table.setTableProfilerConfig(
|
||||
fields.contains(TABLE_PROFILER_CONFIG) ? getTableProfilerConfig(table) : table.getTableProfilerConfig());
|
||||
|
||||
@ -84,7 +84,7 @@ import org.openmetadata.service.util.ResultList;
|
||||
public class TableResource extends EntityResource<Table, TableRepository> {
|
||||
public static final String COLLECTION_PATH = "v1/tables/";
|
||||
static final String FIELDS =
|
||||
"tableConstraints,tablePartition,usageSummary,owner,customMetrics,"
|
||||
"tableConstraints,tablePartition,usageSummary,owner,customMetrics,columns,"
|
||||
+ "tags,followers,joins,viewDefinition,dataModel,extension,testSuite,domain,dataProducts,lifeCycle";
|
||||
|
||||
@Override
|
||||
|
||||
@ -147,7 +147,7 @@ public class PIIMasker {
|
||||
MessageParser.EntityLink testCaseLink = MessageParser.EntityLink.parse(testCase.getEntityLink());
|
||||
Table table =
|
||||
Entity.getEntityByName(
|
||||
Entity.TABLE, testCaseLink.getEntityFQN(), "owner,tags", Include.NON_DELETED);
|
||||
Entity.TABLE, testCaseLink.getEntityFQN(), "owner,tags,columns", Include.NON_DELETED);
|
||||
|
||||
// Ignore table tests
|
||||
if (testCaseLink.getFieldName() == null) return testCase;
|
||||
|
||||
@ -595,7 +595,7 @@ public class FeedResourceTest extends OpenMetadataApplicationTest {
|
||||
// Task can be resolved by the User2 to whom the task is assigned
|
||||
resolveTask(taskId, resolveTask, USER2_AUTH_HEADERS);
|
||||
|
||||
Table table = TABLE_RESOURCE_TEST.getEntity(TABLE.getId(), "tags", USER_AUTH_HEADERS);
|
||||
Table table = TABLE_RESOURCE_TEST.getEntity(TABLE.getId(), "tags,columns", USER_AUTH_HEADERS);
|
||||
List<TagLabel> tags = EntityUtil.getColumn(table, C1).getTags();
|
||||
assertEquals(USER_ADDRESS_TAG_LABEL.getTagFQN(), tags.get(0).getTagFQN());
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user