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

curate format-dates : --expected-date-formats builtins cannot be overridden #1707

Open
victorlin opened this issue Jan 7, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@victorlin
Copy link
Member

victorlin commented Jan 7, 2025

continuing a side discussion from #1654

Problem

--expected-date-formats has builtin date formats that cannot be overridden. If you have dates in %Y-%d-%m form, trying by un-overrideable builtin to parse them as %Y-%m-%d is going to be a bad time.¹

¹ #1709 (comment)

Possible solutions

  1. ⛔️ Change behavior so that --expected-date-formats overrides the builtins (should be termed "defaults" in this case) by using action=ExtendOverwriteDefault. This is likely to break lots of existing usage.
  2. 🚧 Continue letting --expected-date-formats append to the builtins and add another way to say you don't want the builtins (e.g. --no-builtin-date-formats flag or --override-expected-date-formats=FMT … option with args or something along those lines).
    • d9f2c0d started incorporating use of the "builtin" terminology
@victorlin
Copy link
Member Author

In in #1709 (comment), @joverlee521 clarified that the defaults were added after adf1e78, so I've reworded the issue description. Directly relevant discussion is also happening in that thread.

@victorlin
Copy link
Member Author

#1709 addresses the first part of option 2:

2. Continue letting --expected-date-formats append to the defaults (i.e. builtins) …

As for the second part,

… and add another way to say you don't want the defaults (e.g. --no-builtin-date-formats flag or --override-expected-date-formats=FMT … option with args or something along those lines).

my vote is for --no-builtin-date-formats since I think having both --expected-date-formats=FMT … and --override-expected-date-formats=FMT … is slightly more confusing and requires more implementation logic.

@victorlin victorlin changed the title curate format-dates : --expected-date-formats defaults cannot be overridden curate format-dates : --expected-date-formats builtins cannot be overridden Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant