Skip to content

Conversation

@dominikhei
Copy link
Contributor

@dominikhei dominikhei commented Jul 14, 2025


When working on #51756 , we initially planned to exclude the Tableau provider for Python 3.9. After quite a bit of trial and error, we eventually got it working. While this is admittedly a niche case, it quickly became clear that adding some automation and documentation around version exclusions would be helpful.

The first step to exclude a specific Python version for a provider, is to update three locations:

  • provider/pyproject.toml (in two different places)
  • provider/provider.yaml
  • dev/breeze/global_constants.py

Note: There also is a fourth place in which the provider needs to be added, but this case is already covered by current tests.

In pyproject.toml, two notations are used for excluding versions:

I have assumed the chance for <= exclusions is rather low and thus not considered it.

In global_constants.py, the matrix logic derives the provider name as follows:

  • For providers in a nested folder structure (e.g., common/sql), the name becomes common.sql.
  • Otherwise, the name is taken directly from the folder (e.g., amazon).

>=3.10 or ~=3.9, !=3.9 are treated as non-exclusions, as 3.10 is the lowest supported version. To handle this distinction, a constant called MIN_SUPPORTED_VERSION is used. This also ensures that when adding a new provider and having set requires-python = ">=3.10" in the pyproject.toml the hook does not fail.

Checks performed include:

  • Ensuring that the classifiers section in pyproject.toml does not list any excluded version from requires-python.
  • Verifying that the excluded versions across pyproject.toml and provider.yaml match and that this exclusion is also in the matrix in dev/breeze/global_constants.py .

Example output from the validation:

Bildschirmfoto 2025-07-14 um 00 21 48 Bildschirmfoto 2025-07-14 um 00 22 02

I've tested the logic with various test cases, but I'm happy to hear any feedback or corrections.

If this approach is deemed useful, I’d be keen to expand it further with documentation that clearly outlines how to exclude a provider for a specific python version.

@boring-cyborg boring-cyborg bot added area:dev-tools backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch labels Jul 14, 2025
@potiuk
Copy link
Member

potiuk commented Jul 15, 2025

Yeah. Good idea. It's a relative;u new development that requires some manual work. But I suggest to (re)do the automation after #46891 is merged.

@dominikhei
Copy link
Contributor Author

Yeah. Good idea. It's a relative;u new development that requires some manual work. But I suggest to (re)do the automation after #46891 is merged.

sounds good 👍

@potiuk
Copy link
Member

potiuk commented Jul 19, 2025

Merged. You can rebase and double check (And likely fix some things)

@dominikhei
Copy link
Contributor Author

Merged. You can rebase and double check (And likely fix some things)

Just came back from holidays, will rebase and test everything.

@kaxil kaxil removed the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Sep 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants