MINOR: Fixed owner not updating from dbt if owners field has an empty list set in db (#17610)

* Fixed owner not updating from dbt for empty list

* fix table get
This commit is contained in:
Onkar Ravgan 2024-08-28 14:30:58 +05:30 committed by GitHub
parent 4c354eabb2
commit d6eb4fa9e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -598,7 +598,7 @@ public class TableRepository extends EntityRepository<Table> {
}
public Table addDataModel(UUID tableId, DataModel dataModel) {
Table table = find(tableId, NON_DELETED);
Table table = get(null, tableId, getFields(FIELD_OWNERS), NON_DELETED, false);
// Update the sql fields only if correct value is present
if (dataModel.getRawSql() == null || dataModel.getRawSql().isBlank()) {
@ -618,7 +618,7 @@ public class TableRepository extends EntityRepository<Table> {
table.withDataModel(dataModel);
// Carry forward the table owners from the model to table entity, if empty
if (table.getOwners() == null) {
if (nullOrEmpty(table.getOwners())) {
storeOwners(table, dataModel.getOwners());
}