File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ static NumpyNullableType ConvertNumpyTypeInternal(const string &col_type_str) {
5858 if (col_type_str == " string" ) {
5959 return NumpyNullableType::STRING;
6060 }
61+ if (col_type_str == " str" ) {
62+ return NumpyNullableType::STRING;
63+ }
6164 if (col_type_str == " object" ) {
6265 return NumpyNullableType::OBJECT;
6366 }
Original file line number Diff line number Diff line change 1+ import pandas as pd
2+ import pytest
3+ from packaging .version import Version
4+
5+ import duckdb
6+
7+
8+ @pytest .mark .skipif (
9+ Version (pd .__version__ ) < Version ("3.0" ), reason = "Pandas < 3.0 doesn't have the new string type yet"
10+ )
11+ def test_new_str_type_pandas_3_0 ():
12+ df = pd .DataFrame ({"s" : ["DuckDB" ]}) # noqa: F841
13+ duckdb .sql ("select * from df" )
14+
15+
16+ @pytest .mark .skipif (Version (pd .__version__ ) >= Version ("3.0" ), reason = "Pandas >= 3.0 has the new string type" )
17+ def test_new_str_type_pandas_lt_3_0 ():
18+ pd .options .future .infer_string = True
19+ df = pd .DataFrame ({"s" : ["DuckDB" ]}) # noqa: F841
20+ duckdb .sql ("select * from df" )
You can’t perform that action at this time.
0 commit comments