diff --git a/superset/datasets/commands/update.py b/superset/datasets/commands/update.py index b06f632e0c757..9ae2bd4a189c9 100644 --- a/superset/datasets/commands/update.py +++ b/superset/datasets/commands/update.py @@ -98,9 +98,8 @@ def validate(self) -> None: exceptions.append(DatabaseChangeValidationError()) # Validate/Populate owner try: - if owner_ids: - owners = self.populate_owners(self._actor, owner_ids) - self._properties["owners"] = owners + owners = self.populate_owners(self._actor, owner_ids) + self._properties["owners"] = owners except ValidationError as ex: exceptions.append(ex) diff --git a/tests/integration_tests/datasets/api_tests.py b/tests/integration_tests/datasets/api_tests.py index 2094b6060bbcb..e2babb89b861f 100644 --- a/tests/integration_tests/datasets/api_tests.py +++ b/tests/integration_tests/datasets/api_tests.py @@ -657,24 +657,6 @@ def test_update_dataset_item_w_override_columns(self): db.session.delete(dataset) db.session.commit() - def test_update_dataset_owners_kept(self): - """ - Dataset API: Test update dataset does not clear owners - """ - dataset = self.insert_default_dataset() - - self.login(username="admin") - dataset_data = {"description": "Arash's metrics for a successful Series C"} - uri = f"api/v1/dataset/{dataset.id}" - rv = self.put_assert_metric(uri, dataset_data, "put") - assert rv.status_code == 200 - - model = db.session.query(SqlaTable).get(dataset.id) - assert model.owners == dataset.owners - - db.session.delete(dataset) - db.session.commit() - def test_update_dataset_create_column(self): """ Dataset API: Test update dataset create column