executablebooks / meta

A community dedicated to supporting tools for technical and scientific communication and interactive computing
https://executablebooks.org
129 stars 164 forks source link

docs: use pagination for GhApi #973

Closed agoose77 closed 1 year ago

agoose77 commented 1 year ago

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[bot] commented 1 year ago

Thanks for submitting your first pull request! You are awesome! :hugs:
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! :tada:

choldgraf commented 1 year ago

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 commented 1 year ago

@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

welcome[bot] commented 1 year ago

Congrats on your first merged pull request in this project! :tada: congrats
Thank you for contributing, we are very proud of you! :heart:

choldgraf commented 1 year ago

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!