potiuk commented on code in PR #70936:
URL: https://github.com/apache/airflow/pull/70936#discussion_r4063923939


##########
task-sdk/src/airflow/sdk/api/client.py:
##########
@@ -1305,6 +1305,14 @@ def dags(self) -> DagsOperations:
         return DagsOperations(self)
 
 
+def _has_json_body(response: httpx.Response) -> bool:
+    """Check whether a response declares a JSON body."""
+    # Media types are case-insensitive and may carry parameters (RFC 9110), so 
a proxy that

Review Comment:
   Nit, and I'm deliberately *not* asking you to extract this into `shared/` — 
`airflow-ctl` doesn't consume any shared distribution today, so wiring one up 
for three lines would cost more than it saves.
   
   But the twin in `airflow-ctl/src/airflowctl/api/operations.py:106` is the 
same function with a different comment: that one explains the consequence (the 
friendly `ServerResponseError` handling gets silently skipped), this one stops 
at the media-type point. The copies have diverged in the PR that created them, 
which is usually where drift starts.
   
   A cross-reference in each — *"kept in sync with 
`airflowctl.api.operations._has_json_body`"* and vice versa — would be enough 
to make the next person notice there are two.



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