File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424#include " duckdb_python/arrow/arrow_export_utils.hpp"
2525
2626namespace duckdb {
27- namespace {
28- std::string QuoteIdentifier (const std::string &name) {
29- std::string out;
30- out.reserve (name.size () + 2 );
31- out.push_back (' "' );
32- for (char c : name) {
33- if (c == ' "' ) {
34- out.push_back (' "' ); // escape " as ""
35- }
36- out.push_back (c);
37- }
38- out.push_back (' "' );
39- return out;
40- }
41- } // namespace
4227
4328DuckDBPyRelation::DuckDBPyRelation (shared_ptr<Relation> rel_p) : rel(std::move(rel_p)) {
4429 if (!rel) {
@@ -168,7 +153,7 @@ unique_ptr<DuckDBPyRelation> DuckDBPyRelation::ProjectFromTypes(const py::object
168153 if (!projection.empty ()) {
169154 projection += " , " ;
170155 }
171- projection += QuoteIdentifier (names[i]);
156+ projection += KeywordHelper::WriteOptionallyQuoted (names[i]);
172157 }
173158 }
174159 if (projection.empty ()) {
You can’t perform that action at this time.
0 commit comments