Open
Description
Pandas version checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
import panda as pd
from sqlalchemy.types import DOUBLE
data = # Panda Datafrme with timestamp, double and string along with different column types.
column_types_filtered_data = {col: DOUBLE() for col in data.columns}
data.to_sql(..., dtype=column_types_filtered_data)
Issue Description
For any type other than str this block in pandas.io.sql will fail.
for col, my_type in dtype.items():
if not isinstance(my_type, str):
raise ValueError(f"{col} ({my_type}) not a string")
Expected Behavior
Different datatypes should be supported.
Installed Versions
pandas==2.2.3
Metadata
Metadata
Assignees
Labels
to_sql, read_sql, read_sql_queryto_sql, read_sql, read_sql_queryClarification about behavior needed to assess issueClarification about behavior needed to assess issue