You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use AwareDateTime when generating field from DateTime(timezone=True) #407
Regarding using \NaiveDateTime\ when \ imezone=False\ (or omitted):
While symmetrical with \AwareDateTime\ for \ imezone=True, defaulting to \NaiveDateTime\ for standard \DateTime\ could be a breaking change for existing users who deserialize ISO 8601 strings with timezone offsets into standard columns (where marshmallow's default \ields.DateTime\ previously permitted it).
One gentle approach could be:
Keep default \sa.DateTime()\ mapped to \ields.DateTime\ for backward compatibility.
If desired, support explicit opt-in or an option to map \ imezone=False\ to \ields.NaiveDateTime\ when strict enforcement is wanted.
Happy to adapt PR #741 if the team prefers adding \NaiveDateTime\ mapping as well!
Activity
lafrech commentedon Oct 3, 2026
While we're at it, should we also use
NaiveDateTimein other cases?DYNOSuprovo commentedon Oct 4, 2026
Regarding using \NaiveDateTime\ when \ imezone=False\ (or omitted):
While symmetrical with \AwareDateTime\ for \ imezone=True, defaulting to \NaiveDateTime\ for standard \DateTime\ could be a breaking change for existing users who deserialize ISO 8601 strings with timezone offsets into standard columns (where marshmallow's default \ields.DateTime\ previously permitted it).
One gentle approach could be:
Happy to adapt PR #741 if the team prefers adding \NaiveDateTime\ mapping as well!