Pandas Not a Time (NaT) value raises TypeError when being converted into a <datetime | None> column type using model_validate() #1734
-
First Check
Commit to Help
Example CodeDescription
Cause
Workaround
Operating SystemLinux Operating System DetailsLinux nixos 6.12.59 #1-NixOS SMP PREEMPT_DYNAMIC Mon Nov 24 09:36:08 UTC 2025 x86_64 GNU/Linux SQLModel Version0.0.24 Python Version3.12.12 Additional ContextUsing pandas 2.3.1 |
Beta Was this translation helpful? Give feedback.
Answered by
YuriiMotov
Feb 3, 2026
Replies: 1 comment 1 reply
-
|
Does it work with pure Pydantic model? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I checked it works the same way with Pydantic model. So, it's not an SQLModel's issue.
You can solve this by adding a
field_validatorto convertNaTtoNone: