Skip to content

models.DecimalField no longer supported? #340

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

Closed
giilby opened this issue Jan 22, 2025 · 2 comments · Fixed by algolia/api-clients-automation#4618
Closed

models.DecimalField no longer supported? #340

giilby opened this issue Jan 22, 2025 · 2 comments · Fixed by algolia/api-clients-automation#4618

Comments

@giilby
Copy link

giilby commented Jan 22, 2025

Maybe this is actually an issue with a newer version of https://github.com/algolia/algoliasearch-client-python, but in any case, after upgrading to v4.0.0 of this package + v4.13.0 of the python client, indexing models with models.DecimalField fields fails with this error:

AttributeError: 'decimal.Decimal' object has no attribute 'to_dict'

@Enase
Copy link

Enase commented Mar 21, 2025

same here, would be great to add:

    elif isinstance(obj, Decimal):
        return float(obj)

here https://github.com/algolia/algoliasearch-client-python/blob/main/algoliasearch/http/serializer.py#L64

@shortcuts
Copy link
Member

Thanks! I'll release asap :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants