Skip to content

Commit dbb9c15

Browse files
Merge branch 'main' into fix/python-udf-refcount-leak
2 parents 73fa4d4 + 625e2f8 commit dbb9c15

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

cmake/duckdb_loader.cmake

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,19 @@ function(_duckdb_validate_jemalloc_config)
115115
endif()
116116

117117
# jemalloc is only allowed in linux and osx debug builds
118-
set(supported_os
119-
CMAKE_SYSTEM_NAME
120-
STREQUAL
121-
"Darwin"
122-
OR
123-
CMAKE_SYSTEM_NAME
124-
STREQUAL
125-
"Linux")
126-
set(jemalloc_allowed CMAKE_BUILD_TYPE STREQUAL "Debug" AND supported_os)
118+
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
119+
set(supported_os TRUE)
120+
else()
121+
set(supported_os FALSE)
122+
endif()
123+
124+
# jemalloc is only allowed in debug builds
125+
if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND supported_os)
126+
set(jemalloc_allowed TRUE)
127+
else()
128+
set(jemalloc_allowed FALSE)
129+
endif()
130+
127131
if(NOT jemalloc_allowed)
128132
message(
129133
WARNING
@@ -247,6 +251,11 @@ function(duckdb_add_library target_name)
247251

248252
# Create clean interface target
249253
_duckdb_create_interface_target(${target_name})
254+
255+
# Propagate BUILD_EXTENSIONS back to caller scope in case it was modified
256+
set(BUILD_EXTENSIONS
257+
"${BUILD_EXTENSIONS}"
258+
PARENT_SCOPE)
250259
endfunction()
251260

252261
function(duckdb_link_extensions target_name)

src/duckdb_py/pyrelation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ unique_ptr<DuckDBPyRelation> DuckDBPyRelation::ProjectFromTypes(const py::object
153153
if (!projection.empty()) {
154154
projection += ", ";
155155
}
156-
projection += names[i];
156+
projection += KeywordHelper::WriteOptionallyQuoted(names[i]);
157157
}
158158
}
159159
if (projection.empty()) {

tests/fast/test_relation.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,3 +688,10 @@ def create_view(con, view_name: str) -> None:
688688

689689
res = con.sql("select * from vw").fetchall()
690690
assert res == expected
691+
692+
def test_relation_select_dtypes_quotes_identifiers_with_spaces(self, duckdb_cursor):
693+
df = pd.DataFrame({"na me": ["alice", "bob"], "x": [1, 2]})
694+
rel = duckdb_cursor.from_df(df)
695+
out = rel.select_dtypes([duckdb.sqltypes.VARCHAR]).fetchdf()
696+
assert list(out.columns) == ["na me"]
697+
assert out["na me"].tolist() == ["alice", "bob"]

0 commit comments

Comments
 (0)