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

Exclude Databricks from notebook env only if the runtime is below 11.0 #17988

Merged
merged 9 commits into from
Jul 1, 2022

Conversation

davidheryanto
Copy link
Contributor

@davidheryanto davidheryanto commented Jul 1, 2022

What does this PR do?

This PR adds additional check to is_in_notebook() to return False in Databricks only if the Databricks Runtime is below 11.0. In Databricks Runtime 11.0 and above, IPython kernel is the default Python execution engine. Therefore it should be more compatible with Jupyter notebook https://docs.databricks.com/notebooks/ipython-kernel.html

#17406 (comment)

Additional Info

In Databricks Runtime 10.5 and earlier this is what the evaluation HTML output used to be. Therefore, we need to disable the notebook env.
image

In Databricks Runtime 11.0 with the default IPython kernel, the output looks similar to that in Jupyter notebook. Therefore, I believe we no longer need to disable the notebook env.
image

What does the value of DATABRICKS_RUNTIME_VERSION environment look like in Databricks notebook?
image

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@sgugger
Copy link
Collaborator

sgugger commented Jul 1, 2022

Arg, our CI wasn't triggered properly. Could you try pushing an empty commit?

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jul 1, 2022

The documentation is not available anymore as the PR was closed or merged.

@davidheryanto
Copy link
Contributor Author

Sure. I pushed a dummy commit removing a full stop in the comment.

@sgugger
Copy link
Collaborator

sgugger commented Jul 1, 2022

Didn't work again, there should be more tests spawning. You can do empty commits with --allow-empty to avoid having to do a real change. Can you try a couple of times to see if the test suite starts (there should be 18 checks total)?

@davidheryanto
Copy link
Contributor Author

Hmm still not sure why the CircleCI tests are skipped haha

@sgugger
Copy link
Collaborator

sgugger commented Jul 1, 2022

Okay managed to trigger it by pushing your branch inside the main fork of the repo. Let's just check all is green before merging, thanks for your patience!

@sgugger sgugger merged commit 49c8c67 into huggingface:main Jul 1, 2022
@davidheryanto
Copy link
Contributor Author

Thank you. Appreciate the quick feedback

@davidheryanto davidheryanto deleted the databricks-notebook-check branch July 2, 2022 02:58
viclzhu pushed a commit to viclzhu/transformers that referenced this pull request Jul 18, 2022
huggingface#17988)

* Exclude Databricks from notebook env only if the runtime is below 11.0

* Dummy commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI
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.

3 participants