Skip to content

fix(common): remove unsupported cross join mode from left_join_df - #43016

Merged
rusackas merged 1 commit into
masterfrom
fix/followup-41334-follow-up-from-41334-feat-explore-add-fu
Aug 11, 2026
Merged

fix(common): remove unsupported cross join mode from left_join_df#43016
rusackas merged 1 commit into
masterfrom
fix/followup-41334-follow-up-from-41334-feat-explore-add-fu

Conversation

@rusackas

Copy link
Copy Markdown
Member

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

left_join_df's how parameter advertised Literal["left", "right", "inner",
"outer", "cross"], but the join is implemented via
DataFrame.set_index(...).join(...), whose underlying Index.join does not
support "cross" the way pd.merge does -- passing how="cross" silently
drops the join keys instead of producing a real cross join. Narrow the
type to the modes that are actually supported. _perform_join in
models/helpers.py forwards its own how parameter straight into
left_join_df, so its signature is narrowed the same way to stay
consistent.

Follow-up to #41334.

Co-Authored-By: Claude <noreply@anthropic.com>
@dosubot dosubot Bot added the change:backend Requires changing the backend label Aug 10, 2026
@bito-code-review

bito-code-review Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #f53926

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: eb321ba..eb321ba
    • superset/common/utils/dataframe_utils.py
    • superset/models/helpers.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.59%. Comparing base (0dedc55) to head (eb321ba).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #43016   +/-   ##
=======================================
  Coverage   66.59%   66.59%           
=======================================
  Files        2863     2863           
  Lines      161681   161681           
  Branches    37249    37249           
=======================================
  Hits       107678   107678           
  Misses      51961    51961           
  Partials     2042     2042           
Flag Coverage Δ
hive 38.21% <ø> (ø)
mysql 57.76% <ø> (ø)
postgres 57.81% <ø> (ø)
presto 40.18% <ø> (ø)
python 59.20% <ø> (ø)
sqlite 57.43% <ø> (ø)
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens type annotations around Superset’s DataFrame join helpers to match actual pandas join capabilities, removing an advertised "cross" join mode that isn’t supported by the underlying DataFrame.set_index(...).join(...) implementation.

Changes:

  • Narrow left_join_df(..., how=...) to exclude "cross" from its Literal[...] type.
  • Narrow ExploreMixin._perform_join(..., how=...) to the same set of supported join modes to keep typing consistent.
  • Add an inline comment documenting why "cross" is intentionally unsupported here.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
superset/common/utils/dataframe_utils.py Removes "cross" from left_join_df’s how type and documents the limitation of the join implementation.
superset/models/helpers.py Narrows _perform_join’s how type to match left_join_df and avoid propagating an unsupported mode.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sha174n sha174n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. cross was never valid for the Index.join path anyway, so narrowing the Literal is correct and cannot affect valid callers. CI green.

@rusackas
rusackas merged commit e31a894 into master Aug 11, 2026
77 checks passed
@rusackas
rusackas deleted the fix/followup-41334-follow-up-from-41334-feat-explore-add-fu branch August 11, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:backend Requires changing the backend preset-io size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants