fastai / ghapi

A delightful and complete interface to GitHub's amazing API
https://ghapi.fast.ai/
Apache License 2.0
610 stars 63 forks source link

Do not ignore none kwargs #91

Closed salgo closed 2 years ago

salgo commented 3 years ago

I'm solving the issue https://github.com/fastai/ghapi/issues/81 here.

Specifically ghapi.repos.update_branch_protection a parameter that requires None to be passed to allow the correct protections to be set. The line I have removed removes kwargs with the value of None from the call. The kwarg and related GitHub API parameter restrictions is required even if it is specified as None - which is a valid thing to want to do.

This change removes the check and makes this API call work. On my local environment make test returns the following failing tests. I do not know enough about the build environment or ipynb files to know how to address these issues.

nbdev_test_nbs
testing /Volumes/Work/ghapi/02_auth.ipynb
testing /Volumes/Work/ghapi/00_core.ipynb
testing /Volumes/Work/ghapi/01_actions.ipynb
testing /Volumes/Work/ghapi/03_page.ipynb
testing /Volumes/Work/ghapi/04_event.ipynb
testing /Volumes/Work/ghapi/10_cli.ipynb
testing /Volumes/Work/ghapi/50_fullapi.ipynb
testing /Volumes/Work/ghapi/80_tutorial_actions.ipynb
testing /Volumes/Work/ghapi/90_build_lib.ipynb
testing /Volumes/Work/ghapi/ghapi_demo.ipynb
testing /Volumes/Work/ghapi/index.ipynb
Traceback (most recent call last):
  File "/Volumes/Work/ghapi/venv/bin/nbdev_test_nbs", line 8, in <module>
    sys.exit(nbdev_test_nbs())
  File "/Volumes/Work/ghapi/venv/lib/python3.8/site-packages/fastcore/script.py", line 107, in _f
    tfunc(**merge(args, args_from_prog(func, xtra)))
  File "/Volumes/Work/ghapi/venv/lib/python3.8/site-packages/nbdev/test.py", line 120, in nbdev_test_nbs
    raise Exception(msg + '\n'.join([f.name for p,f in zip(passed,files) if not p]))
Exception: The following notebooks failed:
00_core.ipynb
04_event.ipynb
80_tutorial_actions.ipynb
90_build_lib.ipynb
index.ipynb
make: *** [test] Error 1
review-notebook-app[bot] commented 3 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB