Skip to content

Commit 3fa4441

Browse files
fix: add a new env variable for banner (#1735)
* fix: add a new env variable for banner * fix: fix wk to validate docs * chore: fix wk for code linter * fix(linting): code formatting --------- Co-authored-by: Azory YData Bot <azory@ydata.ai>
1 parent ad5df60 commit 3fa4441

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/pull-request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
lint:
2222
if: github.actor != 'renovate[bot]'
2323
name: Lint source code
24-
runs-on: ubuntu-24.04
24+
runs-on: ubuntu-22.04
2525

2626
steps:
2727
- uses: actions/checkout@v4
@@ -40,7 +40,7 @@ jobs:
4040
- name: Set up Python 3.11
4141
uses: actions/setup-python@v5
4242
with:
43-
python-version: '3.13'
43+
python-version: '3.11'
4444

4545
- uses: actions/cache@v4
4646
name: Cache pip dependencies
@@ -85,15 +85,15 @@ jobs:
8585

8686
validate-docs:
8787
name: Validate Docs
88-
runs-on: ubuntu-24.04
88+
runs-on: ubuntu-22.04
8989

9090
steps:
9191
- uses: actions/checkout@v4
9292

9393
- name: Setup Python 3.11
9494
uses: actions/setup-python@v5
9595
with:
96-
python-version: '3.13'
96+
python-version: '3.11'
9797

9898
- name: Cache pip dependencies
9999
id: cache

src/ydata_profiling/utils/information.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
References and information regarding ydata-profiling and ydata-sdk
33
"""
44
import importlib.util
5+
import os
56

67
_displayed_banner = False
8+
SUPPRESS_BANNER = bool(os.getenv("YDATA_SUPPRESS_BANNER", ""))
79

810
link = "https://ydata.ai/register"
911
title = "Upgrade to ydata-sdk"
@@ -15,10 +17,8 @@ def in_jupyter_notebook() -> bool:
1517
if importlib.util.find_spec("IPython") is not None:
1618
from IPython import get_ipython
1719

18-
isiPython = not get_ipython() is None
19-
else:
20-
isiPython = False
21-
return isiPython
20+
return get_ipython() is not None
21+
return False
2222

2323

2424
class DisplayInfo:
@@ -61,8 +61,8 @@ def display_message(self) -> None:
6161

6262
def display_banner() -> None:
6363
global _displayed_banner
64-
banner_info = DisplayInfo(title=title, info_text=info_text)
6564

66-
if not _displayed_banner:
65+
if not _displayed_banner and not SUPPRESS_BANNER:
66+
banner_info = DisplayInfo(title=title, info_text=info_text)
6767
banner_info.display_message()
6868
_displayed_banner = True

0 commit comments

Comments
 (0)