Skip to content

Conversation

@magopian
Copy link
Contributor

Fixes #1456

Comment on lines +26 to +28
# This is needed or the test will fail if you have a search service configured in your udata.cfg file.
current_app.config["SEARCH_SERVICE_API_URL"] = ""

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unrelated to this PR, but this test will fail if you have a search service configured, which I needed to fix this PR ;)

Comment on lines +56 to +57
# This is needed or the test will fail if you have a search service configured in your udata.cfg file.
current_app.config["SEARCH_SERVICE_API_URL"] = ""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unrelated to this PR, but this test will fail if you have a search service configured, which I needed to fix this PR ;)

@magopian magopian requested review from bolinocroustibat and maudetes and removed request for maudetes November 19, 2024 17:33
Copy link
Contributor

@maudetes maudetes left a comment

Choose a reason for hiding this comment

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

Thank you for this PR!
I think the multiplication of endpoints and API shows all the small consistencies issues sadly

# HACK: use the `.__class__.__name__` to avoid having to import `BoolFilter` here, as importing it at the top would make a import loop.
if self.adapter.filters[name].__class__.__name__ == "BoolFilter":
# The search service uses 1 and 0 for booleans.
param_value = 1 if value == "true" else 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Somehow on udata-search-service side, featured is not set to 0 or 1 but 1 or 4 (probably for poorly decided scoring reasons) 🥲

# HACK: use the `.__class__.__name__` to avoid having to import `BoolFilter` here, as importing it at the top would make a import loop.
if self.adapter.filters[name].__class__.__name__ == "BoolFilter":
# The search service uses 1 and 0 for booleans.
param_value = 1 if value == "true" else 0
Copy link
Contributor

Choose a reason for hiding this comment

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

I think if value is True and not true when it comes from the udata-front search view: /fr/datasets/

@ThibaudDauce ThibaudDauce changed the title Convert bool filters to 0 or 1 when querying the search service fix(search): convert bool filters to 0 or 1 when querying the search service Oct 2, 2025
@ThibaudDauce ThibaudDauce marked this pull request as draft October 2, 2025 15:01
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.

Corriger le bug sur le paramètre featured

2 participants