Skip to content

Commit

Permalink
fix: properly set owners to Sqlatable.owners_data inside payload (#…
Browse files Browse the repository at this point in the history
…20794)

* properly set owners_data for sqlatabl

* fix test
  • Loading branch information
hughhhh committed Jul 20, 2022
1 parent 5a04a28 commit 84b852c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ def data(self) -> Dict[str, Any]:
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
Expand Down
2 changes: 2 additions & 0 deletions tests/integration_tests/datasource_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ def test_save(self):
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])
Expand Down

0 comments on commit 84b852c

Please sign in to comment.