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

Function _stringify_path

dev/archery/archery/compat.py:33–46  ·  view source on GitHub ↗

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

(path)

Source from the content-addressed store, hash-verified

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