-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pkg/ottl] Mathematical Expressions are able to handle time.Time
and time.Duration
types.
#22009
Comments
time.Time
types.time.Time
types.
Does this mean adding |
I will detail these cards next week, but yes. |
time.Time
types.time.Time
and time.Duration
types.
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Description: Allows addition and subtraction between times and duration according to rules in #22009 Link to tracking Issue: Closes #22009 Testing: Unit testing for math operations Documentation: --------- Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
In order to support complex interactions with time we need to support the following cases in our mathematical expressions:
time.Time
fromtime.Time
must result in atime.Duration
.time.Duration
to atime.Time
must result in atime.Time
time.Duration
from atime.Time
must result in atime.Time
time.Duration
to atime.Duration
must result in atime.Duration
time.Duration
from atime.Duration
must result in atime.Duration
Only these type interactions should be supported. For example, the following SHOULD NOT be allowed:
time.Time
.time.Duration
.At the moment these rules cannot be enforced by the grammar, instead we will have to enforce these rules in the execution of the mathematical expressions. This is the existing pattern we use for other type checking.
The text was updated successfully, but these errors were encountered: