Skip to content

Commit 2449351

Browse files
committed
fix: fix regression where top-level array jobs where shown in the output of qq jobs and qq stat
1 parent 540691d commit 2449351

4 files changed

Lines changed: 21 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Version 0.12.1
22

33
- Fixed a bug where `qq clear` would report incorrect number of files excluded from clearing.
4+
- Fixed a regression where top-level array jobs were shown in the output of `qq jobs` and `qq stat`.
45

56
## Version 0.12.0
67

src/qq_lib/batch/interface/interface.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ def get_unfinished_batch_jobs(
329329
330330
The jobs can be returned in arbitrary order.
331331
332+
Top level array jobs should not be included in the output.
333+
332334
Args:
333335
user (str): Username for which to fetch uncompleted jobs.
334336
server (str | None): Optional name of the batch server to get jobs from.
@@ -348,6 +350,8 @@ def get_batch_jobs(cls, user: str, server: str | None = None) -> list[TBatchJob]
348350
349351
The jobs can be returned in arbitrary order.
350352
353+
Top level array jobs should not be included in the output.
354+
351355
Args:
352356
user (str): Username for which to fetch all jobs.
353357
server (str | None): Optional name of the batch server to get jobs from.
@@ -368,6 +372,8 @@ def get_all_unfinished_batch_jobs(
368372
369373
The jobs can be returned in arbitrary order.
370374
375+
Top level array jobs should not be included in the output.
376+
371377
Args:
372378
server (str | None): Optional name of the batch server to get jobs from.
373379
@@ -385,6 +391,8 @@ def get_all_batch_jobs(cls, server: str | None = None) -> list[TBatchJob]:
385391
386392
The jobs can be returned in arbitrary order.
387393
394+
Top level array jobs should not be included in the output.
395+
388396
Args:
389397
server (str | None): Optional name of the batch server to get jobs from.
390398

src/qq_lib/batch/pbs/pbs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def get_unfinished_batch_jobs(
208208
return cls._get_batch_jobs_using_command(
209209
command,
210210
include_completed=False,
211-
include_top_level_array=True,
211+
include_top_level_array=False,
212212
ignore_exit_code=False,
213213
)
214214

@@ -221,7 +221,7 @@ def get_batch_jobs(cls, user: str, server: str | None = None) -> list[PBSJob]:
221221
return cls._get_batch_jobs_using_command(
222222
command,
223223
include_completed=True,
224-
include_top_level_array=True,
224+
include_top_level_array=False,
225225
ignore_exit_code=False,
226226
)
227227

@@ -234,7 +234,7 @@ def get_all_unfinished_batch_jobs(cls, server: str | None = None) -> list[PBSJob
234234
return cls._get_batch_jobs_using_command(
235235
command,
236236
include_completed=False,
237-
include_top_level_array=True,
237+
include_top_level_array=False,
238238
ignore_exit_code=False,
239239
)
240240

@@ -247,7 +247,7 @@ def get_all_batch_jobs(cls, server: str | None = None) -> list[PBSJob]:
247247
return cls._get_batch_jobs_using_command(
248248
command,
249249
include_completed=True,
250-
include_top_level_array=True,
250+
include_top_level_array=False,
251251
ignore_exit_code=False,
252252
)
253253

tests/batch/pbs/test_pbs.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,7 @@ def test_pbs_get_unfinished_batch_jobs_calls_correct_command(mock_jobs):
21832183
mock_call.assert_called_once_with(
21842184
"qstat -fwtu alice",
21852185
include_completed=False,
2186-
include_top_level_array=True,
2186+
include_top_level_array=False,
21872187
ignore_exit_code=False,
21882188
)
21892189

@@ -2197,7 +2197,7 @@ def test_pbs_get_unfinished_batch_jobs_appends_server(mock_jobs):
21972197
mock_call.assert_called_once_with(
21982198
"qstat -fwtu alice @server",
21992199
include_completed=False,
2200-
include_top_level_array=True,
2200+
include_top_level_array=False,
22012201
ignore_exit_code=False,
22022202
)
22032203

@@ -2230,7 +2230,7 @@ def test_pbs_get_batch_jobs_calls_correct_command(mock_jobs):
22302230
mock_call.assert_called_once_with(
22312231
"qstat -fwxtu alice",
22322232
include_completed=True,
2233-
include_top_level_array=True,
2233+
include_top_level_array=False,
22342234
ignore_exit_code=False,
22352235
)
22362236

@@ -2244,7 +2244,7 @@ def test_pbs_get_batch_jobs_appends_server(mock_jobs):
22442244
mock_call.assert_called_once_with(
22452245
"qstat -fwxtu alice @server",
22462246
include_completed=True,
2247-
include_top_level_array=True,
2247+
include_top_level_array=False,
22482248
ignore_exit_code=False,
22492249
)
22502250

@@ -2277,7 +2277,7 @@ def test_pbs_get_all_unfinished_batch_jobs_calls_correct_command(mock_jobs):
22772277
mock_call.assert_called_once_with(
22782278
"qstat -fwt",
22792279
include_completed=False,
2280-
include_top_level_array=True,
2280+
include_top_level_array=False,
22812281
ignore_exit_code=False,
22822282
)
22832283

@@ -2291,7 +2291,7 @@ def test_pbs_get_all_unfinished_batch_jobs_appends_server(mock_jobs):
22912291
mock_call.assert_called_once_with(
22922292
"qstat -fwt @server",
22932293
include_completed=False,
2294-
include_top_level_array=True,
2294+
include_top_level_array=False,
22952295
ignore_exit_code=False,
22962296
)
22972297

@@ -2324,7 +2324,7 @@ def test_pbs_get_all_batch_jobs_calls_correct_command(mock_jobs):
23242324
mock_call.assert_called_once_with(
23252325
"qstat -fxwt",
23262326
include_completed=True,
2327-
include_top_level_array=True,
2327+
include_top_level_array=False,
23282328
ignore_exit_code=False,
23292329
)
23302330

@@ -2338,7 +2338,7 @@ def test_pbs_get_all_batch_jobs_appends_server(mock_jobs):
23382338
mock_call.assert_called_once_with(
23392339
"qstat -fxwt @myserver",
23402340
include_completed=True,
2341-
include_top_level_array=True,
2341+
include_top_level_array=False,
23422342
ignore_exit_code=False,
23432343
)
23442344

0 commit comments

Comments
 (0)