Skip to content
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

docs: use pagination for GhApi #973

Merged
merged 2 commits into from Mar 13, 2023
Merged

Conversation

agoose77
Copy link
Contributor

@agoose77 agoose77 commented Mar 11, 2023

GhApi's per_page is limited to 100, so we must use pagination to read more than 100 entries. This is currently manifesting as missing entries in the feature-voting table.

@welcome
Copy link

welcome bot commented Mar 11, 2023

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.

Welcome to the EBP community! 🎉

@choldgraf
Copy link
Member

Oooh nice!

Hmm for some reason we're getting a new error in the build, there might be some extra step we need to do to extract the proper metadata w this paged setup

https://readthedocs.org/projects/executablebookproject/builds/19749156/ is the broken RTD build

Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/executablebookproject/envs/973/lib/python3.7/site-packages/sphinx/events.py", line 94, in emit results.append(listener.handler(self.app, *args)) File "/home/docs/checkouts/readthedocs.org/user_builds/executablebookproject/checkouts/973/docs/conf.py", line 211, in update_feature_votes df["👍"] = df["reactions"].map(lambda a: a["+1"]) File "/home/docs/checkouts/readthedocs.org/user_builds/executablebookproject/envs/973/lib/python3.7/site-packages/pandas/core/frame.py", line 3458, in __getitem__ indexer = self.columns.get_loc(key) File "/home/docs/checkouts/readthedocs.org/user_builds/executablebookproject/envs/973/lib/python3.7/site-packages/pandas/core/indexes/range.py", line 388, in get_loc raise KeyError(key) KeyError: 'reactions'

@agoose77
Copy link
Contributor Author

@choldgraf ah I missed the fact that pagination returns an iterable of pages. That makes sense if the GitHub API does this, but the documentation implies it would be a flat iterable of per-page results. Thanks!

Also, this Gallery example is timing-out, which is why the link checker complains: https://github.com/liuhuanshuo/zaoqi-book

@choldgraf choldgraf merged commit f32fdd3 into main Mar 13, 2023
1 check failed
@welcome
Copy link

welcome bot commented Mar 13, 2023

Congrats on your first merged pull request in this project! 🎉
congrats

Thank you for contributing, we are very proud of you! ❤️

@choldgraf
Copy link
Member

I think we can merge this in since it fixes a bug in our table, and spot-check the broken link in follow up PRs. Thanks for taking a look at this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants