MCPcopy
hub / github.com/pandas-dev/pandas / check_parent_directory

Function check_parent_directory

pandas/io/common.py:645–656  ·  view source on GitHub ↗

Check if parent directory of a file exists, raise OSError if it does not Parameters ---------- path: Path or str Path to check parent directory of

(path: Path | str)

Source from the content-addressed store, hash-verified

643
644
645def check_parent_directory(path: Path | str) -> None:
646 """
647 Check if parent directory of a file exists, raise OSError if it does not
648
649 Parameters
650 ----------
651 path: Path or str
652 Path to check parent directory of
653 """
654 parent = Path(path).parent
655 if not parent.is_dir():
656 raise OSError(rf"Cannot save file into a non-existent directory: '{parent}'")
657
658
659@overload

Callers 2

_get_bufferFunction · 0.90
get_handleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected