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: object inference in to_stata #56536

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

The "do X instead" won't actually work until 3.0, so this has to wait until then (and can't write the whatsnew until the 3.0 file exists). Putting this here so I don't forget about it.

@jbrockmendel jbrockmendel added Deprecate Functionality to remove in pandas IO Stata read_stata, to_stata labels Dec 17, 2023
@mroeschke mroeschke added this to the 3.0 milestone Dec 18, 2023
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Jan 18, 2024
@mroeschke
Copy link
Member

Now that we have the 3.0.0.rst file now, interested in following up?

@jbrockmendel
Copy link
Member Author

Going to hold off until #55901 goes in

@@ -429,6 +429,14 @@ def parse_dates_safe(
d["days"] = days_in_ns // NS_PER_DAY

elif infer_dtype(dates, skipna=False) == "datetime":
# - Deprecated casting object-dtype columns of datetimes to datetime64 when writing to stata; call df=df.infer_objects() before writing to stata instead (:issue:`??`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this comment a bit long?

Copy link
Member Author

Choose a reason for hiding this comment

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

will update

@jbrockmendel
Copy link
Member Author

it looks like we don't have any test cases that get to the relevant path. editing test_big_dates to use expected.astype(object).to_stata fails pretty badly; it looks like in the delta=True case by storing microseconds instead of milliseconds.

two options: first is to change the relevant path to call infer_objects() and then recurse, second is to just rip out the now-identified-as-buggy path. preferences?

@bashtage
Copy link
Contributor

Probably just take it out. Simplicity is its own reward.

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 IO Stata read_stata, to_stata Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants