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

bugraoz93 pushed a commit to branch airflow-ctl/v0-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/airflow-ctl/v0-1-test by this 
push:
     new 8c6bb32c42b [airflow-ctl-v0-1-test] airflowctl: Send backfill create 
and dry-run payloads as JSON (#65158) (#65937)
8c6bb32c42b is described below

commit 8c6bb32c42bea44036b134db96ae36921d694e12
Author: Bugra Ozturk <[email protected]>
AuthorDate: Mon Apr 27 11:02:28 2026 +0200

    [airflow-ctl-v0-1-test] airflowctl: Send backfill create and dry-run 
payloads as JSON (#65158) (#65937)
    
    (cherry picked from commit ec8977cc2c562b3b3a4feb81041bb572a19183ea)
    
    Co-authored-by: Henry Chen <[email protected]>
---
 airflow-ctl/src/airflowctl/api/operations.py         | 4 ++--
 airflow-ctl/tests/airflow_ctl/api/test_operations.py | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/airflow-ctl/src/airflowctl/api/operations.py 
b/airflow-ctl/src/airflowctl/api/operations.py
index a87683468cd..7718c1c5649 100644
--- a/airflow-ctl/src/airflowctl/api/operations.py
+++ b/airflow-ctl/src/airflowctl/api/operations.py
@@ -354,7 +354,7 @@ class BackfillOperations(BaseOperations):
         """Create a backfill."""
         try:
             self.response = self.client.post(
-                "backfills", data=backfill.model_dump(mode="json", 
exclude_none=True)
+                "backfills", json=backfill.model_dump(mode="json", 
exclude_none=True)
             )
             return BackfillResponse.model_validate_json(self.response.content)
         except ServerResponseError as e:
@@ -364,7 +364,7 @@ class BackfillOperations(BaseOperations):
         """Create a dry run backfill."""
         try:
             self.response = self.client.post(
-                "backfills/dry_run", data=backfill.model_dump(mode="json", 
exclude_none=True)
+                "backfills/dry_run", json=backfill.model_dump(mode="json", 
exclude_none=True)
             )
             return BackfillResponse.model_validate_json(self.response.content)
         except ServerResponseError as e:
diff --git a/airflow-ctl/tests/airflow_ctl/api/test_operations.py 
b/airflow-ctl/tests/airflow_ctl/api/test_operations.py
index efb430ccc53..d01f70eedfe 100644
--- a/airflow-ctl/tests/airflow_ctl/api/test_operations.py
+++ b/airflow-ctl/tests/airflow_ctl/api/test_operations.py
@@ -463,8 +463,12 @@ class TestBackfillOperations:
     )
 
     def test_create(self):
+        expected_body = self.backfill_body.model_dump(mode="json", 
exclude_none=True)
+
         def handle_request(request: httpx.Request) -> httpx.Response:
             assert request.url.path == "/api/v2/backfills"
+            assert request.headers.get("content-type", 
"").startswith("application/json")
+            assert json.loads(request.content.decode()) == expected_body
             return httpx.Response(200, 
json=json.loads(self.backfill_response.model_dump_json()))
 
         client = make_api_client(transport=httpx.MockTransport(handle_request))
@@ -472,8 +476,12 @@ class TestBackfillOperations:
         assert response == self.backfill_response
 
     def test_create_dry_run(self):
+        expected_body = self.backfill_body.model_dump(mode="json", 
exclude_none=True)
+
         def handle_request(request: httpx.Request) -> httpx.Response:
             assert request.url.path == "/api/v2/backfills/dry_run"
+            assert request.headers.get("content-type", 
"").startswith("application/json")
+            assert json.loads(request.content.decode()) == expected_body
             return httpx.Response(200, 
json=json.loads(self.backfill_response.model_dump_json()))
 
         client = make_api_client(transport=httpx.MockTransport(handle_request))

Reply via email to