Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Raise suitable error on unsupported SQL set op syntax #18205

Merged

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Aug 15, 2024

We don't support the ALL modifier for EXCEPT and INTERSECT set ops in the SQL interface (yet - I know how we can add this, and plan to do so in the near future).

Until this support is implemented we need to make sure we raise a suitable error instead (ALL already did this, but the ALL BY NAME qualifier was sneaking through):

Example

import polars as pl

df1 = pl.DataFrame({"n": [1, 1, 1, 2, 2, 2, 3]})
df2 = pl.DataFrame({"n": [1, 1, 2, 2]})

pl.sql("SELECT * FROM df1 EXCEPT ALL BY NAME TABLE df2")
# SQLInterfaceError: 'EXCEPT ALL BY NAME' is not supported

Was previously returning (incorrectly) the same result as EXCEPT BY NAME.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Aug 15, 2024
@alexander-beedie alexander-beedie added the A-sql Area: Polars SQL functionality label Aug 15, 2024
Copy link

codecov bot commented Aug 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.22%. Comparing base (a284174) to head (304d953).
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18205      +/-   ##
==========================================
- Coverage   80.23%   80.22%   -0.01%     
==========================================
  Files        1500     1500              
  Lines      198871   198871              
  Branches     2837     2837              
==========================================
- Hits       159556   159550       -6     
- Misses      38788    38794       +6     
  Partials      527      527              

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

@ritchie46 ritchie46 merged commit 8070f4c into pola-rs:main Aug 19, 2024
26 checks passed
@alexander-beedie alexander-beedie deleted the sql-intersect-exclude-all-err branch August 19, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql Area: Polars SQL functionality fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants