Skip to content

Commit ab73156

Browse files
committed
fully_resolve_path no longer takes in dbgym_workspace
1 parent 7090628 commit ab73156

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

dbms/postgres/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ def postgres_dbdata(
106106
)
107107

108108
# Fully resolve all input paths.
109-
pgbin_path = fully_resolve_path(dbgym_workspace, pgbin_path)
110-
dbdata_parent_dpath = fully_resolve_path(dbgym_workspace, dbdata_parent_dpath)
109+
pgbin_path = fully_resolve_path(pgbin_path)
110+
dbdata_parent_dpath = fully_resolve_path(dbdata_parent_dpath)
111111

112112
# Check assertions on args
113113
if intended_dbdata_hardware == "hdd":

env/integtest_util.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def get_default_metadata() -> TuningMetadata:
6969
dbgym_workspace = GymlibIntegtestManager.get_dbgym_workspace()
7070
return TuningMetadata(
7171
workload_path=fully_resolve_path(
72-
dbgym_workspace,
7372
get_default_workload_path(
7473
dbgym_workspace.dbgym_workspace_path,
7574
GymlibIntegtestManager.BENCHMARK,
@@ -82,19 +81,16 @@ def get_default_metadata() -> TuningMetadata:
8281
),
8382
),
8483
pristine_dbdata_snapshot_path=fully_resolve_path(
85-
dbgym_workspace,
8684
get_default_pristine_dbdata_snapshot_path(
8785
dbgym_workspace.dbgym_workspace_path,
8886
GymlibIntegtestManager.BENCHMARK,
8987
GymlibIntegtestManager.SCALE_FACTOR,
9088
),
9189
),
9290
dbdata_parent_path=fully_resolve_path(
93-
dbgym_workspace,
9491
get_default_dbdata_parent_dpath(dbgym_workspace.dbgym_workspace_path),
9592
),
9693
pgbin_path=fully_resolve_path(
97-
dbgym_workspace,
9894
get_default_pgbin_path(dbgym_workspace.dbgym_workspace_path),
9995
),
10096
)

env/integtest_workload.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def setUpClass() -> None:
1818

1919
def test_workload(self) -> None:
2020
workload_dpath = fully_resolve_path(
21-
GymlibIntegtestManager.get_dbgym_workspace(),
2221
get_default_workload_path(
2322
GymlibIntegtestManager.get_dbgym_workspace().dbgym_workspace_path,
2423
GymlibIntegtestManager.BENCHMARK,

util/workspace.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,7 @@ def get_workspace_path_from_config(dbgym_config_path: Path) -> Path:
281281
Returns the workspace path (as a fully resolved path) from the config file.
282282
"""
283283
with open(dbgym_config_path) as f:
284-
# TODO: use fully_resolve_path()
285-
return Path(yaml.safe_load(f)["dbgym_workspace_path"]).resolve().absolute()
284+
return fully_resolve_path(Path(yaml.safe_load(f)["dbgym_workspace_path"]))
286285

287286

288287
def make_standard_dbgym_workspace() -> DBGymWorkspace:
@@ -296,9 +295,7 @@ def make_standard_dbgym_workspace() -> DBGymWorkspace:
296295
return dbgym_workspace
297296

298297

299-
def fully_resolve_path(
300-
dbgym_workspace: DBGymWorkspace, inputpath: os.PathLike[str]
301-
) -> Path:
298+
def fully_resolve_path(inputpath: os.PathLike[str]) -> Path:
302299
"""
303300
Fully resolve any path to a real, absolute path.
304301
@@ -600,7 +597,7 @@ def link_result(
600597
assert is_fully_resolved(
601598
result_fordpath
602599
), f"result_fordpath ({result_fordpath}) should be a fully resolved path"
603-
result_fordpath = fully_resolve_path(dbgym_workspace, result_fordpath)
600+
result_fordpath = fully_resolve_path(result_fordpath)
604601
assert is_child_path(result_fordpath, dbgym_workspace.dbgym_this_run_path)
605602
assert not os.path.islink(result_fordpath)
606603

0 commit comments

Comments
 (0)