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

feat(python): check file target is not an existing directory #6187

Merged

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Jan 12, 2023

Closes #6181.

  • Raise explicit/helpful IsADirectoryError if file target already exists and is a directory.
  • Renamed format_path to normalise_filepath (now it's not just about formatting).

(As the existing format_path function was already centralised, this update covers all read/write functions that expect to be working with a file path, not just the write_csv method mentioned in the associated issue 👍)

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars labels Jan 12, 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.

Thanks! Looks good to me 😄

@ritchie46 ritchie46 merged commit 65bbfe6 into pola-rs:master Jan 12, 2023
@alexander-beedie alexander-beedie deleted the check-filepath-not-directory branch January 12, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PanicException in write_csv when directory with same name exists
3 participants