From 6ac930eabab520c3de8f2d88f7940ae5a17e11ca Mon Sep 17 00:00:00 2001 From: Ben Clifford Date: Sat, 18 Jan 2025 11:30:30 +0000 Subject: [PATCH] Revert part of PR #3638 which is part of a now-abandoned task priority PR series (#3750) PR #3638 introduced parameters and documentation for a task priority field which was never implemented in mainline Parsl. This PR leaves most of the infrastructure in place, as other code now depends on it, but removes `priority` as a valid resource specification field. # Changed Behaviour users trying to use the no-effect priority parameter will now get runtime errors rather than silent ignore. ## Type of change - Code maintenance/cleanup --- parsl/executors/high_throughput/executor.py | 6 ++---- parsl/tests/test_htex/test_resource_spec_validation.py | 7 ------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/parsl/executors/high_throughput/executor.py b/parsl/executors/high_throughput/executor.py index d3fa522619..828ea352da 100644 --- a/parsl/executors/high_throughput/executor.py +++ b/parsl/executors/high_throughput/executor.py @@ -8,7 +8,7 @@ from collections import defaultdict from concurrent.futures import Future from dataclasses import dataclass -from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union +from typing import Callable, Dict, List, Optional, Sequence, Set, Tuple, Union import typeguard @@ -357,10 +357,8 @@ def worker_logdir(self): return self.logdir def validate_resource_spec(self, resource_specification: dict): - """HTEX supports the following *Optional* resource specifications: - priority: lower value is higher priority""" if resource_specification: - acceptable_fields = {'priority'} + acceptable_fields: Set[str] = set() # add new resource spec field names here to make htex accept them keys = set(resource_specification.keys()) invalid_keys = keys - acceptable_fields if invalid_keys: diff --git a/parsl/tests/test_htex/test_resource_spec_validation.py b/parsl/tests/test_htex/test_resource_spec_validation.py index 2a6d577416..5587891650 100644 --- a/parsl/tests/test_htex/test_resource_spec_validation.py +++ b/parsl/tests/test_htex/test_resource_spec_validation.py @@ -30,13 +30,6 @@ def test_resource_spec_validation(): assert ret_val is None -@pytest.mark.local -def test_resource_spec_validation_one_key(): - htex = HighThroughputExecutor() - ret_val = htex.validate_resource_spec({"priority": 2}) - assert ret_val is None - - @pytest.mark.local def test_resource_spec_validation_bad_keys(): htex = HighThroughputExecutor()