fix: properly set `owners` to Sqlatable.owners_data inside payload (#20794)

* properly set owners_data for sqlatabl

* fix test
This commit is contained in:
Hugh A. Miles II 2022-07-20 14:56:08 -04:00 committed by GitHub
parent 5a04a28518
commit 84b852c457
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -920,6 +920,7 @@ class SqlaTable(Model, BaseDatasource): # pylint: disable=too-many-public-metho
data_["is_sqllab_view"] = self.is_sqllab_view
data_["health_check_message"] = self.health_check_message
data_["extra"] = self.extra
data_["owners"] = self.owners_data
return data_
@property

View File

@ -290,6 +290,8 @@ class TestDatasource(SupersetTestCase):
self.compare_lists(datasource_post[k], resp[k], "metric_name")
elif k == "database":
self.assertEqual(resp[k]["id"], datasource_post[k]["id"])
elif k == "owners":
self.assertEqual([o["id"] for o in resp[k]], datasource_post["owners"])
else:
print(k)
self.assertEqual(resp[k], datasource_post[k])