forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyarrow.h
More file actions
86 lines (67 loc) · 3.33 KB
/
Copy pathpyarrow.h
File metadata and controls
86 lines (67 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#ifndef ARROW_PYTHON_PYARROW_H
#define ARROW_PYTHON_PYARROW_H
#include "arrow/python/platform.h"
#include <memory>
#include "arrow/python/visibility.h"
namespace arrow {
class Array;
class Buffer;
class Column;
class DataType;
class Field;
class RecordBatch;
class Schema;
class Status;
class Table;
class Tensor;
namespace py {
ARROW_PYTHON_EXPORT int import_pyarrow();
ARROW_PYTHON_EXPORT bool is_buffer(PyObject* buffer);
ARROW_PYTHON_EXPORT Status unwrap_buffer(PyObject* buffer, std::shared_ptr<Buffer>* out);
ARROW_PYTHON_EXPORT PyObject* wrap_buffer(const std::shared_ptr<Buffer>& buffer);
ARROW_PYTHON_EXPORT bool is_data_type(PyObject* data_type);
ARROW_PYTHON_EXPORT Status unwrap_data_type(PyObject* data_type,
std::shared_ptr<DataType>* out);
ARROW_PYTHON_EXPORT PyObject* wrap_data_type(const std::shared_ptr<DataType>& type);
ARROW_PYTHON_EXPORT bool is_field(PyObject* field);
ARROW_PYTHON_EXPORT Status unwrap_field(PyObject* field, std::shared_ptr<Field>* out);
ARROW_PYTHON_EXPORT PyObject* wrap_field(const std::shared_ptr<Field>& field);
ARROW_PYTHON_EXPORT bool is_schema(PyObject* schema);
ARROW_PYTHON_EXPORT Status unwrap_schema(PyObject* schema, std::shared_ptr<Schema>* out);
ARROW_PYTHON_EXPORT PyObject* wrap_schema(const std::shared_ptr<Schema>& schema);
ARROW_PYTHON_EXPORT bool is_array(PyObject* array);
ARROW_PYTHON_EXPORT Status unwrap_array(PyObject* array, std::shared_ptr<Array>* out);
ARROW_PYTHON_EXPORT PyObject* wrap_array(const std::shared_ptr<Array>& array);
ARROW_PYTHON_EXPORT bool is_tensor(PyObject* tensor);
ARROW_PYTHON_EXPORT Status unwrap_tensor(PyObject* tensor, std::shared_ptr<Tensor>* out);
ARROW_PYTHON_EXPORT PyObject* wrap_tensor(const std::shared_ptr<Tensor>& tensor);
ARROW_PYTHON_EXPORT bool is_column(PyObject* column);
ARROW_PYTHON_EXPORT Status unwrap_column(PyObject* column, std::shared_ptr<Column>* out);
ARROW_PYTHON_EXPORT PyObject* wrap_column(const std::shared_ptr<Column>& column);
ARROW_PYTHON_EXPORT bool is_table(PyObject* table);
ARROW_PYTHON_EXPORT Status unwrap_table(PyObject* table, std::shared_ptr<Table>* out);
ARROW_PYTHON_EXPORT PyObject* wrap_table(const std::shared_ptr<Table>& table);
ARROW_PYTHON_EXPORT bool is_record_batch(PyObject* batch);
ARROW_PYTHON_EXPORT Status unwrap_record_batch(PyObject* batch,
std::shared_ptr<RecordBatch>* out);
ARROW_PYTHON_EXPORT PyObject* wrap_record_batch(
const std::shared_ptr<RecordBatch>& batch);
} // namespace py
} // namespace arrow
#endif // ARROW_PYTHON_PYARROW_H