Skip to content

Commit 91ec838

Browse files
sfc-gh-mkellernoamcohen97dependabot[bot]3dbrows3dbrows
authored
Test 1336 (#1347)
Co-authored-by: Noam Cohen (noamcohen97) <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Duncan MacQuarrie <[email protected]> Co-authored-by: 3dbrows <[email protected]>
1 parent 3d0d783 commit 91ec838

File tree

6 files changed

+46
-16
lines changed

6 files changed

+46
-16
lines changed

DESCRIPTION.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
88

99
# Release Notes
1010

11+
- v2.9.1(unreleased)
12+
13+
- Bumped pyarrow dependency from >=8.0.0,<8.1.0 to >=10.0.1,<10.1.0
14+
1115
- v2.9.0(December 9, 2022)
1216

1317
- Fixed a bug where the permission of the file downloaded via GET command is changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ requires = [
66
"wheel",
77
"cython",
88
# Must be kept in sync with the `setup_requirements` in `setup.cfg`
9-
"pyarrow>=8.0.0,<8.1.0",
9+
"pyarrow>=10.0.1,<10.1.0",
1010
]
1111

1212
[tool.cibuildwheel]

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,6 @@ development =
9191
pytzdata
9292
pandas =
9393
pandas>=1.0.0,<1.6.0
94-
pyarrow>=8.0.0,<8.1.0
94+
pyarrow>=10.0.1,<10.1.0
9595
secure-local-storage =
9696
keyring!=16.1.0,<24.0.0

setup.py

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,45 @@ class MyBuildExt(build_ext):
7171
# this list should be carefully examined when pyarrow lib is
7272
# upgraded
7373
arrow_libs_to_copy = {
74-
"linux": ["libarrow.so.800", "libarrow_python.so.800", "libparquet.so.800"],
74+
"linux": [
75+
"libarrow.so.1000",
76+
"libarrow_dataset.so.1000",
77+
"libarrow_python.so.1000",
78+
"libparquet.so.1000",
79+
],
7580
"darwin": [
76-
"libarrow.800.dylib",
77-
"libarrow_python.800.dylib",
78-
"libparquet.800.dylib",
81+
"libarrow.1000.dylib",
82+
"libarrow_dataset.1000.dylib",
83+
"libarrow_python.1000.dylib",
84+
"libparquet.1000.dylib",
85+
],
86+
"win32": [
87+
"arrow.dll",
88+
"arrow_dataset.dll",
89+
"arrow_python.dll",
90+
"parquet.dll",
7991
],
80-
"win32": ["arrow.dll", "arrow_python.dll", "parquet.dll"],
8192
}
8293

8394
arrow_libs_to_link = {
84-
"linux": ["libarrow.so.800", "libarrow_python.so.800", "libparquet.so.800"],
95+
"linux": [
96+
"libarrow.so.1000",
97+
"libarrow_dataset.so.1000",
98+
"libarrow_python.so.1000",
99+
"libparquet.so.1000",
100+
],
85101
"darwin": [
86-
"libarrow.800.dylib",
87-
"libarrow_python.800.dylib",
88-
"libparquet.800.dylib",
102+
"libarrow.1000.dylib",
103+
"libarrow_dataset.1000.dylib",
104+
"libarrow_python.1000.dylib",
105+
"libparquet.1000.dylib",
106+
],
107+
"win32": [
108+
"arrow.lib",
109+
"arrow_dataset.lib",
110+
"arrow_python.lib",
111+
"parquet.lib",
89112
],
90-
"win32": ["arrow.lib", "arrow_python.lib", "parquet.lib"],
91113
}
92114

93115
def build_extension(self, ext):
@@ -126,13 +148,15 @@ def build_extension(self, ext):
126148
ext.include_dirs.append(LOGGING_SRC_DIR)
127149

128150
if sys.platform == "win32":
151+
if not any("/std" not in s for s in ext.extra_compile_args):
152+
ext.extra_compile_args.append("/std:c++17")
129153
ext.include_dirs.append(pyarrow.get_include())
130154
ext.include_dirs.append(numpy.get_include())
131155
elif sys.platform == "linux" or sys.platform == "darwin":
132156
ext.extra_compile_args.append("-isystem" + pyarrow.get_include())
133157
ext.extra_compile_args.append("-isystem" + numpy.get_include())
134158
if "std=" not in os.environ.get("CXXFLAGS", ""):
135-
ext.extra_compile_args.append("-std=c++11")
159+
ext.extra_compile_args.append("-std=c++17")
136160
ext.extra_compile_args.append("-D_GLIBCXX_USE_CXX11_ABI=0")
137161

138162
ext.library_dirs.append(
@@ -160,9 +184,11 @@ def _get_arrow_lib_dir(self):
160184
def _copy_arrow_lib(self):
161185
libs_to_bundle = self.arrow_libs_to_copy[sys.platform]
162186

187+
build_dir = os.path.join(self.build_lib, "snowflake", "connector")
188+
os.makedirs(build_dir, exist_ok=True)
189+
163190
for lib in libs_to_bundle:
164191
source = f"{self._get_arrow_lib_dir()}/{lib}"
165-
build_dir = os.path.join(self.build_lib, "snowflake", "connector")
166192
copy(source, build_dir)
167193

168194
def _get_arrow_lib_as_linker_input(self):

src/snowflake/connector/cpp/ArrowIterator/BinaryConverter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ PyObject* BinaryConverter::toPyObject(int64_t rowIndex) const
1818
{
1919
if (m_array->IsValid(rowIndex))
2020
{
21-
arrow::util::string_view sv = m_array->GetView(rowIndex);
21+
std::string_view sv = m_array->GetView(rowIndex);
2222
return PyByteArray_FromStringAndSize(sv.data(), sv.size());
2323
}
2424
else

src/snowflake/connector/cpp/ArrowIterator/StringConverter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ PyObject* StringConverter::toPyObject(int64_t rowIndex) const
1818
{
1919
if (m_array->IsValid(rowIndex))
2020
{
21-
arrow::util::string_view sv = m_array->GetView(rowIndex);
21+
std::string_view sv = m_array->GetView(rowIndex);
2222
return PyUnicode_FromStringAndSize(sv.data(), sv.size());
2323
}
2424
else

0 commit comments

Comments
 (0)