MCPcopy Create free account
hub / github.com/apache/arrow / _stringify_path

Function _stringify_path

python/pyarrow/util.py:138–151  ·  view source on GitHub ↗

Convert *path* to a string or unicode path if possible.

(path)

Source from the content-addressed store, hash-verified

136
137
138def _stringify_path(path):
139 """
140 Convert *path* to a string or unicode path if possible.
141 """
142 if isinstance(path, str):
143 return os.path.expanduser(path)
144
145 # checking whether path implements the filesystem protocol
146 try:
147 return os.path.expanduser(path.__fspath__())
148 except AttributeError:
149 pass
150
151 raise TypeError("not a path-like object")
152
153
154def product(seq):

Callers 4

_ensure_multiple_sourcesFunction · 0.90
parquet_datasetFunction · 0.90
write_tableFunction · 0.90

Calls 2

__fspath__Method · 0.80
TypeErrorFunction · 0.50

Tested by

no test coverage detected