rusackas opened a new pull request, #42007:
URL: https://github.com/apache/superset/pull/42007

   ### SUMMARY
   
   Master CI has been intermittently red since #41952 bumped `syntaqlite` 0.4.2 
→ 0.6.0.
   
   `syntaqlite` 0.5.0+ (including 0.6.0) imports `StrEnum` from the stdlib 
`enum` module **unconditionally**:
   
   ```python
   # syntaqlite/__init__.py
   from enum import IntEnum, StrEnum
   ```
   
   `enum.StrEnum` was only added in **Python 3.11**, yet the package still 
declares `requires-python>=3.10`. Superset supports Python 3.10, and 
`superset/sql_validators/sqlite.py` imports `syntaqlite` on the app-init import 
path (`init_views` → `databases.api` → `validate_sql` → `sql_validators`), so 
**any test that builds the app fails at import time on Python 3.10**:
   
   ```
   File ".../syntaqlite/__init__.py", line 21, in <module>
       from enum import IntEnum, StrEnum
   ImportError: cannot import name 'StrEnum' from 'enum'
   ```
   
   **Why it slipped through PR CI and only broke master:** the `Python-Unit` / 
`Python-Integration` matrices run the `previous` (Python 3.10) leg **only on 
pushes to master** — PRs run the `current` (3.11) leg only. So #41952 merged 
green, and the break surfaces on the next push to master that touches Python 
files (the `changes` filter skips the matrix otherwise, which is why some 
master commits still show green).
   
   ### FIX
   
   - Revert the pin to the last 3.10-safe range: `<0.5.0` for the `sqlite` 
extra, `>=0.4.2,<0.5.0` for `development`, and `syntaqlite==0.4.2` in 
`requirements/development.txt`. (`0.4.2` has no `StrEnum` import; `0.5.1` 
already added it.)
   - Add a Dependabot `ignore` entry for `syntaqlite` so it is not immediately 
re-bumped past `0.5.0` until Superset drops Python 3.10.
   - Add explanatory comments at each pin so the constraint isn't "fixed" 
blindly later.
   
   ### TESTING INSTRUCTIONS
   
   On Python 3.10, before this change `python -c "import 
superset.sql_validators.sqlite"` raises `ImportError: cannot import name 
'StrEnum'`; after pinning back to `syntaqlite==0.4.2` the import succeeds. CI's 
`Python-Unit` / `Python-Integration` `previous` (3.10) legs go green.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   Upstream fix would be for `syntaqlite` to guard the `StrEnum` import (as 
Superset itself does in `superset/utils/backports.py`) or to raise its 
`requires-python` to `>=3.11`. This PR just unblocks master in the meantime.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to