diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 766798bd5..a86a23963 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -21,7 +21,7 @@ jobs: lint: if: github.actor != 'renovate[bot]' name: Lint source code - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -40,7 +40,7 @@ jobs: - name: Set up Python 3.11 uses: actions/setup-python@v5 with: - python-version: '3.13' + python-version: '3.11' - uses: actions/cache@v4 name: Cache pip dependencies @@ -85,7 +85,7 @@ jobs: validate-docs: name: Validate Docs - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -93,7 +93,7 @@ jobs: - name: Setup Python 3.11 uses: actions/setup-python@v5 with: - python-version: '3.13' + python-version: '3.11' - name: Cache pip dependencies id: cache diff --git a/src/ydata_profiling/utils/information.py b/src/ydata_profiling/utils/information.py index 2ac876d9b..c87538dec 100644 --- a/src/ydata_profiling/utils/information.py +++ b/src/ydata_profiling/utils/information.py @@ -2,8 +2,10 @@ References and information regarding ydata-profiling and ydata-sdk """ import importlib.util +import os _displayed_banner = False +SUPPRESS_BANNER = bool(os.getenv("YDATA_SUPPRESS_BANNER", "")) link = "https://ydata.ai/register" title = "Upgrade to ydata-sdk" @@ -15,10 +17,8 @@ def in_jupyter_notebook() -> bool: if importlib.util.find_spec("IPython") is not None: from IPython import get_ipython - isiPython = not get_ipython() is None - else: - isiPython = False - return isiPython + return get_ipython() is not None + return False class DisplayInfo: @@ -61,8 +61,8 @@ def display_message(self) -> None: def display_banner() -> None: global _displayed_banner - banner_info = DisplayInfo(title=title, info_text=info_text) - if not _displayed_banner: + if not _displayed_banner and not SUPPRESS_BANNER: + banner_info = DisplayInfo(title=title, info_text=info_text) banner_info.display_message() _displayed_banner = True