/usr/local/lib64/python3.6/site-packages/pyarrow/__pycache__
NameSizeModeActions
benchmark.cpython-36.pyc2080644editdlrm
cffi.cpython-36.pyc14820644editdlrm
compat.cpython-36.pyc3810644editdlrm
compute.cpython-36.pyc202630644editdlrm
csv.cpython-36.pyc3820644editdlrm
cuda.cpython-36.pyc4050644editdlrm
dataset.cpython-36.pyc279700644editdlrm
feather.cpython-36.pyc77390644editdlrm
filesystem.cpython-36.pyc144020644editdlrm
flight.cpython-36.pyc13530644editdlrm
fs.cpython-36.pyc103950644editdlrm
hdfs.cpython-36.pyc70550644editdlrm
ipc.cpython-36.pyc73940644editdlrm
json.cpython-36.pyc2310644editdlrm
jvm.cpython-36.pyc80350644editdlrm
orc.cpython-36.pyc51400644editdlrm
pandas_compat.cpython-36.pyc276950644editdlrm
parquet.cpython-36.pyc666090644editdlrm
plasma.cpython-36.pyc40690644editdlrm
serialization.cpython-36.pyc137370644editdlrm
types.cpython-36.pyc120830644editdlrm
util.cpython-36.pyc41500644editdlrm
_generated_version.cpython-36.pyc2230644editdlrm
__init__.cpython-36.pyc164760644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/pyarrow/__pycache__/filesystem.cpython-36.pyc (14402B)
3 9%Eg8@sddlZddlZddlZddlZddlZddlmZddl Z ddl m Z m Z mZmZejdddZGdddZGd d d eZGd d d eZGd ddeZddZddZdddZdS)N)join) implements_stringify_path _is_path_like _DEPR_MSGzfilesystem.LocalFileSystemz2.0.0zfs.LocalFileSystemc@seZdZdZddZddZd(ddZd d Zd d Zd dZ d)ddZ ddZ ddZ d*ddZ ddZddZddZddZd+d!d"Zd,d$d%Zed&d'Zd S)- FileSystemz( Abstract filesystem interface. c Cs |j|d }|jSQRXdS)z Return contents of file as a bytes object. Parameters ---------- path : str File path to read content from. Returns ------- contents : bytes rbN)openread)selfpathfr>/usr/local/lib64/python3.6/site-packages/pyarrow/filesystem.pycat)s zFileSystem.catcCstdS)z Return list of file paths. Parameters ---------- path : str Directory to list contents from. N)NotImplementedError)r r rrrls9s z FileSystem.lsFcCstdS)z Delete the indicated file or directory. Parameters ---------- path : str Path to delete. recursive : bool, default False If True, also delete child paths for directories. N)r)r r recursiverrrdeleteDs zFileSystem.deletec Cstt|}|j|}|ddkr&|dSd}xD|j|D]6\}}}x*|D]"}|j||}||j|d7}qFWq6W|S)z Compute bytes used by all contents under indicated path in file tree. Parameters ---------- path : str Can be a file path or directory. Returns ------- usage : int kindfilesizer)rstatwalk _path_join) r r Z path_infototalroot directoriesfilesZ child_pathabspathrrr disk_usageQs     zFileSystem.disk_usagecGs |jj|S)N)pathsepr)r argsrrrrkszFileSystem._path_joincCs tddS)zl Information about a filesystem entry. Returns ------- stat : dict zFileSystem.statN)r)r r rrrrnszFileSystem.statcCs|j||dS)z. Alias for FileSystem.delete. )r)r)r r rrrrrmxsz FileSystem.rmcCs |j||S)z. Alias for FileSystem.rename. )rename)r r new_pathrrrmv~sz FileSystem.mvcCs tddS)z Rename file, like UNIX mv command. Parameters ---------- path : str Path to alter. new_path : str Path to move to. zFileSystem.renameN)r)r r r%rrrr$s zFileSystem.renameTcCstdS)z Create a directory. Parameters ---------- path : str Path to the directory. create_parents : bool, default True If the parent directories don't exists create them as well. N)r)r r create_parentsrrrmkdirs zFileSystem.mkdircCstdS)z Return True if path exists. Parameters ---------- path : str Path to check. N)r)r r rrrexistss zFileSystem.existscCstdS)z Return True if path is a directory. Parameters ---------- path : str Path to check. N)r)r r rrrisdirs zFileSystem.isdircCstdS)z Return True if path is a file. Parameters ---------- path : str Path to check. N)r)r r rrrisfiles zFileSystem.isfilecCstdS)zf Returns True if this FileSystem is a unix-style file store with directories. N)r)r rrr _isfilestoreszFileSystem._isfilestoreNc Cs,ddlm}|||||d}|j|||dS)a] Read Parquet data from path in file system. Can read from a single file or a directory of files. Parameters ---------- path : str Single file path or directory columns : List[str], optional Subset of columns to read. metadata : pyarrow.parquet.FileMetaData Known metadata to validate files against. schema : pyarrow.parquet.Schema Known schema to validate files against. Alternative to metadata argument. use_threads : bool, default True Perform multi-threaded column reads. use_pandas_metadata : bool, default False If True and file has custom pandas schema metadata, ensure that index columns are also loaded. Returns ------- table : pyarrow.Table r)ParquetDataset)schemametadata filesystem)columns use_threadsuse_pandas_metadata)Zpyarrow.parquetr-r ) r r r1r/r.r2r3r-Zdatasetrrr read_parquets  zFileSystem.read_parquetrcCstdS)z3 Open file for reading or writing. N)r)r r moderrrr szFileSystem.opencCsdS)N/r)r rrrr!szFileSystem.pathsep)F)F)T)NNNTF)r)__name__ __module__ __qualname____doc__rrrr rrr#r&r$r(r)r*r+r,r4r propertyr!rrrrr$s&       rcseZdZdZfddZeddZeddZee j dd Z ee j dd d Z ee j d dZ ee j ddZ ee jddZee jddZee jdddZeddZddZZS)LocalFileSystemNcstjttddtjdS)N) stacklevel)warningswarn _FS_DEPR_MSG FutureWarningsuper__init__)r ) __class__rrrDszLocalFileSystem.__init__c Cs6|jdkr0tjtjdt|_WdQRX|jS)Nignore) _instancer?catch_warnings simplefilterr<)clsrrr _get_instances    zLocalFileSystem._get_instancecCstjttdd|jS)Nr=)r>)r?r@rArBrK)rJrrr get_instanceszLocalFileSystem.get_instancecs$ttfddtjDS)Nc3s|]}t|VqdS)N)pjoin).0x)r rr sz%LocalFileSystem.ls..)rsortedoslistdir)r r r)r rrszLocalFileSystem.lsTcCs&t|}|rtj|n tj|dS)N)rrRmakedirsr()r r r'rrrr( s zLocalFileSystem.mkdircCst|}tjj|S)N)rrRr r*)r r rrrr*szLocalFileSystem.isdircCst|}tjj|S)N)rrRr r+)r r rrrr+szLocalFileSystem.isfilecCsdS)NTr)r rrrr,szLocalFileSystem._isfilestorecCst|}tjj|S)N)rrRr r))r r rrrr)"szLocalFileSystem.existsrcCst|}t||dS)z3 Open file for reading or writing. )r5)rr )r r r5rrrr 'szLocalFileSystem.opencCstjjS)N)rRr sep)r rrrr!/szLocalFileSystem.pathsepcCst|}tj|S)z8 Directory tree generator, see os.walk. )rrRr)r r rrrr3szLocalFileSystem.walk)T)r)r7r8r9rGrD classmethodrKrLrrrr(r*r+r,r)r r;r!r __classcell__rr)rErr<s      r<c@seZdZdZddZeejddZeejddZeej dd Z eej dd d Z eej d dZ eej dddZ eej dddZ dddZddZdS)DaskFileSystemzJ Wraps s3fs Dask filesystem implementation like s3fs, gcsfs, etc. cCstjdtdd||_dS)Nz~The pyarrow.filesystem.DaskFileSystem/S3FSWrapper are deprecated as of pyarrow 3.0.0, and will be removed in a future version.r=)r>)r?r@rBfs)r rYrrrrD@s zDaskFileSystem.__init__cCs tddS)NzUnsupported file system API)r)r r rrrr*GszDaskFileSystem.isdircCs tddS)NzUnsupported file system API)r)r r rrrr+KszDaskFileSystem.isfilecCsdS)zh Object Stores like S3 and GCSFS are based on key lookups, not true file-paths. Fr)r rrrr,OszDaskFileSystem._isfilestoreFcCst|}|jj||dS)N)r)rrYr#)r r rrrrrWszDaskFileSystem.deletecCst|}|jj|S)N)rrYr))r r rrrr)\szDaskFileSystem.existsTcCs(t|}|r|jj|S|jj|SdS)N)rrYZmkdirsr()r r r'rrrr(as zDaskFileSystem.mkdirrcCst|}|jj||dS)z3 Open file for reading or writing. )r5)rrYr )r r r5rrrr iszDaskFileSystem.opencCst|}|jj||dS)N)detail)rrYr)r r rZrrrrqszDaskFileSystem.lscCst|}|jj|S)z9 Directory tree generator, like os.walk. )rrYr)r r rrrruszDaskFileSystem.walkN)F)T)r)F)r7r8r9r:rDrrr*r+r,rr)r(r rrrrrrrX;s    rXc@s:eZdZeejddZeejddZd ddZdS) S3FSWrapperc CsVtt|}y0|jj|}t|dkr6|d|kr6dSdSWntk rPdSXdS)NrFT) _sanitize_s3rrYrlenOSError)r r contentsrrrr*s  zS3FSWrapper.isdirc CsJtt|}y$|jj|}t|dko0|d|kStk rDdSXdS)Nr\rF)r]rrYrr^r_)r r r`rrrr+s   zS3FSWrapper.isfileFc#stt|}tt}xTt|jj||dD]<}|d}|ddkrRj|q.|ddkr`q.|j|q.Wtfdd|D}tddD||fVx D]}|j||dEd HqWd S) z Directory tree generator, like os.walk. Generator version of what is in s3fs, which yields a flattened list of files. )refreshKeyZ StorageClassZ DIRECTORYZBUCKETcs"g|]}|krtj|dqS)r\) posixpathsplit)rNr )rrr sz$S3FSWrapper.walk..cSsg|]}tj|dqS)r\)rcrd)rNrOrrrresN) r]rsetlistrYZ_lsaddrQr)r r rarkey directoryr)rrrs        zS3FSWrapper.walkN)F)r7r8r9rrr*r+rrrrrr[}s  r[cCs|jdr|jddS|SdS)Nzs3://) startswithreplace)r rrrr]s  r]cCsNt|}t|tsFdtjkr6tjd}t||jr6|Stdj|n|SdS)NfsspeczUnrecognized filesystem: {}) type issubclassrsysmodules isinstanceZAbstractFileSystemr_format)rYZfs_typernrrr_ensure_filesystems    ruc Cs.t|s |dk rtd||fS|dk rdt|}t|trDt|}nt|tsXtdn|}||fSt|}tj j |}|j dks|j dkr|j j d}|d}|dkrd }n|j d |}d}t|d kr|d jrt|d }tjj||d }|j}n(|j dkrtj}|j}n tj}|}||fS)zn Return filesystem from path which could be an HDFS URI, a local URI, or a plain filesystem path. NzVfilesystem passed but where is file-like, so there is nothing to open with filesystem.zPExpected string path; path-like objects are only allowed with a local filesystemhdfsZviewfs:rrkdefaultz://r=r\)hostportr)r ValueErrorrursr<rstr TypeErrorurllibparseurlparseschemenetlocrdr^ isnumericintparv_connectr rK) wherer0r Z parsed_uriZ netloc_splitryrzrYZfs_pathrrrresolve_filesystem_and_paths@       r)N)rRrcrq urllib.parser~r?os.pathrrMZpyarrowrZ pyarrow.utilrrrrrtrArr<rXr[r]rurrrrrs"  OIB7