Skip to content

DOC: Fix undefined request_opts in MNIST download example#306

Open
EishaEnan wants to merge 1 commit intonumpy:mainfrom
EishaEnan:main
Open

DOC: Fix undefined request_opts in MNIST download example#306
EishaEnan wants to merge 1 commit intonumpy:mainfrom
EishaEnan:main

Conversation

@EishaEnan
Copy link
Copy Markdown

Summary

Fixes an undefined variable (request_opts) in the MNIST download example.

Problem

The documentation example includes the following line:

resp = requests.get(base_url + fname, stream=True, **request_opts)

However, request_opts is never defined in the example, which results in a NameError when users try to run the code.

Solution

Removed the unused **request_opts argument from the requests.get call to ensure the example runs correctly without requiring additional context.

Changes

- resp = requests.get(base_url + fname, stream=True, **request_opts)
+ resp = requests.get(base_url + fname, stream=True)

Impact

  • Prevents runtime errors for users following the tutorial
  • Improves clarity and reproducibility of the documentation example
  • Keeps the example minimal and beginner-friendly

Notes

This change keeps the example aligned with standard usage of requests.get and avoids introducing unnecessary variables.

Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's think about this as it's defined in L89 which we hide from the rendered output. Maybe we should include an empty version before that cell though?

cc @rossbar as the original author of hiding the content of the dict

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.

2 participants