uranusjr commented on code in PR #36781:
URL: https://github.com/apache/airflow/pull/36781#discussion_r1451989840


##########
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:
   Ew, escaping URI as one single path component is so ugly. But I guess we 
don’t have many choices here. We should probably document this in the Open API 
spec (or somewhere else?) how to put the URI in the API URL.



-- 
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]

Reply via email to