SEPURI-SAI-KRISHNA commented on PR #71649:
URL: https://github.com/apache/airflow/pull/71649#issuecomment-5303089656
Thanks both for the reviews.
Good suggestion, I've added that test. It drives the operator through the
full deferrable loop across both pages and asserts on the `RequestInformation`
that actually reaches the request adapter, rather than on the trigger that was
constructed:
```python
def test_pagination_issues_every_page_with_the_configured_request(self):
...
requests = [call.args[0] for call in
mock_get_http_response.call_args_list]
assert len(requests) == 2
for request in requests:
assert request.headers.try_get("ConsistencyLevel") == {"eventual"}
assert request.content == json.dumps(data).encode("utf-8")
```
I configured the operator with `method="POST"` so the failure is
unambiguous. Before the fix, the two requests come out like this:
| | page 1 | page 2 |
|---|---|---|
| method | `POST` | `POST` |
| `ConsistencyLevel` | `eventual` | *absent* |
| body | `{"requestBody": "value"}` | `None` |
which is the shape of the bug: the verb is carried over to the next page
while the body and headers that gave it meaning are not.
I kept the existing
`test_trigger_next_link_forwards_the_request_configuration` alongside it rather
than replacing it. `scopes` feeds token acquisition and never appears on the
outgoing `RequestInformation`, so it isn't observable at
the request layer, the trigger-level assertion is the only place it can be
covered. The two tests together cover all three forwarded arguments.
Both fail with the source change reverted and pass with it applied (13
pre-existing tests in the file are unaffected either way).
--
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]