im-perativa commented on code in PR #36781:
URL: https://github.com/apache/airflow/pull/36781#discussion_r1451995460
##########
tests/api_connexion/endpoints/test_dataset_endpoint.py:
##########
@@ -81,6 +84,95 @@ def _create_dataset(self, session):
return dataset_model
+class TestDeleteDatasetEndpoint(TestDatasetEndpoint):
+ def test_delete_should_respond_204(self, session):
+ dataset_model = DatasetModel(
+ id=1,
+ uri="s3://bucket/key",
+ extra={"foo": "bar"},
+ created_at=timezone.parse(self.default_time),
+ updated_at=timezone.parse(self.default_time),
+ )
+
+ session.add(dataset_model)
+ session.commit()
+ datasets = session.query(DatasetModel).all()
+ assert len(datasets) == 1
+ response = self.client.delete(
+ f"/api/v1/datasets/{urllib.parse.quote('s3://bucket/key',
safe='')}",
Review Comment:
Actually, I'm not sure why the datasets endpoint choose to use URI as it's
parameter instead of `id` like for DAG endpoint so I'm just following the
existing pattern. I agree that it may not be the best choice.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]