fix: fix rows returned when both start_index and page_size are provided#2181
fix: fix rows returned when both start_index and page_size are provided#2181chalmerlowe merged 11 commits intogoogleapis:mainfrom
Conversation
| {"f": [{"v": "pqe"}]}, | ||
| ], | ||
| } | ||
|
|
There was a problem hiding this comment.
Please go through the rest of this test and provide some additional comments.
Clarify why we are using total_rows of 7.
Clarify why setting total_rows to 7 despite only have six rows of tabledata is ok/reasonable
Clarify what is at the indexed positions:
tabledata_list_request_1[1]tabledata_list_request_2[1]
There was a problem hiding this comment.
Clarify why we are using total_rows of 7.
Clarify why setting total_rows to 7 despite only have six rows of tabledata is ok/reasonable
Done.
Clarify what is at the indexed positions:
tabledata_list_request_1[1]
tabledata_list_request_2[1]
There are comments above the code block explaining that these are the first and the second requests that the client sends to the server.
There was a problem hiding this comment.
I am gonna drop this comment.
| # request. However, in the subsequent requests, we will pass only | ||
| # page_token but not start_index, because the server only allows one |
There was a problem hiding this comment.
Here we mention sending page_token, but nowhere in the test do we confirm that page_token is set or that it has been sent, etc.
In fact, while it is correct, with this language in place, it seems weird that in tabledata_resource_2, pagetoken is set to None. The above language implies that we might send something besides None.
Should we revise the language slightly?
Do we mean some other argument/attribute besides page_token?
There was a problem hiding this comment.
In the last message, the page token will be empty because there is no following page.
There was a problem hiding this comment.
Also, tabledata_resource_2 is what the server returns, not what we pass to the server. The process of sending the page token happens within result = job.result(page_size=page_size, start_index=start_index) and I don't think it's realistic to expose that in unit test.
There was a problem hiding this comment.
I am gonna drop this comment.
chalmerlowe
left a comment
There was a problem hiding this comment.
Added some comments about the docstrings and comments in the test.
The test feels complicated especially upon first read so it might benefit from a bit more commentary and potentially some rewording.
TODO:
Fixes #2173 🦕