Conversation
UsmanGhias
left a comment
There was a problem hiding this comment.
Hey there! This is a really nice fix for the fixture loading logic. Utilizing column.get_default_value() instead of hardcoding None ensures that optional columns properly fall back to their defined schema defaults when omitted from input files.
From a technical standpoint, I appreciate how clean the diff is. It integrates smoothly with the existing Pydantic model creation flow in piccolo/utils/pydantic.py. The added test coverage in test_dump_load.py alongside the schema updates in the mega app tables gives me a lot of confidence that this behaves correctly across different database types.
One minor thing to keep an eye on is making sure dynamic callables used as defaults (like timestamps or UUID generators) evaluate as expected during the Pydantic validation phase, but overall this looks solid and ready to ship.
Best,
Usman
This PR fixes an issue when columns with default values are missing in a loaded fixtures file.
Closes #1432