michael-s-molina opened a new pull request, #37841:
URL: https://github.com/apache/superset/pull/37841

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   
   Upgrades sqlglot from `>=27.15.2, <28` to `>=28.10.0, <29`.
   
   **Why this change is needed:**
   - sqlglot v28 includes many bug fixes, improved type annotations, and better 
dialect support
   - Keeps Superset current with upstream improvements in SQL parsing and 
transpilation
   
   **Changelog review:**
   
   Reviewed all breaking changes from v27.15.2 to v28.10.0 in the [sqlglot 
changelog](https://github.com/tobymao/sqlglot/blob/main/CHANGELOG.md). The vast 
majority are additive changes (new function type annotations, transpilation 
improvements) that don't affect Superset. The only breaking changes impacting 
Superset were the arg name renames detailed below.
   
   **Breaking changes addressed:**
   
   sqlglot v28 renamed Python reserved keywords used as expression argument 
names:
   - `from` → `from_`
   - `with` → `with_`
   
   This required updates in `superset/sql/parse.py`:
   - `exp.Select(..., **{"from": ...})` → `exp.Select(..., from_=...)`
   - `"with" in self._parsed.args` → `"with_" in self._parsed.args`
   - `args["with"]` → `args["with_"]`
   
   Additionally, sqlglot v28 added a `YearOfWeek` expression class that 
normalizes `YEAROFWEEK` to `YEAR_OF_WEEK`. Added a generator transform in the 
Pinot dialect to preserve Pinot's expected function name.
   
   ### TESTING INSTRUCTIONS
   
   1. Run the SQL unit tests:
      ```bash
      pytest tests/unit_tests/sql/ -v
      ```
      Expected: All 986 tests pass
   
   2. Verify RLS (Row Level Security) functionality works correctly:
      ```bash
      pytest tests/unit_tests/sql/parse_tests.py::test_rls_subquery_transformer 
-v
      pytest 
tests/unit_tests/sql/parse_tests.py::test_rls_predicate_transformer -v
      ```
   
   3. Verify CTE handling:
      ```bash
      pytest tests/unit_tests/sql/parse_tests.py::test_has_cte -v
      pytest tests/unit_tests/sql/parse_tests.py::test_as_cte -v
      ```
   
   4. Verify Pinot dialect:
      ```bash
      pytest tests/unit_tests/sql/dialects/pinot_tests.py -v
      ```
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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