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: Ensure series are contiguous prior to transpose #14527

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

mcrumiller
Copy link
Contributor

@mcrumiller mcrumiller commented Feb 16, 2024

Resolves #14524.

This changes the signature of transpose from &self to &mut self because it now rechunks...is this considered a breaking change?

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Feb 16, 2024
@mcrumiller mcrumiller marked this pull request as ready for review February 16, 2024 01:48
@mcrumiller mcrumiller marked this pull request as draft February 16, 2024 01:49
@ritchie46
Copy link
Member

You can make it a mutable method and call:

*self = self.as_single_chunk_par();

@mcrumiller mcrumiller marked this pull request as ready for review February 16, 2024 01:56
@mcrumiller
Copy link
Contributor Author

You can make it a mutable method and call:

*self = self.as_single_chunk_par();

Thanks @ritchie46 -- although then you can't call transpose on a dataframe unless it's declared mutable, and that doesn't seem like a good idea.

@ritchie46
Copy link
Member

We do this on more places.

@mcrumiller mcrumiller marked this pull request as draft February 16, 2024 02:17
@mcrumiller mcrumiller marked this pull request as ready for review February 16, 2024 02:32
@ritchie46 ritchie46 merged commit a405016 into pola-rs:main Feb 16, 2024
24 checks passed
@mcrumiller mcrumiller deleted the transpose-rechunk branch February 16, 2024 14:26
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 rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

df.transpose panics if any of its Series are not contiguous
2 participants