-
Notifications
You must be signed in to change notification settings - Fork 669
int() argument must be a string, a bytes-like object or a real number, not 'NoneType' while accessing pagination related attributes #1686
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
Comments
I can't reproduce this but I only have about 90 projects. You might try doing:
As it might help diagnose the issue. |
Also if you can paste the full Exception stack trace it would be helpful to see what part of the code is triggering the issue. |
Also , related to pagination i do have specific question. Can we implement pagination in such way that , calling the required page number ( say for example 3 will return me the 3rd page ) , current implementation is that i need to be in the same method , iterate through page 1 , page 2 and page 3. as long as i'm in the same function all is good. But if i leave this function , and come back to this pagination fuction with next_page number , Is this something possible ? Atleast i could not find it in the code examples. if you guys , have some ideas , please post it here. Appreciate your support. I'm more than willing to do code changes as well , if you point me the right souce location. Thanks much. |
+1 on this issue, debug log below. Can't seem to fetch the total pages. Seems sometimes Gitlab will not return the header python-gitlab version:2.10.1
|
seems to be the issue here: |
If a query returns more than 10,000 records than the following values are NOT returned: x.total_pages x.total Modify the code to allow no value to be set for these values. If there is not a value returned the functions will now return None. https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers Closes #1686
Thank you very much for the debug log and the link. That made it easy to figure out the issue. I have proposed a PR to resolve the issue. |
If a query returns more than 10,000 records than the following values are NOT returned: x.total_pages x.total Modify the code to allow no value to be set for these values. If there is not a value returned the functions will now return None. https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers Closes #1686
If a query returns more than 10,000 records than the following values are NOT returned: x.total_pages x.total Modify the code to allow no value to be set for these values. If there is not a value returned the functions will now return None. https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers Closes #1686
If a query returns more than 10,000 records than the following values are NOT returned: x.total_pages x.total Modify the code to allow no value to be set for these values. If there is not a value returned the functions will now return None. https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers Closes #1686
If a query returns more than 10,000 records than the following values are NOT returned: x.total_pages x.total Modify the code to allow no value to be set for these values. If there is not a value returned the functions will now return None. https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers Closes #1686
If a query returns more than 10,000 records than the following values are NOT returned: x.total_pages x.total Modify the code to allow no value to be set for these values. If there is not a value returned the functions will now return None. Update unit test so no longer `xfail` https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers Closes #1686
If a query returns more than 10,000 records than the following values are NOT returned: x.total_pages x.total Modify the code to allow no value to be set for these values. If there is not a value returned the functions will now return None. Update unit test so no longer `xfail` https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers Closes #1686
If a query returns more than 10,000 records than the following values are NOT returned: x.total_pages x.total Modify the code to allow no value to be set for these values. If there is not a value returned the functions will now return None. Update unit test so no longer `xfail` https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers Closes #1686
Description of the problem, including code/CLI snippet
Accessing current_page , per_page , total , total_pages attributes , throwing the following error.
int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
Expected Behavior
It should return the number of pages expected
Actual Behavior
throwing exceptions.
Specifications
The text was updated successfully, but these errors were encountered: