This fix ensures that JSON and JSONB data from databases (like PostgreSQL)
is preserved as Python objects (dicts/lists) when converting result sets
to pandas DataFrames. Previously, nested data types were being stringified,
which broke features like Handlebars templates that need to access JSON
data as objects rather than strings.
The fix works by:
1. Tracking columns with nested/JSON data before stringification
2. Restoring the original Python objects when converting to pandas
Fixes#25125
Co-Authored-By: Claude <noreply@anthropic.com>