Specify type "category" in read_sql #17862
Labels
Categorical
Categorical Data Type
Duplicate Report
Duplicate issue or pull request
IO SQL
to_sql, read_sql, read_sql_query
Would it be possible to add a feature allowing one to specify that a particular column to be downloaded via
read_sql
has a particular data type? I'm particularly interested in forcing certain dataframe columns to be categorical, to conserve memory usage.Yes, I could transform the data after receiving it from the database, but the datasets I'm working with are really large, causing huge memory usage high water marks. (An alternative is to break transfer the data in chunks and then transform the data in each chunk, but that complicates the code and, in my test runs, takes a little longer.)
The text was updated successfully, but these errors were encountered: