imports [skip ci]

This commit is contained in:
Krisztián Szűcs committed 2019-09-24 16:49:03 +02:00
1 parent 5200af16fd
commit dd41d21c2f
3 files changed
+72 -23

No files matched your search

+68
View File
@@ -0,0 +1,68 @@
# 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.
# cython: language_level = 3
import six
from pyarrow.compat import frombytes, tobytes
from pyarrow.includes.common cimport *
from pyarrow.includes.libarrow cimport PyDateTime_from_TimePoint
from pyarrow.lib import _detect_compression
from pyarrow.lib cimport *
cpdef enum FileType:
NonExistent = <int8_t> CFileType_NonExistent
Unknown = <int8_t> CFileType_Unknown
File = <int8_t> CFileType_File
Directory = <int8_t> CFileType_Directory
cdef class FileStats:
cdef:
CFileStats stats
@staticmethod
cdef FileStats wrap(CFileStats stats)
cdef class Selector:
cdef:
CSelector selector
cdef class FileSystem:
cdef:
shared_ptr[CFileSystem] wrapped
CFileSystem* fs
cdef init(self, const shared_ptr[CFileSystem]& wrapped)
cdef class LocalFileSystem(FileSystem):
cdef:
CLocalFileSystem* localfs
cdef init(self, const shared_ptr[CFileSystem]& wrapped)
cdef class SubTreeFileSystem(FileSystem):
cdef:
CSubTreeFileSystem* subtreefs
cdef init(self, const shared_ptr[CFileSystem]& wrapped)
-20
View File
@@ -37,18 +37,9 @@ cdef inline c_string _path_as_bytes(path) except *:
return tobytes(path)
cpdef enum FileType:
NonExistent = <int8_t> CFileType_NonExistent
Unknown = <int8_t> CFileType_Unknown
File = <int8_t> CFileType_File
Directory = <int8_t> CFileType_Directory
cdef class FileStats:
"""FileSystem entry stats"""
cdef CFileStats stats
def __init__(self):
raise TypeError('dont initialize me')
@@ -147,7 +138,6 @@ cdef class Selector:
recursive : bool, default False
Whether to recurse into subdirectories.
"""
cdef CSelector selector
def __init__(self, base_dir, bint allow_non_existent=False,
bint recursive=False):
@@ -183,10 +173,6 @@ cdef class Selector:
cdef class FileSystem:
"""Abstract file system API"""
cdef:
shared_ptr[CFileSystem] wrapped
CFileSystem* fs
def __init__(self):
raise TypeError("FileSystem is an abstract class, instantiate one of "
"the subclasses instead: LocalFileSystem or "
@@ -475,9 +461,6 @@ cdef class LocalFileSystem(FileSystem):
except when deleting an entry).
"""
cdef:
CLocalFileSystem* localfs
def __init__(self):
cdef shared_ptr[CLocalFileSystem] wrapped
wrapped = make_shared[CLocalFileSystem]()
@@ -499,9 +482,6 @@ cdef class SubTreeFileSystem(FileSystem):
filesystem.
"""
cdef:
CSubTreeFileSystem* subtreefs
def __init__(self, base_path, FileSystem base_fs):
cdef:
c_string pathstr
+4 -3
View File
@@ -21,9 +21,10 @@ import six
from pyarrow.compat import frombytes, tobytes
from pyarrow.includes.common cimport *
from pyarrow.includes.libarrow cimport PyDateTime_from_TimePoint
from pyarrow.lib import _detect_compression
from pyarrow.lib cimport *
from pyarrow.includes.libarrow cimport *
from pyarrow.includes.libarrow_s3 cimport *
from pyarrow._fs cimport FileSystem
from pyarrow.lib cimport check_status
cdef class S3FileSystem(FileSystem):