MCPcopy
hub / github.com/pathwaycom/pathway / write_csv

Function write_csv

python/pathway/tests/utils.py:781–787  ·  view source on GitHub ↗
(path: str | pathlib.Path, table_def: str, **kwargs)

Source from the content-addressed store, hash-verified

779
780
781def write_csv(path: str | pathlib.Path, table_def: str, **kwargs):
782 df = _markdown_to_pandas(table_def)
783 with tempfile.NamedTemporaryFile(mode="w+", delete=False) as f:
784 tmp_path = f.name
785 df.to_csv(tmp_path, encoding="utf-8", **kwargs)
786 # Move is atomic in POSIX filesystems, that makes the whole write atomic as a result
787 os.replace(tmp_path, path)
788
789
790def write_lines(path: str | pathlib.Path, data: str | list[str]):

Callers 15

test_file_ioFunction · 0.90
test_deltalake_simpleFunction · 0.90
test_deltalake_appendFunction · 0.90
test_deltalake_roundtripFunction · 0.90
write_dataFunction · 0.90
run_rereadFunction · 0.90
test_demo_replayFunction · 0.90
test_groupby_countFunction · 0.90

Calls 2

_markdown_to_pandasFunction · 0.90
replaceMethod · 0.80

Tested by 15

test_file_ioFunction · 0.72
test_deltalake_simpleFunction · 0.72
test_deltalake_appendFunction · 0.72
test_deltalake_roundtripFunction · 0.72
write_dataFunction · 0.72
run_rereadFunction · 0.72
test_demo_replayFunction · 0.72
test_groupby_countFunction · 0.72