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

remove FUZZY setting #794

Merged
merged 1 commit into from
Sep 30, 2020
Merged

Conversation

noviluni
Copy link
Collaborator

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 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
Member

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
Collaborator 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
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