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

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



Hi,

Confirmed: using an ExprTree for the expression does what it should do, aside from the semantic weirdness I mentioned last year: âuntilâ is more appropriate than âsinceâ, as what condor is doing is going through the history, most recent first, UNTIL either that expression becomes true (in the case of an expression) or UNTIL the specified JobId is seen in the history.

JT


> On 23 Feb 2026, at 19:15, Jeff Templon <templon@xxxxxxxxx> wrote:
> 
> Hi Jason,
> 
> Except for the word probably, I agree with you 100% :). I will try the ExprTree tomorrow!
> 
> JT
> 
> 
>> On 23 Feb 2026, at 15:58, Jason Patton via HTCondor-users <htcondor-users@xxxxxxxxxxx> wrote:
>> 
>> 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[int, str, ExprTree]) â 
>> 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/ 
>> _______________________________________________
>> 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/
> 
> 
> _______________________________________________
> 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/