Skip to content

[FIX-135]: Fix automatic converstion of float values to int #136

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

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

ahuarte47
Copy link
Contributor

Related Issue(s):

Description:
Searching items filtering by properties with floats returns wrong results. Clause converts input query to ES filter using this Union. Because int is defined before float, all numeric values are converted to integer.

This fix takes care of value types, do not converting floats to int.

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable
  • Changes are added to the changelog

@ahuarte47 ahuarte47 force-pushed the main_fix-filters-with-floats branch 2 times, most recently from 2d6fba5 to 13e07af Compare January 28, 2023 12:18
@ahuarte47 ahuarte47 force-pushed the main_fix-filters-with-floats branch from 13e07af to 34dea4b Compare January 28, 2023 12:20
@ahuarte47
Copy link
Contributor Author

That 3 failed tests are working in local and IMHO not related with this fix:

  • tests/resources/test_item.py::test_field_extension_post - IndexError: list index out of range
  • tests/resources/test_item.py::test_field_extension_exclude_and_include - IndexError: list index out of range
  • tests/resources/test_item.py::test_field_extension_exclude_default_includes - IndexError: list index out of range

Copy link
Collaborator

@jonhealy1 jonhealy1 left a comment

Choose a reason for hiding this comment

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

Nice!

@jonhealy1 jonhealy1 merged commit 4e12664 into stac-utils:main Feb 1, 2023
@ahuarte47
Copy link
Contributor Author

Thanks @jonhealy1 and @philvarner !

@ahuarte47 ahuarte47 deleted the main_fix-filters-with-floats branch February 1, 2023 15:17
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