Skip to content

Commit

Permalink
fix relative input path
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Roytman <[email protected]>
  • Loading branch information
roytman committed Jul 7, 2024
1 parent 3623632 commit 85c732b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions data-processing-lib/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ image::
# it seems when running multiple ray launch tests in a single pytest run there is some sort of ray.init() duplication.
# pytest-forked was tried, but then we get SIGABRT in pytest when running the s3 tests, some of which are skipped..
# TODO: the following fails. Why? source venv/bin/activate; export PYTHONPATH=../src; cd test; $(PYTEST) .
.PHONY: test
test:: venv
@# Help: Use the already-built virtual environment to run pytest on the test directory.
source venv/bin/activate; export PYTHONPATH=../src; cd test; $(PYTEST) data_processing_tests/data_access;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def __init__(
self.input_folder = None
self.output_folder = None
else:
self.input_folder = local_config["input_folder"]
self.output_folder = local_config["output_folder"]
self.input_folder = os.path.abspath(local_config["input_folder"])
self.output_folder = os.path.abspath(local_config["output_folder"])
self.d_sets = d_sets
self.checkpoint = checkpoint
self.m_files = m_files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,15 @@ def test_get_output_location(self):
out_path = self.dal.get_output_location(in_path)
assert out_path == os.path.join(self.dal.output_folder, "path", "to", "f.parquet")

path_dict = {
"input_folder": os.path.join("..", "input_guf"),
"output_folder": os.path.join(os.sep, "tmp", "output_guf"),
}
dal = DataAccessLocal(path_dict)
in_path = os.path.abspath(os.path.join("..", "input_guf", "path", "to", "f.parquet"))
out_path = dal.get_output_location(in_path)
assert out_path == os.path.join(dal.output_folder, "path", "to", "f.parquet")


class TestSavePyarrowTable(TestInit):

Expand Down

0 comments on commit 85c732b

Please sign in to comment.