This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 84b852c457 fix: properly set `owners` to Sqlatable.owners_data inside 
payload (#20794)
84b852c457 is described below

commit 84b852c45751930fdf8850c519509bdb2e5a5e38
Author: Hugh A. Miles II <[email protected]>
AuthorDate: Wed Jul 20 14:56:08 2022 -0400

    fix: properly set `owners` to Sqlatable.owners_data inside payload (#20794)
    
    * properly set owners_data for sqlatabl
    
    * fix test
---
 superset/connectors/sqla/models.py          | 1 +
 tests/integration_tests/datasource_tests.py | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/superset/connectors/sqla/models.py 
b/superset/connectors/sqla/models.py
index b5bfe1ffda..237a71ab7b 100644
--- a/superset/connectors/sqla/models.py
+++ b/superset/connectors/sqla/models.py
@@ -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
diff --git a/tests/integration_tests/datasource_tests.py 
b/tests/integration_tests/datasource_tests.py
index 6c8ae672c5..8e4d269b20 100644
--- a/tests/integration_tests/datasource_tests.py
+++ b/tests/integration_tests/datasource_tests.py
@@ -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])

Reply via email to