This release of **pgmonkey** significantly enhances **CSV import reliability**, addressing **edge cases** related to **empty columns, single-column files, and structured data gaps**. Version **1.1.7** ensures more **robust data ingestion**, improved **error handling**, and better **column alignment** for **seamless PostgreSQL integration**.
---
🔧 **Improvements & Fixes**
✅ **Enhanced Handling of Empty Columns & Gaps:**
- Automatically **detects and removes empty columns** in CSV headers.
- Ensures **only valid columns** are imported, preventing schema mismatches.
- Properly handles **files with multiple empty columns** (beginning, middle, or end).
✅ **Improved Single-Column CSV Support:**
- Correctly identifies **single-column files** and **ignores delimiter-based parsing**.
- Prevents `"TypeError: 'delimiter' must be a 1-character string"` when importing single-column CSVs.
- **Supports automatic header detection**, even when empty lines precede the data.
✅ **Better Row Length Validation:**
- Ensures **column counts match between headers and data rows**.
- Prevents `"Row length mismatch: Expected X columns, got Y"` errors by dynamically aligning rows with headers.
- Allows **graceful skipping of trailing empty values** that previously caused import failures.
✅ **Optimized COPY Performance for Large Datasets:**
- Successfully tested with **12.7 million-row datasets** (NYC Taxi Data).
- Achieved peak import speeds of **134,000+ rows per second** using PostgreSQL’s `COPY` command.
- **Minimized memory overhead** while ensuring **efficient bulk ingestion**.
---
💡 **How to Upgrade**
To upgrade to the latest version, run:
bash
pip install pgmonkey --upgrade
Thank you for your continued support of **pgmonkey**! If you encounter any issues or have suggestions, please open an issue on our [[GitHub page](https://github.com/RexBytes/pgmonkey)](https://github.com/RexBytes/pgmonkey). Your feedback helps us make **pgmonkey** the best PostgreSQL management tool for your needs! 🚀🔥