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

Providing millisecondes in timedelta does not work #372

Open
tcleonard opened this issue Nov 26, 2024 · 5 comments
Open

Providing millisecondes in timedelta does not work #372

tcleonard opened this issue Nov 26, 2024 · 5 comments

Comments

@tcleonard
Copy link

Providing a float amount of seconds in timedelta does not work

env.timedelta("NO_VALUE", default=42.3)

will have a value of 42 seconds, ignoring the decimal part.

A PR to solve this was already submitted #368 and closed with no valid reason

@ddelange
Copy link
Contributor

could this silent downcast be a ticket for marshmallow instead of for environs @sloria?

@sloria
Copy link
Owner

sloria commented Dec 5, 2024

@ddelange that's a good idea. would you mind reporting that?

@ddelange
Copy link
Contributor

ddelange commented Dec 6, 2024

MRE:

>>> from marshmallow import fields
>>> field = fields.TimeDelta()
>>> field.deserialize(2.9)
datetime.timedelta(seconds=2)

I'd like to report, but it looks like issues have been disabled: https://github.com/marshmallow-code/marshmallow/issues

@sloria
Copy link
Owner

sloria commented Dec 6, 2024

Yeah...issues are temporarily disabled as we're mitigating a spam attack

@ddelange
Copy link
Contributor

I've opened marshmallow-code/marshmallow#2654

with that, I think this issue and #368 can now be closed.

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

No branches or pull requests

3 participants