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

Function _stringify_path

dev/archery/archery/compat.py:34–47  ·  view source on GitHub ↗

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

(path)

Source from the content-addressed store, hash-verified

32
33
34def _stringify_path(path):
35 """
36 Convert *path* to a string or unicode path if possible.
37 """
38 if isinstance(path, str):
39 return path
40
41 # checking whether path implements the filesystem protocol
42 try:
43 return path.__fspath__()
44 except AttributeError:
45 pass
46
47 raise TypeError("not a path-like object")
48
49
50def _import_pandas():

Callers 2

_ensure_pathFunction · 0.70
run_cmdMethod · 0.50

Calls 2

__fspath__Method · 0.80
TypeErrorFunction · 0.50

Tested by

no test coverage detected