-
Notifications
You must be signed in to change notification settings - Fork 316
fix: fix rows returned when both start_index and page_size are provided #2181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
{"f": [{"v": "pqe"}]}, | ||
], | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
# 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the last message, the page token will be empty because there is no following page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 🦕