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

[Bug in Parsing] Year needs four digits #182

Closed
Inf-inity opened this issue Jun 16, 2022 · 2 comments
Closed

[Bug in Parsing] Year needs four digits #182

Inf-inity opened this issue Jun 16, 2022 · 2 comments
Assignees
Labels
bug Something isn't working parser Used for any kinds of issues with the parser

Comments

@Inf-inity
Copy link
Collaborator

Inf-inity commented Jun 16, 2022

Given input

  1. 20.2.0791

  2. 20.2.791

Expected output

  1. 20-2-0791 0:00:00 (datetime)

  2. 20-2-0791 0:00:00 (datetime)

Actual given output

  1. 20-2-0791 0:00:00 (datetime)

  2. Parser returned None

Some extra notes

The parser can only handle years with 4 digits, but these digits can be 0 too.

@Inf-inity Inf-inity added the parser Used for any kinds of issues with the parser label Jun 16, 2022
@Inf-inity Inf-inity added the bug Something isn't working label Jun 16, 2022
@Inf-inity Inf-inity changed the title [Bug in Parsing] Year needs for digits [Bug in Parsing] Year needs four digits Jul 16, 2022
@Ari24-cb24 Ari24-cb24 added this to the Production Ready milestone Aug 23, 2022
@Ari24-cb24
Copy link
Member

Datetime' strptime method is not capable of parsing such format. Dateutil is actually able to do that but their isoparse isn't as extensive as I would've hoped. I may have to write our own isoparse parser

@Ari24-cb24
Copy link
Member

I decieded against it as this only affects three digit years. First of all, an implementation would worsen runtime performance and second of all this does not make sense for two or one digit year. Take for example 01.02.10. You are not able to recognize whetever the 10 is the year or the 01. I strongly advocate the use of zero-padded years

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser Used for any kinds of issues with the parser
Projects
None yet
Development

No branches or pull requests

2 participants