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

refactor(python): Add private LazyFrame method for setting sink optimizations #10988

Merged
merged 4 commits into from
Sep 8, 2023
Merged

refactor(python): Add private LazyFrame method for setting sink optimizations #10988

merged 4 commits into from
Sep 8, 2023

Conversation

svaningelgem
Copy link
Contributor

There were 3 occurences of the same code (and in PR #10786 there are 2 more), so generalizing these a bit.

(for now raising a ValueError as I need to know the exact return type for the type hinting)
@github-actions github-actions bot added internal An internal refactor or improvement python Related to Python Polars labels Sep 8, 2023
@svaningelgem svaningelgem marked this pull request as ready for review September 8, 2023 08:16
@stinodego stinodego changed the title chore(python): Generalize the common bits of sink_parquet/ipc/csv into 1 method. refactor(python): Generalize the common bits of sink_parquet/ipc/csv into 1 method. Sep 8, 2023
Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably a good idea, though ideally we'd extract the implementations of these methods to a separate module. But I'm working on that.

py-polars/polars/lazyframe/frame.py Outdated Show resolved Hide resolved
@stinodego
Copy link
Member

Thanks! Eliminating code duplication, one step at a time... :)

@stinodego stinodego changed the title refactor(python): Generalize the common bits of sink_parquet/ipc/csv into 1 method. refactor(python): Add private LazyFrame method for setting sink optimizations Sep 8, 2023
@stinodego stinodego merged commit 227dbc2 into pola-rs:main Sep 8, 2023
@svaningelgem svaningelgem deleted the chore/combine_generic_sinking_parameters branch September 8, 2023 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants