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

Navigation links in headers do not work on databricks notebooks #1697

Open
3 tasks done
invalidarg opened this issue Jan 31, 2025 · 1 comment
Open
3 tasks done

Navigation links in headers do not work on databricks notebooks #1697

invalidarg opened this issue Jan 31, 2025 · 1 comment
Labels
code quality 📈 Improvements to the quality of the code base

Comments

@invalidarg
Copy link

Current Behaviour

When the links in the headers are clicked a new window opens

Image

Expected Behaviour

Expected behavior would be to scroll down the the appropriate section.

This fixes the problem:

report_html = profile.to_html()
# hack to fix links in header
fix_link_script = f"""
document.querySelectorAll('a[href^="#"]').forEach(el => {{
    el.setAttribute('onclick', "event.preventDefault(); document.querySelector(this.getAttribute('href')).scrollIntoView({{ behavior: 'smooth' }});");
}});"""
report_html = report_html.replace("/* Link */", f"/* Link */ {fix_link_script}")
displayHTML(report_html)

Data Description

N/A

Code that reproduces the bug

profile = ProfileReport(df)

report_html = profile.to_html()
displayHTML(report_html)


profile.to_notebook_iframe() # same problem

pandas-profiling version

4.12.2

Dependencies

alembic==1.14.1
annotated-types==0.7.0
asttokens==2.0.5
astunparse==1.6.3
attrs==25.1.0
azure-core==1.30.2
azure-storage-blob==12.19.1
azure-storage-file-datalake==12.14.0
backcall==0.2.0
black==23.3.0
blinker==1.9.0
boto3==1.34.39
botocore==1.34.39
cachetools==5.3.3
certifi==2023.7.22
cffi==1.15.1
chardet==4.0.0
charset-normalizer==2.0.4
click==8.1.8
cloudpickle==2.2.1
comm==0.1.2
contourpy==1.0.5
cryptography==41.0.3
cycler==0.11.0
Cython==0.29.32
dacite==1.9.1
databricks-sdk==0.20.0
dbus-python==1.2.18
debugpy==1.6.7
decorator==5.1.1
Deprecated==1.2.18
distlib==0.3.8
distro==1.7.0
distro-info==1.1+ubuntu0.2
docker==7.1.0
entrypoints==0.4
executing==0.8.3
facets-overview==1.1.1
filelock==3.13.4
Flask==3.1.0
fonttools==4.25.0
gitdb==4.0.11
GitPython==3.1.43
google-api-core==2.18.0
google-auth==2.31.0
google-cloud-core==2.4.1
google-cloud-storage==2.17.0
google-crc32c==1.5.0
google-resumable-media==2.7.1
googleapis-common-protos==1.63.2
graphene==3.4.3
graphql-core==3.2.6
graphql-relay==3.2.0
greenlet==3.1.1
grpcio==1.60.0
grpcio-status==1.60.0
gunicorn==23.0.0
htmlmin==0.1.12
httplib2==0.20.2
idna==3.4
ImageHash==4.3.1
importlib-metadata==6.0.0
ipyflow-core==0.0.198
ipykernel==6.25.1
ipython==8.15.0
ipython-genutils==0.2.0
ipywidgets @ https://databricks-build-artifacts-manual-staging.s3-accelerate.amazonaws.com/ipywidgets/ipywidgets-7.7.2-2databricksnojsdeps-py2.py3-none-any.whl?AWSAccessKeyId=AKIAX7HWM34HCSVHYQ7M&Expires=2028837235&Signature=gJ%2BjzENPoM6UKsDxe1M3VIrgWco%3D#sha256=903ead20c8d40de671853515fcad2f34b43ebf3eff80e4df3f876b8dd64c903b
isodate==0.6.1
itsdangerous==2.2.0
jedi==0.18.1
jeepney==0.7.1
Jinja2==3.1.5
jmespath==0.10.0
joblib==1.2.0
jupyter_client==7.4.9
jupyter_core==5.3.0
keyring==23.5.0
kiwisolver==1.4.4
launchpadlib==1.10.16
lazr.restfulclient==0.14.4
lazr.uri==1.0.6
Mako==1.3.8
Markdown==3.7
MarkupSafe==3.0.2
matplotlib==3.7.2
matplotlib-inline==0.1.6
mlflow==2.20.1
mlflow-skinny==2.20.1
more-itertools==8.10.0
multimethod==1.12
mypy-extensions==0.4.3
nest-asyncio==1.5.6
networkx==3.4.2
numpy==1.23.5
oauthlib==3.2.0
opentelemetry-api==1.29.0
opentelemetry-sdk==1.29.0
opentelemetry-semantic-conventions==0.50b0
packaging==23.2
pandas==2.2.3
parso==0.8.3
pathspec==0.10.3
patsy==0.5.3
pexpect==4.8.0
phik==0.12.4
pickleshare==0.7.5
Pillow==9.4.0
platformdirs==3.10.0
plotly==5.9.0
prompt-toolkit==3.0.36
proto-plus==1.24.0
protobuf==4.24.1
psutil==5.9.0
psycopg2==2.9.3
ptyprocess==0.7.0
pure-eval==0.2.2
py4j==0.10.9.7
pyarrow==14.0.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pyccolo==0.0.52
pycparser==2.21
pydantic==2.10.6
pydantic_core==2.27.2
Pygments==2.15.1
PyGObject==3.42.1
PyJWT==2.3.0
pyodbc==4.0.39
pyparsing==3.0.9
pyspark==3.5.4
python-apt==2.4.0+ubuntu4
python-dateutil==2.8.2
python-lsp-jsonrpc==1.1.1
pytz==2022.7
PyWavelets==1.8.0
PyYAML==6.0
pyzmq==23.2.0
requests==2.31.0
rsa==4.9
s3transfer==0.10.2
scikit-learn==1.3.0
scipy==1.11.1
seaborn==0.12.2
SecretStorage==3.3.1
six==1.16.0
smmap==5.0.1
SQLAlchemy==2.0.37
sqlparse==0.5.0
ssh-import-id==5.11
stack-data==0.2.0
statsmodels==0.13.5
tabulate==0.9.0
tenacity==8.2.2
threadpoolctl==2.2.0
tokenize-rt==4.2.1
tornado==6.3.2
tqdm==4.67.1
traitlets==5.7.1
typeguard==4.4.1
typing_extensions==4.12.2
tzdata==2025.1
ujson==5.4.0
unattended-upgrades==0.1
urllib3==1.26.16
virtualenv==20.24.2
visions==0.7.6
wadllib==1.3.6
wcwidth==0.2.5
Werkzeug==3.1.3
wordcloud==1.9.4
wrapt==1.17.2
ydata-profiling==4.12.2
zipp==3.11.0

OS

No response

Checklist

  • There is not yet another bug report for this issue in the issue tracker
  • The problem is reproducible from this bug report. This guide can help to craft a minimal bug report.
  • The issue has not been resolved by the entries listed under Common Issues.
@fabclmnt
Copy link
Contributor

fabclmnt commented Feb 6, 2025

Hi @invalidarg ,

thank you for your reported issue. Given that you have already a solution suggested, I do invite you to contribute with a PR to have it fixed sooner.

@fabclmnt fabclmnt added code quality 📈 Improvements to the quality of the code base and removed needs-triage labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality 📈 Improvements to the quality of the code base
Projects
None yet
Development

No branches or pull requests

3 participants