topherinternational commented on issue #45237:
URL: https://github.com/apache/airflow/issues/45237#issuecomment-2573021373
> > > > {'check_response': False}
>
> > >
>
> > >
>
> > > Just tested it and it fails with following error as it considers the
check_response passed in the extra_options as a HTTP header:
>
> > > `requests.exceptions.InvalidHeader: Header part (False) from
('check_response', False) must be of type str or bytes, not <class 'bool'>`
>
> >
>
> > What exactly was your code here? Did you put the `check_response` pair
in the Operator constructor's `extra_options`? Or in the Connection object?
>
> >
>
> > Edit: I ask bc I played with the tests and the only way I could get that
InvalidHeader error was to pass the `check_response` param in the operator's
headers arg instead of the extra_options, or to put check_response=false in the
Connection's extra table.
>
>
>
> I've defined those in the extra_options of the connection, tested on the
latest Airflow version.
Ah, I think what the other commentor meant was to pass `extra_options` to
the `HttpOperator`, not the Connection. When I pass it to the operator the
setting is passed to the hook as expected and the `response_check` function is
called.
This should solve your immediate problem, checking status and response
content with your callback instead of the hook raising a preemptive exception.
--
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]