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

Throw a warning when imports and code are mixed in a cell #714

Closed
hamelsmu opened this issue Aug 1, 2022 · 2 comments
Closed

Throw a warning when imports and code are mixed in a cell #714

hamelsmu opened this issue Aug 1, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@hamelsmu
Copy link
Member

hamelsmu commented Aug 1, 2022

Right now we don't have good error messages when imports & code are mixed in a cell and things can hang leaving the user confused. We should catch this and throw a warning

@hamelsmu hamelsmu added the enhancement New feature or request label Aug 1, 2022
@jph00
Copy link
Member

jph00 commented Aug 1, 2022

Note: it's fine to mix in an exported cell

@dsm-72
Copy link
Contributor

dsm-72 commented Oct 24, 2022

@jph00 I am not sure if this is true. I have a simple notebook with constants.ipynb and it has basically

#export
import os, inspect
__file = inspect.getfile(lambda: None)
ROOT_DIR = 'here'

running nbdev_preview yields

Preparing to preview
[ 1/13] constants.ipynb
ERROR: No language set for Jupyter notebook

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

No branches or pull requests

3 participants