You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As shown in below section, the expression is not correct.
According to the crython docstring, this is how an expression is constructed:
Represents an entire cron expression.
An expression consists of seven, space delimited fields that represent the following values::
+------------- second (0 - 59)
| +------------- minute (0 - 59)
| | +------------- hour (0 - 23)
| | | +------------- day (1 - 31)
| | | | +------------- month (1 - 12)
| | | | | +------------- weekday (0 - 6) (Sunday to Saturday; 7 is also Sunday)
| | | | | | +------------- year (1970 - 2099)
| | | | | | |
| | | | | | |
* * * * * * *
I believe all keywords using incorrectly the day_in_month part of expressions set to 0 should fail?
I only tested it for the weekly keyword as shown below.
How to reproduce
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
In [1]: import pandas as pd
In [2]: import crython
In [3]: crython.__version__
Out[3]: '0.2.0'
In [5]: crython.expression.CronExpression.new('0 0 0 * * 0 *').matches(pd.Timestamp('2020-01-26 00:00:00'))
Out[5]: True
In [6]: crython.expression.CronExpression.new('0 0 0 0 * 0 *').matches(pd.Timestamp('2020-01-26 00:00:00'))
Out[6]: False
In [7]: crython.expression.CronExpression.new('@weekly').matches(pd.Timestamp('2020-01-26 00:00:00'))
Out[7]: False
The text was updated successfully, but these errors were encountered:
bynr
changed the title
Some reserved keywords define wrong expressions
Reserved keywords are mapped to wrong expressions
Feb 17, 2020
Description of bug
Documentation in README mismatch for weekly cronjob expression.
and
Looking in details of the expression in the code for
@weekly
keyword, we can see the actual expression used:crython/crython/expression.py
Line 34 in 12d9ca9
As shown in below section, the expression is not correct.
According to the crython docstring, this is how an expression is constructed:
I believe all keywords using incorrectly the day_in_month part of expressions set to 0 should fail?
I only tested it for the
weekly
keyword as shown below.How to reproduce
The text was updated successfully, but these errors were encountered: