-
Notifications
You must be signed in to change notification settings - Fork 215
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
Check the timestamp format at compile time #359
Comments
Hi @lopezator thanks for filing the request. There's sort of a general category of lint-style checks that we've been thinking about adding for CEL. Checking string literal inputs to regexes, timestamps, durations, etc. definitely fall into this category. These sort of checks can be a bit brittle when new functionality is introduced which is often why they're considered warnings rather than hard errors; however, I can see the cases you mentioned being errors. I'm happy to consider this a future enhancement, but I don't have a delivery timeline in mind just yet. |
Thank you for your response @TristonianJones !! I think we could apply that logic in our end the meantime, I just wanted to be sure I wasn't missing something obvious. Just to be sure, what do you exactly mean by warnings? Do CEL return any warning in use cases like this? How and where? Thank you for your work in this exceptional library, it's being very useful for us. Best. |
@lopezator This is a good feature request, so thank you for filing it. You're not missing anything obvious at all. The I'm so glad you've enjoyed using CEL. Your team was one of the first to pick it up and play with it. :) |
Wow, this is a great idea, and would be more than enough for our use case I think.
We do! Everytime we add new functionality on our side and therefore take the opportunity to upgrade the library to latest is like... Wow! So much evolution in a short time. |
Correct me if I'm wrong, but the only way to know if the timestamp format is right, is to evaluate the expression?
Wouldn't be nice to know that before, at parse/check time?
e.g.
We are using parse+check to generate an AST, using that AST as an input to a filter component, who generates SQL from it.
This would allow us to support timestamp without having to evalute the expression just for that, or introducing custom code to post-check the AST, if the format passed to
timestamp("wrong")
is wrong.I suppose this could apply for duration as well.
The text was updated successfully, but these errors were encountered: