Repository navigation
Release v0.2.2
Release Notes - v0.2.2
π Enhanced Date and Timestamp Support
This release significantly improves how psycopg-toolkit handles PostgreSQL date and timestamp fields, making it easier to work with temporal data across your applications.
β¨ New Features
- Full TIMESTAMP Support: The
date_fieldsparameter now properly handles PostgreSQLTIMESTAMPandTIMESTAMPTZcolumns in addition toDATEcolumns - Unified Date/DateTime Conversion: Both
datetime.dateanddatetime.datetimeobjects are now seamlessly converted to ISO format strings for Pydantic models - Comprehensive Field Coverage: You can now include all temporal fields (DATE, TIMESTAMP, TIMESTAMPTZ) in the
date_fieldsparameter for consistent handling
π Bug Fixes
- Fixed Duplicate Processing: Removed duplicate date field processing logic in
_postprocess_datamethod that could cause performance issues - Improved Type Handling: Better detection and conversion of both date and datetime objects from PostgreSQL
π Documentation Improvements
- Enhanced Examples: Updated
array_and_date_fields.pyexample to demonstrate proper TIMESTAMP usage - Clearer Guidelines: Added comprehensive documentation explaining when and how to use
date_fieldsfor all temporal column types - Common Pitfalls Section: New documentation section highlighting typical mistakes and their solutions
- Expected Warnings Note: Added clarification about expected "Failed to deserialize JSON field" warnings when using
auto_detect_json=True
π§ͺ Testing
- New Test Coverage: Added specific tests for datetime field conversion to ensure reliability
- Expanded Test Suite: Enhanced existing date field tests to cover more edge cases
π‘ Usage Updates
Before v0.2.2:
date_fields={"birthdate"} # Only DATE columnsAfter v0.2.2:
date_fields={"birthdate", "created_at", "updated_at", "last_login"} # ALL temporal fieldsβ οΈ Important Notes
- Migration Recommended: If you're using timestamp fields, update your
date_fieldsconfiguration to include all temporal columns for consistent behavior - No Breaking Changes: Existing code will continue to work, but you may want to expand your
date_fieldsconfiguration to take advantage of the improved timestamp support
π§ Technical Details
- Enhanced
_preprocess_dataand_postprocess_datamethods for better temporal field handling - Improved logging to distinguish between date and datetime conversions
- Better error handling for edge cases in temporal data processing