Skip to content

Commit

Permalink
feat: Remove outdated join validation checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Apr 16, 2024
1 parent 1868c6d commit c0833e9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions crates/polars-ops/src/frame/join/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,10 @@ impl JoinValidation {
}
}

pub fn is_valid_join(&self, join_type: &JoinType, n_keys: usize) -> PolarsResult<()> {
pub(super) fn is_valid_join(&self, join_type: &JoinType) -> PolarsResult<()> {
if !self.needs_checks() {
return Ok(());
}
polars_ensure!(n_keys == 1, ComputeError: "{self} validation on a {join_type} is not yet supported for multiple keys");
polars_ensure!(matches!(join_type, JoinType::Inner | JoinType::Outer{..} | JoinType::Left),
ComputeError: "{self} validation on a {join_type} join is not supported");
Ok(())
Expand Down
3 changes: 1 addition & 2 deletions crates/polars-ops/src/frame/join/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ pub trait DataFrameJoinOps: IntoDf {
_verbose: bool,
) -> PolarsResult<DataFrame> {
let left_df = self.to_df();
args.validation
.is_valid_join(&args.how, selected_left.len())?;
args.validation.is_valid_join(&args.how)?;

#[cfg(feature = "cross_join")]
if let JoinType::Cross = args.how {
Expand Down
1 change: 0 additions & 1 deletion py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -5872,7 +5872,6 @@ def join(
.. note::
- This is currently not supported the streaming engine.
- This is only supported when joined by single columns.
join_nulls
Join on null values. By default null values will never produce matches.
Expand Down
1 change: 0 additions & 1 deletion py-polars/polars/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3762,7 +3762,6 @@ def join(
.. note::
- This is currently not supported the streaming engine.
- This is only supported when joined by single columns.
join_nulls
Join on null values. By default null values will never produce matches.
allow_parallel
Expand Down

0 comments on commit c0833e9

Please sign in to comment.