SameerMesiah97 commented on code in PR #70101:
URL: https://github.com/apache/airflow/pull/70101#discussion_r3839101289
##########
providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake_cortex_agent.py:
##########
@@ -159,11 +161,124 @@ def run_agent(
endpoint =
f"/api/v2/databases/{database}/schemas/{schema}/agents/{agent_name}:run"
- return self._request(
- method="POST",
- endpoint=endpoint,
- payload=payload,
- timeout=timeout,
+ return cast(
+ "dict[str, Any]",
+ self._request(
+ method="POST",
+ endpoint=endpoint,
+ payload=payload,
+ timeout=timeout,
+ ),
+ )
Review Comment:
The type of the response object is not necessarily determined by the HTTP
method. I have followed the spirit of your suggestion by defining overloads for
the `_request` method, which uses a `response_type` parameter to determine the
return type.
--
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]