You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "kiaradlf (via GitHub)" <gi...@apache.org> on 2024/05/23 07:29:13 UTC

[I] http hook throws when `params` passed as kwarg [airflow]

kiaradlf opened a new issue, #39777:
URL: https://github.com/apache/airflow/issues/39777

   ### Apache Airflow version
   
   2.9.1
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   http hook throws when `params` passed as kwarg
   
   ### What you think should happen instead?
   
   no error
   
   ### How to reproduce
   
   when i invoke:
   
   ```
   from airflow.providers.http.hooks.http import HttpHook
   
   HttpHook.__init__(method="GET", http_conn_id="foo").run(** {'endpoint': '/foos', 'params': {'page': 1}})
   ```
   
   i get the error:
   
   ```
     File "/home/airflow/.local/lib/python3.11/site-packages/airflow/providers/http/hooks/http.py", line 177, in run
       req = requests.Request(self.method, url, params=data, headers=headers, **request_kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   TypeError: requests.models.Request() got multiple values for keyword argument 'params'
   ```
   
   
   ### Operating System
   
   chromeos
   
   ### Versions of Apache Airflow Providers
   
   1.9.0
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] http hook throws when `params` passed as kwarg [airflow]

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis closed issue #39777: http hook throws when `params` passed as kwarg
URL: https://github.com/apache/airflow/issues/39777


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] http hook throws when `params` passed as kwarg [airflow]

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on issue #39777:
URL: https://github.com/apache/airflow/issues/39777#issuecomment-2126576422

   I'm not sure about version of provider `1.9.0` however according to the latest (4.11.0 at that moment) [HttpHook.run](https://airflow.apache.org/docs/apache-airflow-providers-http/stable/_api/airflow/providers/http/hooks/http/index.html#airflow.providers.http.hooks.http.HttpHook.run) you should provide it as a `data` argument
   
   ```python
   HttpHook(method="GET", http_conn_id="foo").run(endpoint='/foos', data={'page': 1})
   ```


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org