mirror of
https://github.com/apache/arrow.git
synced 2026-10-28 16:47:19 +08:00
Fix cpplint issues
Change-Id: I3421335a578400a40bd392fc9b290cf63f9b3893
This commit is contained in:
1 parent
0617c693d0
commit
7620f5041f
5 files changed
+16
-10
No files matched your search
@@ -18,6 +18,8 @@
|
||||
#ifndef ARROW_PYTHON_COMMON_H
|
||||
#define ARROW_PYTHON_COMMON_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "arrow/python/config.h"
|
||||
|
||||
#include "arrow/buffer.h"
|
||||
@@ -47,7 +49,7 @@ class OwnedRef {
|
||||
public:
|
||||
OwnedRef() : obj_(nullptr) {}
|
||||
|
||||
OwnedRef(PyObject* obj) : obj_(obj) {}
|
||||
explicit OwnedRef(PyObject* obj) : obj_(obj) {}
|
||||
|
||||
~OwnedRef() {
|
||||
PyAcquireGIL lock;
|
||||
@@ -71,7 +73,7 @@ struct PyObjectStringify {
|
||||
OwnedRef tmp_obj;
|
||||
const char* bytes;
|
||||
|
||||
PyObjectStringify(PyObject* obj) {
|
||||
explicit PyObjectStringify(PyObject* obj) {
|
||||
PyObject* bytes_obj;
|
||||
if (PyUnicode_Check(obj)) {
|
||||
bytes_obj = PyUnicode_AsUTF8String(obj);
|
||||
@@ -103,7 +105,7 @@ ARROW_EXPORT MemoryPool* get_memory_pool();
|
||||
|
||||
class ARROW_EXPORT NumPyBuffer : public Buffer {
|
||||
public:
|
||||
NumPyBuffer(PyArrayObject* arr) : Buffer(nullptr, 0) {
|
||||
explicit NumPyBuffer(PyArrayObject* arr) : Buffer(nullptr, 0) {
|
||||
arr_ = arr;
|
||||
Py_INCREF(arr);
|
||||
|
||||
@@ -124,7 +126,7 @@ class ARROW_EXPORT PyBuffer : public Buffer {
|
||||
///
|
||||
/// While memoryview objects support multi-demensional buffers, PyBuffer only supports
|
||||
/// one-dimensional byte buffers.
|
||||
PyBuffer(PyObject* obj);
|
||||
explicit PyBuffer(PyObject* obj);
|
||||
~PyBuffer();
|
||||
|
||||
private:
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
|
||||
#include "arrow/io/memory.h"
|
||||
#include "arrow/memory_pool.h"
|
||||
@@ -166,7 +167,7 @@ Status PyReadableFile::GetSize(int64_t* size) {
|
||||
PyAcquireGIL lock;
|
||||
|
||||
int64_t current_position;
|
||||
;
|
||||
|
||||
ARROW_RETURN_NOT_OK(file_->Tell(¤t_position));
|
||||
|
||||
ARROW_RETURN_NOT_OK(file_->Seek(0, 2));
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace py {
|
||||
// calling any methods
|
||||
class PythonFile {
|
||||
public:
|
||||
PythonFile(PyObject* file);
|
||||
explicit PythonFile(PyObject* file);
|
||||
~PythonFile();
|
||||
|
||||
Status Close();
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "arrow/array.h"
|
||||
#include "arrow/column.h"
|
||||
@@ -124,7 +125,7 @@ static int64_t ValuesToValidBytes(
|
||||
|
||||
// TODO(wesm): striding
|
||||
for (int i = 0; i < length; ++i) {
|
||||
valid_bytes[i] = not traits::isnull(values[i]);
|
||||
valid_bytes[i] = !traits::isnull(values[i]);
|
||||
if (traits::isnull(values[i])) null_count++;
|
||||
}
|
||||
|
||||
@@ -225,7 +226,7 @@ class PandasConverter : public TypeVisitor {
|
||||
type_(type),
|
||||
arr_(reinterpret_cast<PyArrayObject*>(ao)),
|
||||
mask_(nullptr) {
|
||||
if (mo != nullptr and mo != Py_None) { mask_ = reinterpret_cast<PyArrayObject*>(mo); }
|
||||
if (mo != nullptr && mo != Py_None) { mask_ = reinterpret_cast<PyArrayObject*>(mo); }
|
||||
length_ = PyArray_SIZE(arr_);
|
||||
}
|
||||
|
||||
@@ -819,6 +820,7 @@ class PandasBlock {
|
||||
OwnedRef placement_arr_;
|
||||
int64_t* placement_data_;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(PandasBlock);
|
||||
};
|
||||
|
||||
@@ -1302,7 +1304,7 @@ class DatetimeTZBlock : public DatetimeBlock {
|
||||
template <int ARROW_INDEX_TYPE>
|
||||
class CategoricalBlock : public PandasBlock {
|
||||
public:
|
||||
CategoricalBlock(int64_t num_rows) : PandasBlock(num_rows, 1) {}
|
||||
explicit CategoricalBlock(int64_t num_rows) : PandasBlock(num_rows, 1) {}
|
||||
|
||||
Status Allocate() override {
|
||||
constexpr int npy_type = arrow_traits<ARROW_INDEX_TYPE>::npy_type;
|
||||
@@ -1430,7 +1432,7 @@ using BlockMap = std::unordered_map<int, std::shared_ptr<PandasBlock>>;
|
||||
// * placement arrays as we go
|
||||
class DataFrameBlockCreator {
|
||||
public:
|
||||
DataFrameBlockCreator(const std::shared_ptr<Table>& table) : table_(table) {}
|
||||
explicit DataFrameBlockCreator(const std::shared_ptr<Table>& table) : table_(table) {}
|
||||
|
||||
Status Convert(int nthreads, PyObject** output) {
|
||||
column_types_.resize(table_->num_columns());
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <Python.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
|
||||
#include "arrow/python/numpy_interop.h"
|
||||
|
||||
|
||||
Reference in new issue
Block a user