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

Fix a bug in bf_search regarding boolean values #422

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

MaxDall
Copy link
Collaborator

@MaxDall MaxDall commented Apr 18, 2024

There was a nasty bug in LD.bf_search basically rendering the parsing of boolean values unusable. This PR fixes this issue by introducing a new sentinel value and fixing some logic bugs.

One problem this could cause is that now the free_access attribute finally works as intended and this may cause some trouble since the publishers won't set it honestly.

Update: I opened another PR #423 to address this

@MaxDall MaxDall requested review from dobbersc and addie9800 and removed request for dobbersc April 18, 2024 13:58
Copy link
Collaborator

@addie9800 addie9800 left a comment

Choose a reason for hiding this comment

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

Is there a reason to create the _sentinel object instead of using None?

@MaxDall
Copy link
Collaborator Author

MaxDall commented Apr 19, 2024

Is there a reason to create the _sentinel object instead of using None?

The sentinel is unique whereas None isn't. One could not differentiate if the value of a key was None or not present at all and thus default would be returned for all None values, besides it only should be returned when the key isn't present.

Copy link
Collaborator

@addie9800 addie9800 left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation, that makes sense. Looks good and thanks for catching this 👍

@MaxDall MaxDall merged commit 927f651 into master Apr 19, 2024
4 checks passed
@MaxDall MaxDall deleted the fix-a-bug-in-ld-bfsearch branch April 19, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants