[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Bug in 25.0 python bindings



Hi JT,

The docs probably need some re-working for the new version of the bindings, as in the htcondor2 bindings, the daemon history methods' since arguments now require classad2.ExprTree objects for expressions (strings are reserved for job IDs). Putting your _expression_ inside a ExprTree object should work:

from classad2 import ExprTree
...
shist=schedd.history( Âsince=ExprTree("CompletionDate < %d" % (now - 8*3600)), constraint = 'JobStatus == 4', projection=['ProcId', 'ClusterId', 'JobStatus', "AccountingGroup", "AcctGroup", "Owner", "CompletionDate", 'CpusProvisioned', 'JobCurrentStartDate'], match=512)

Jason

On Mon, Feb 23, 2026 at 3:30âAM Jeff Templon <templon@xxxxxxxxx> wrote:
Hi,

shist=schedd.history( Âsince="CompletionDate < %d" % (now - 8*3600), constraint = 'JobStatus == 4', projection=['ProcId', 'ClusterId', 'JobStatus', "AccountingGroup", "AcctGroup", "Owner", "CompletionDate", 'CpusProvisioned', 'JobCurrentStartDate'], match=512)
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/usr/lib64/python3.9/site-packages/htcondor2/_schedd.py", line 446, in history
  return self._history(HistorySrc.ScheddJob, constraint, projection, match, since)
 File "/usr/lib64/python3.9/site-packages/htcondor2/_schedd.py", line 377, in _history
  raise ValueError("since string must be in the form {clusterID}.{procID}")
ValueError: since string must be in the form {clusterID}.{procID}

According to the docs, that form is ONE of the options:

sinceÂ(Union[intstrExprTree]) âÂ

A cluster ID, job ID, or _expression_. If a cluster ID (passed as an integer) or job ID (passed as a string in the format{clusterID}.{procID}), only jobs recorded in the history file after (and not including) the matching ID will be returned. If an _expression_ (including strings that arenât job IDs), jobs will be returned, most-recently-recorded first, until the _expression_ becomes true; the job making the _expression_ become true will not be returned. Thus,Â1038ÂandÂ"clusterIDÂ==Â1038"Âreturn the same set of jobs.

IfÂNone, return all (matching) jobs.

The _expression_ used evaluates to 'CompletionDate < 1771809907â .

JT


_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe

The archives can be found at: https://www-auth.cs.wisc.edu/lists/htcondor-users/