Skip to content

ENH: make guess_datetime_format public #54727

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

Closed
1 of 3 tasks
joefutrelle opened this issue Aug 24, 2023 · 14 comments · Fixed by #55079
Closed
1 of 3 tasks

ENH: make guess_datetime_format public #54727

joefutrelle opened this issue Aug 24, 2023 · 14 comments · Fixed by #55079
Assignees

Comments

@joefutrelle
Copy link

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

Pandas can infer datetime formats when parsing datetimes, but does not provide access to the inferred format via a public API.

Feature Description

Currently, guess_datetime_format is in pandas.core.tools.datetimes which is not public. Exporting it from a non-private module would address the issue.

Alternative Solutions

As far as I can tell, no other Python library provides this requested feature.

Additional Context

As discussed in dateutil/dateutil#1138

@joefutrelle joefutrelle added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 24, 2023
@MarcoGorelli MarcoGorelli added Datetime Datetime data dtype good first issue and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 24, 2023
@MarcoGorelli
Copy link
Member

sounds good - fancy making a pull request?

@nikhilreddy2002
Copy link

take

@nikhilreddy2002
Copy link

Hey @joefutrelle ,
I could not find guess_datetime_format are you referring to _guess_datetime_format_for_array?

@joefutrelle
Copy link
Author

joefutrelle commented Aug 24, 2023

If I read this correctly, the import into pandas.core.tools.datetimes is here and the implementation is here.

@nikhilreddy2002
Copy link

nikhilreddy2002 commented Aug 24, 2023

Hey @joefutrelle ,
From what I understood the guess_datetime_format should be moved to pandas.core.tools.datetimes, is this correct or is there some other place it should be. Or should I write a function in pandas.core.tools.datetimes which uses guess_datetime_format internally?

@joefutrelle
Copy link
Author

According to the docs, everything in pandas.core.* is private, so it would need to go somewhere else. to_datetime is at the top level and because this is related it could go there but I would defer to core developers on where the appropriate place for datetime utilities is.

The pandas.core, pandas.compat, and pandas.util top-level modules are PRIVATE. Stable functionality in such modules is not guaranteed.

@MarcoGorelli
Copy link
Member

How about adding pandas.api.tools, and putting this in there?

@MarcoGorelli
Copy link
Member

As suggested on Slack by @mroeschke , pandas.tseries might be a better place

@Birger9
Copy link

Birger9 commented Sep 1, 2023

Hi! Is see that @nikhilreddy2002 is assigned to this issue. But I can't see any activity the last week. I would like to start contributing to this project. I'm studying an open source course at University that requires us to get involved in an open source project. So I would love to contribute to Pandas codebase :) And this issue seems like a good start for me @joefutrelle

@MarcoGorelli
Copy link
Member

Sure go ahead thanks

@nnlnr
Copy link
Contributor

nnlnr commented Sep 8, 2023

👋 Hi there @Birger9, I hope you're doing well. I noticed that this issue hasn't seen any recent activity, and was wondering if you were still working on it? If not, would it be alright if I picked it up?

@MarcoGorelli
Copy link
Member

feel free to submit a pull request

@nnlnr
Copy link
Contributor

nnlnr commented Sep 8, 2023

ok great - thanks @MarcoGorelli!

@nnlnr
Copy link
Contributor

nnlnr commented Sep 8, 2023

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants