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

   Follow-up to #41334.
   
   ### SUMMARY
   
   `left_join_df`'s `how` parameter is typed `Literal["left", "right", "inner", 
"outer", "cross"]`, but the join is implemented via 
`DataFrame.set_index(...).join(...)`, whose underlying `Index.join` doesn't 
support `"cross"` the way `pd.merge` does. Passing `how="cross"` silently drops 
the join keys instead of producing a real cross join, so the type signature was 
advertising a mode that doesn't actually work.
   
   This removes `"cross"` from the `Literal` in `left_join_df` 
(`superset/common/utils/dataframe_utils.py`). `ExploreMixin._perform_join` in 
`superset/models/helpers.py` forwards its own `how` parameter straight into 
`left_join_df`, so its signature is narrowed the same way to keep mypy happy 
and stay consistent.
   
   Neither function is ever called with `how="cross"` today (`join_offset_dfs`, 
the only caller, only ever passes `"left"` or `"outer"` for the time-comparison 
full-range option added in #41334), so this is a type-only fix with no behavior 
change.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A - type-only change, no UI impact.
   
   ### TESTING INSTRUCTIONS
   
   - `pytest tests/unit_tests/common/test_time_shifts.py` and `pytest 
tests/unit_tests/common/test_query_context_processor.py -k join` still pass.
   - `pre-commit run` (including mypy) passes on the changed files, confirming 
the narrower type doesn't break the one call site.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] 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