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(python): raise for pl.concat(how="align") when no columns are shared between frames #13941

Merged
merged 5 commits into from
Jan 26, 2024

Conversation

mcrumiller
Copy link
Contributor

Resolves #13939.

@deanm0000
Copy link
Collaborator

Shouldn't it be maybe invalid operation error https://github.com/pola-rs/polars/blob/main/py-polars/polars/exceptions.py or maybe schema error

@mcrumiller
Copy link
Contributor Author

Shouldn't it be maybe invalid operation error https://github.com/pola-rs/polars/blob/main/py-polars/polars/exceptions.py or maybe schema error

I think a SchemaError fits best. I'll set that for now and if someone else has a better reason for something else we can always switch. Thanks @deanm0000.

@alexander-beedie
Copy link
Collaborator

alexander-beedie commented Jan 24, 2024

Hmm, we might need to tweak our exception docstrings a bit; I'd classify this as an InvalidOperation rather than SchemaError as there is nothing wrong with the schemas of the input objects; rather, it's the operation itself (trying to combine objects that don't share common columns) that's invalid 🤔 @stinodego, interested on your take here!

@ritchie46
Copy link
Member

Must be InvalidOperation indeed. The inputs of the operations are not correct.

@mcrumiller
Copy link
Contributor Author

@stinodego this failed due to the now-fixed pytest markers, can you rerun the tests for this to make the red X go away?

@stinodego
Copy link
Member

@stinodego this failed due to the now-fixed pytest markers, can you rerun the tests for this to make the red X go away?

If you rebase the PR it should be fixed.

@ritchie46 ritchie46 merged commit 1bd3726 into pola-rs:main Jan 26, 2024
11 checks passed
@mcrumiller mcrumiller deleted the concat-align-error branch January 26, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pl.concat using how=align panics when schemas don't share keys
5 participants