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

Mirror pandas' to_csv lineterminator instead of line_terminator #595

Merged
merged 24 commits into from
Feb 23, 2024

Conversation

bartbroere
Copy link
Contributor

@bartbroere bartbroere commented Sep 7, 2023

Let's mirror pandas' convention, even though it looks a little weird perhaps.

I believe the argument line_terminator is now ignored when it eventually ends up in the to_csv method of pandas as a kwarg, so I would classify this PR as a bugfix.

@bartbroere bartbroere changed the title Mirror pandas' to_csv lineterminator instead of line_terminator Mirror pandas' to_csv lineterminator instead of line_terminator and remove squeeze Sep 7, 2023
@bartbroere bartbroere changed the title Mirror pandas' to_csv lineterminator instead of line_terminator and remove squeeze Mirror pandas' to_csv lineterminator instead of line_terminator Sep 11, 2023
@bartbroere
Copy link
Contributor Author

I think this one is safe to merge. @pquentin Can we run the test suite?

@pquentin
Copy link
Member

buildkite test this please

@pquentin
Copy link
Member

I'm sorry about the subpar contributing experience, and the lack of reviews. What worries me a bit here is that any code that has been using line_terminator is now going to fail.

@davidkyle Is that a concern?

@davidkyle
Copy link
Member

The Pandas docs (v2.1.1) indicate the parameter should be lineterminator without the underscore

https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html

However Pandas 1.4 uses line_terminator

https://pandas.pydata.org/pandas-docs/version/1.4/reference/api/pandas.DataFrame.to_csv.html

So this is a fix and is required but let's merge it with the change to upgrade Pandas to 2.0 but not beforehand as it could break users with Pandas 1.4.

Also there is no need to rename the Eland parameter, we can just change the parameter sent to Pandas that way we don't break users of the Eland API.

@davidkyle
Copy link
Member

@bartbroere echoing what @pquentin said thank you for all of your contributions and I'm also sorry the review process is not as fast as we would like. An extra thank you for you patience

@bartbroere
Copy link
Contributor Author

@pquentin @davidkyle Thanks for the review, and no worries if it takes some time.

About the review:

Also there is no need to rename the Eland parameter, we can just change the parameter sent to Pandas that way we don't break users of the Eland API.

So if we don't change the parameter (but do change how it's passed to pandas), we could merge a part of this change now already, and maybe rename the parameter with a breaking release of eland? I'll push that commit now to see if you agree.

@pquentin
Copy link
Member

buildkite test this please

@davidkyle
Copy link
Member

buildkite test this please

@davidkyle
Copy link
Member

buildkite test this please

@davidkyle
Copy link
Member

@bartbroere I pushed a change adding the deprecation warning in 7290f7e

@pquentin
Copy link
Member

buildkite test this please

@bartbroere
Copy link
Contributor Author

@bartbroere I pushed a change adding the deprecation warning in 7290f7e

Thanks! I was a bit hesitant to add this myself, since I can't really decide that.

@pquentin
Copy link
Member

pquentin commented Feb 8, 2024

buildkite test this please

@pquentin pquentin merged commit 9b33531 into elastic:main Feb 23, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants