rich
rich copied to clipboard
Detect Databricks as Jupyter environment
Type of changes
Detect Databricks as Jupyter environment, although it is kind of a weird breed of Jupyter Notebook. This should make JUPYTER_LINES
and JUPYTER_COLUMNS
configurations useful for Databricks
- [x] Bug fix
- [ ] New feature
- [x] Documentation / docstrings
- [ ] Tests
- [ ] Other
Checklist
- [x] I've run the latest black with default args on new code.
- [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
- [ ] I've added tests for new code.
- [x] I accept that @willmcgugan may be pedantic in the code review.
Description
Please describe your changes here. If this fixes a bug, please link to the issue, if possible. Added a condition to check for Databricks environment variable. Fix #2422
Codecov Report
Merging #2424 (3a5f097) into master (19e518f) will decrease coverage by
0.03%
. The diff coverage is98.34%
.
:exclamation: Current head 3a5f097 differs from pull request most recent head e054861. Consider uploading reports for the commit e054861 to get more accurate results
@@ Coverage Diff @@
## master #2424 +/- ##
==========================================
- Coverage 98.71% 98.67% -0.04%
==========================================
Files 73 72 -1
Lines 7771 7767 -4
==========================================
- Hits 7671 7664 -7
- Misses 100 103 +3
Flag | Coverage Δ | |
---|---|---|
unittests | 98.67% <98.34%> (-0.04%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
rich/default_styles.py | 100.00% <ø> (ø) |
|
rich/logging.py | 100.00% <ø> (ø) |
|
rich/progress.py | 92.76% <ø> (ø) |
|
rich/segment.py | 98.72% <93.10%> (+<0.01%) |
:arrow_up: |
rich/_inspect.py | 100.00% <100.00%> (ø) |
|
rich/box.py | 100.00% <100.00%> (ø) |
|
rich/cells.py | 96.05% <100.00%> (-3.95%) |
:arrow_down: |
rich/color.py | 100.00% <100.00%> (ø) |
|
rich/console.py | 98.30% <100.00%> (+0.01%) |
:arrow_up: |
rich/highlighter.py | 100.00% <100.00%> (ø) |
|
... and 4 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 2ee992b...e054861. Read the comment docs.
I don't know if it's any better, but https://stackoverflow.com/questions/51329152/how-to-detect-databricks-environment-programmatically suggests using a different environment variable, DATABRICKS_RUNTIME_VERSION
.
Thank you for doing this though! Definitely feels like the right fix to me from a kedro perspective. I thought I'd done _is_jupyter
in Databricks before to test exactly this out, but obviously I was wrong.
@AntonyMilneQB I can't find any documentation or guarantee about them, I tend to believe they are more or less the same. But I changed it anyway, let's stick with the StackOverflow answer.
@willmcgugan Sorry for tagging you directly, do you need more to get this approved?
Bear with me. Will review PRs within a week or two.
Thank you!
@willmcgugan Agree, unfortunately there aren't better way to detect a databricks environment. We have to include something similar because the Rich traceback hook interfere with Databricks notebook.