Skip to content

remove FUZZY setting - #794

Merged
noviluni merged 1 commit into
scrapinghub:masterfrom
noviluni:delete_FUZZY_setting
Sep 30, 2020
Merged

noviluni merged 1 commit into
scrapinghub:masterfrom
noviluni:delete_FUZZY_setting

Conversation

@noviluni

Copy link
Copy Markdown
Contributor

As mentioned here: #722

I removed the FUZZY setting as:

  • It has been never documented
  • There isn't any known use case where a user needs to change it.
  • There are 0 references in issues

@noviluni noviluni added this to the v1.0.0 milestone Sep 24, 2020
@noviluni
noviluni requested a review from Gallaecio September 24, 2020 16:12
Comment thread dateparser/parser.py
Comment on lines -399 to -405
if self.settings.FUZZY:
attr_truth_values = []
for attr in ['day', 'month', 'year', 'time']:
attr_truth_values.append(getattr(self, attr, False))

if not any(attr_truth_values):
raise ValueError('Nothing date like found')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like the purpose of fuzzy is to only return a date if all those elements can be extracted for that date. Is that not a scenario that makes sense? Or is it that it does not work? (i.e. does the test also pass if it is set to False?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @Gallaecio, there are several reasons to remove this setting:

  1. Is not documented.
  2. Only applies to absolute-parser.
  3. Has a confusing name ("when Fuzzy is True then raise an error if the date is not complete" does this make sense for you? The semanthics are really bad.
  4. We have the STRICT_PARSING setting which is documented and works better as well as REQUIRE_PARTS, that can be used with the same purpose.

@noviluni noviluni mentioned this pull request Sep 25, 2020
3 of 4 tasks
@noviluni
noviluni requested a review from Gallaecio September 28, 2020 09:18
@noviluni
noviluni merged commit 99e3736 into scrapinghub:master Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants