Skip to content

Commit 49aba8a

Browse files
committed
make it compile on windows
1 parent aa1f300 commit 49aba8a

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

cpp/src/arrow/python/arrow_to_python.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Status GetValue(std::shared_ptr<Array> arr, int32_t index, int32_t type, PyObjec
9696
PyBool_FromLong(std::static_pointer_cast<BooleanArray>(arr)->Value(index));
9797
return Status::OK();
9898
case Type::INT64:
99-
*result = PyInt_FromLong(std::static_pointer_cast<Int64Array>(arr)->Value(index));
99+
*result = PyLong_FromSsize_t(std::static_pointer_cast<Int64Array>(arr)->Value(index));
100100
return Status::OK();
101101
case Type::BINARY: {
102102
int32_t nchars;
@@ -149,16 +149,16 @@ Status GetValue(std::shared_ptr<Array> arr, int32_t index, int32_t type, PyObjec
149149

150150
#define DESERIALIZE_SEQUENCE(CREATE_FN, SET_ITEM_FN) \
151151
auto data = std::dynamic_pointer_cast<UnionArray>(array); \
152-
int32_t size = array->length(); \
152+
int64_t size = array->length(); \
153153
ScopedRef result(CREATE_FN(stop_idx - start_idx)); \
154154
auto types = std::make_shared<Int8Array>(size, data->type_ids()); \
155155
auto offsets = std::make_shared<Int32Array>(size, data->value_offsets()); \
156-
for (int32_t i = start_idx; i < stop_idx; ++i) { \
156+
for (int64_t i = start_idx; i < stop_idx; ++i) { \
157157
if (data->IsNull(i)) { \
158158
Py_INCREF(Py_None); \
159159
SET_ITEM_FN(result.get(), i - start_idx, Py_None); \
160160
} else { \
161-
int32_t offset = offsets->Value(i); \
161+
int64_t offset = offsets->Value(i); \
162162
int8_t type = types->Value(i); \
163163
std::shared_ptr<Array> arr = data->child(type); \
164164
PyObject* value; \

cpp/src/arrow/python/arrow_to_python.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
#ifndef ARROW_PYTHON_ARROW_TO_PYTHON_H
1919
#define ARROW_PYTHON_ARROW_TO_PYTHON_H
2020

21-
#include <Python.h>
22-
2321
#include "arrow/api.h"
2422
#include "arrow/io/interfaces.h"
23+
#include "arrow/python/platform.h"
2524

2625
#include <vector>
2726

cpp/src/arrow/python/python_to_arrow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "arrow/api.h"
2424
#include "arrow/io/interfaces.h"
2525
#include "arrow/python/numpy_interop.h"
26+
#include "arrow/python/platform.h"
2627
#include "arrow/python/sequence.h"
2728

2829
#include <vector>

0 commit comments

Comments
 (0)