Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions superset/common/utils/dataframe_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ def left_join_df(
join_keys: list[str],
lsuffix: str = "",
rsuffix: str = "",
how: Literal["left", "right", "inner", "outer", "cross"] = "left",
how: Literal["left", "right", "inner", "outer"] = "left",
) -> pd.DataFrame:
# `how` defaults to "left" so callers that only want the left frame's rows are
# unaffected. Passing how="outer" keeps right-only rows, which is used by the
# time-comparison "full range" option so historical series are not truncated to
# the main series' time range.
# the main series' time range. "cross" is intentionally excluded: the join is
# implemented via `Index.join`, which doesn't support cross joins the way
# `pd.merge` does, so passing "cross" here would silently drop the join keys
# instead of producing a real cross join.
df = left_df.set_index(join_keys).join(
right_df.set_index(join_keys), how=how, lsuffix=lsuffix, rsuffix=rsuffix
)
Expand Down
2 changes: 1 addition & 1 deletion superset/models/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2705,7 +2705,7 @@ def _perform_join(
df: pd.DataFrame,
offset_df: pd.DataFrame,
actual_join_keys: list[str],
how: Literal["left", "right", "inner", "outer", "cross"] = "left",
how: Literal["left", "right", "inner", "outer"] = "left",
) -> pd.DataFrame:
"""Perform the appropriate join operation."""
if actual_join_keys:
Expand Down
Loading