Skip to content

Commit

Permalink
Fix linting for C++ files
Browse files Browse the repository at this point in the history
  • Loading branch information
raulcd committed Jun 6, 2024
1 parent 3eda3d2 commit 1232842
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
16 changes: 7 additions & 9 deletions python/pyarrow/src/arrow/python/init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@
bool numpy_imported = false;

int arrow_init_numpy(bool import_numpy) {
if (import_numpy) {
numpy_imported = true;
return arrow::py::import_numpy();
} else {
return 0;
}
if (import_numpy) {
numpy_imported = true;
return arrow::py::import_numpy();
} else {
return 0;
}
}

bool get_numpy_imported() {
return numpy_imported;
}
bool get_numpy_imported() { return numpy_imported; }
2 changes: 1 addition & 1 deletion python/pyarrow/src/arrow/python/iterators.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#include "arrow/array/array_primitive.h"

#include "arrow/python/init.h"
#include "arrow/python/common.h"
#include "arrow/python/init.h"
#include "arrow/python/numpy_internal.h"

namespace arrow {
Expand Down
6 changes: 3 additions & 3 deletions python/pyarrow/src/arrow/python/numpy_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,23 @@ inline Status VisitNumpyArrayInline(PyArrayObject* arr, VISITOR* visitor) {
namespace internal {

inline bool PyFloatScalar_Check(PyObject* obj) {
if(get_numpy_imported()) {
if (get_numpy_imported()) {
return PyFloat_Check(obj) || PyArray_IsScalar(obj, Floating);
} else {
return PyFloat_Check(obj);
}
}

inline bool PyIntScalar_Check(PyObject* obj) {
if(get_numpy_imported()) {
if (get_numpy_imported()) {
return PyLong_Check(obj) || PyArray_IsScalar(obj, Integer);
} else {
return PyLong_Check(obj);
}
}

inline bool PyBoolScalar_Check(PyObject* obj) {
if(get_numpy_imported()) {
if (get_numpy_imported()) {
return PyBool_Check(obj) || PyArray_IsScalar(obj, Bool);
} else {
return PyBool_Check(obj);
Expand Down

0 comments on commit 1232842

Please sign in to comment.