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

DEPR: Positional arguments in to_* I/O methods #54229

Closed
16 of 17 tasks
lithomas1 opened this issue Jul 22, 2023 · 20 comments · Fixed by #54703
Closed
16 of 17 tasks

DEPR: Positional arguments in to_* I/O methods #54229

lithomas1 opened this issue Jul 22, 2023 · 20 comments · Fixed by #54703
Assignees
Labels
Deprecate Functionality to remove in pandas good first issue IO Data IO issues that don't fit into a more specific label

Comments

@lithomas1
Copy link
Member

lithomas1 commented Jul 22, 2023

These should all be keyword only except for buf/path_or_buf argument (the first one).

  • to_csv
  • to_orc
  • to_parquet
  • to_pickle
  • to_hdf
  • to_sql
  • to_dict
  • to_excel
  • to_json
  • to_html
  • to_feather
  • to_latex
  • to_stata
  • to_gbq
  • to_string
  • to_clipboard
  • to_markdown

cc @MarcoGorelli since you championed the last effort

@lithomas1 lithomas1 added IO Data IO issues that don't fit into a more specific label Deprecate Functionality to remove in pandas labels Jul 22, 2023
@rmhowe425
Copy link
Contributor

take

@lithomas1
Copy link
Member Author

lithomas1 commented Aug 16, 2023

Going to mark this as a good first issue.

See #41485 as a starting point for how to do this.

You are basically doing the same, but for the to_* methods, and the only keyword that should be allowed to be positional (and not keyword only) is the first one specifying the buffer/file to write to.

(Please add your whatsnew to v2.2.0.rst for now.

In the future, if this issue is still open after 2.2.0 comes out, pick the whatsnew corresponding to the newest release that ends in a zero. e.g. v2.3.0.rst, ...)

If you need any help, please ask on Slack (#newcomers channel) to avoid cluttering up this issue, but if you'd like to take one of the methods, just comment which one you want below.

@rsm-23
Copy link
Contributor

rsm-23 commented Aug 17, 2023

I'll take to_pickle

@rsm-23
Copy link
Contributor

rsm-23 commented Aug 17, 2023

Taking to_string

@rsm-23
Copy link
Contributor

rsm-23 commented Aug 17, 2023

taking to_latex and to_stata and to_markdown

@rsm-23
Copy link
Contributor

rsm-23 commented Aug 17, 2023

@mroeschke @lithomas1 can one of you please review this #54599

@rmhowe425
Copy link
Contributor

I have a PR opened for to_hdf

@rsm-23
Copy link
Contributor

rsm-23 commented Aug 17, 2023

to avoid cluttering up this issue, but if you'd like to take one of the methods, just comment which one you want below.

Hey @rmhowe425 , I took some of the other methods. Would it be okay if I help out with the ones I already selected? Also do you plan to work on all the methods by yourself?

@rmhowe425
Copy link
Contributor

@rsm-23 Feel free to tackle any and all methods excluding to_hdf! That's the last one that I'll be working on! Once the PR is approved I'll unassign myself from the issue

@lithomas1
Copy link
Member Author

@rmhowe425
Sorry,
I didn't mean to unassign you from the PR if you wanted to keep going on all the methods (also I apologize for the lack of guidance on your other PR)!
I totally forgot to put what I put in my second comment in the PR description.

If you'd like something else to work on, I can go and look at/breakdown some other issues.

@rsm-23
Copy link
Contributor

rsm-23 commented Aug 17, 2023

@rmhowe425 sorry for misreading the situation here. To resolve the situation here, I am fine with closing my PRs. You can continue to work on the whole issue.
cc: @lithomas1

@rmhowe425
Copy link
Contributor

I think I was a bit confused as well! All good!

@rsm-23 Looks like you're tackling these at lightning speed! Feel free to continue working your way down the list of methods! After my PR forto_hdf is completed I'll unassign myself from this issue and find another issue to work on!

@rmhowe425
Copy link
Contributor

@rsm-23 Just unassigned myself from the issue if you want to take it

@rsm-23
Copy link
Contributor

rsm-23 commented Aug 18, 2023

take

@rsm-23
Copy link
Contributor

rsm-23 commented Aug 18, 2023

to_feather has only one named parameter and to_clipboard doesn't have a path/buf parameter, should we also remove them from the list @mroeschke ?
edit: Similar for to_dict method, it doesn't have a path/buf parameter either.

@mroeschke
Copy link
Member

to_feather has only one named parameter and to_clipboard doesn't have a path/buf parameter, should we also remove them from the list @mroeschke ? edit: Similar for to_dict method, it doesn't have a path/buf parameter either.

For to_dict and to_clipboard its good to make the arguments keyword only

@rsm-23
Copy link
Contributor

rsm-23 commented Aug 18, 2023

@mroeschke for to_orc it's the same as to_stata, positional arguments is already enforced.
Need a small clarification on to_excel and to_gbq: instead of path/buf do we go with excel_writer and destination_table respectively?

@rsm-23
Copy link
Contributor

rsm-23 commented Aug 22, 2023

hey @mroeschke can you please update the above checklist? Want to cross-check what else is pending? Also,

Need a small clarification on to_excel and to_gbq: instead of path/buf do we go with excel_writer and destination_table respectively?

@mroeschke
Copy link
Member

Need a small clarification on to_excel and to_gbq: instead of path/buf do we go with excel_writer and destination_table respectively?

Yup those sound good

@rsm-23
Copy link
Contributor

rsm-23 commented Aug 23, 2023

@mroeschke to_markdown is already merged in this PR , can you please update that as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas good first issue IO Data IO issues that don't fit into a more specific label
Projects
None yet
4 participants