Skip to content
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

[gomod] Bump github.com/Knetic/govaluate from 0.0.0-20171022003610-9aa49832a739 to 3.0.0+incompatible #96

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 20, 2024

Bumps github.com/Knetic/govaluate from 0.0.0-20171022003610-9aa49832a739 to 3.0.0+incompatible.

Release notes

Sourced from github.com/Knetic/govaluate's releases.

Short-circuiting, date localization

API Breaks

Multiple API breaks occurred between the previous release and this one. They are minor, and most users won't see any impact, but they measurably change the public interface and semantic meaning of some expressions.

Date localization Previously, literal dates were parsed as UTC dates and always turned into the same value no matter what locale the expression ran. However, this quickly led to confusing situations where users would pass time.Now() (which is localized) as a parameter, compare it against a literal date (which was not localized) and would see results that seemed wrong. For example, on December 31st, 2015, at 9:00pm in Pacific Time, the expression now > '2016-01-01' would evaluate to true.

Per #49 , all literal dates are parsed in the current locale (unless they explicitly include the locale in the date string).

GetTokenKindString removed Previously, an exported function called GetTokenKindString existed. It has been removed, and is exactly replaced by the String() function, which can be called from any OperatorToken. This makes it more idiomatic, and also matches the convention used elsewhere in the library. See #37

Privatized constants The library used to expose a lot of constants which weren't useful to users, and were only used internally (mostly for stage planning). Some of them weren't even used at all. These have been privatized or removed. See #38

Features

  • Short-circuiting is now implemented in cases where both sides of an operation don't need to be known in order for the operation to complete. See #36 and #53 .
  • complex and struct types can now be passed as parameters. Before expression functions were available, these types made no sense in an expression. However, they can be perfectly valid now. See #57

Version tags

This entire repo has been re-tagged to match the gopkg.in standard. This means that instead of import "github.com/Knetic/govaluate" (which always pulls master branch), users can now pin to a specific released version by doing import "gopkg.in/Knetic/govaluate.v3" - where v3 is the tag of the major release that you'd like.

Literal eliding

Features

  • Where an expression has an operator that will only ever work on literals, the library will now elide the operator and optimize the literals into a single stage ( #35 ) instead of doing so upon every call to Evaluate() (involves bugfixes on this feature from #46 and #47 )

Bugs

  • Fixed a bug where expression parsing would panic if they started with ) (found with #47)
  • Fixed a bug where evaluation would panic if parameters contained incomparable types and the expression tried to compare them (found with #47)
  • Fixed a bug where parsing would try to optimize tokens before checking grammar, leading to panics with regex operators being used as EOF (found with #47).

Lexicographic compare, unchecked mode

Features

  • Lexicographic compare ( #29 )
  • Added "unchecked" mode to expressions. After parsing, EvaluableExpresion.ChecksTypes can be set to false, which will cause all further Eval or Evaluate calls to ignore type checking, and instead panic if types are not valid. This should only be used by those who can guarantee that their types will never be invalid for the operators they're using them with. See #24 for some notes on cost/benefit.

Bugs

  • Fixed bug where precedence of functions without parameters was off ( #28 )
  • Fixed bug where many consecutive logical operators would evaluate out of order ( #30 )
  • Fixed bug where nested ternaries would evaluate in wrong order ( #32 )

Misc

  • Performance improvements when dealing with bools ( #33 )

Expression Functions

Features

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [github.com/Knetic/govaluate](https://github.com/Knetic/govaluate) from 0.0.0-20171022003610-9aa49832a739 to 3.0.0+incompatible.
- [Release notes](https://github.com/Knetic/govaluate/releases)
- [Commits](https://github.com/Knetic/govaluate/commits/v3.0.0)

---
updated-dependencies:
- dependency-name: github.com/Knetic/govaluate
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file go Pull requests that update Go code labels Aug 20, 2024
@jandelgado jandelgado closed this Aug 20, 2024
Copy link
Contributor Author

dependabot bot commented on behalf of github Aug 20, 2024

OK, I won't notify you again about this release, but will get in touch when a new version is available. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot dependabot bot deleted the dependabot/go_modules/github.com/Knetic/govaluate-3.0.0incompatible branch August 20, 2024 16:35
@jandelgado jandelgado restored the dependabot/go_modules/github.com/Knetic/govaluate-3.0.0incompatible branch August 20, 2024 18:55
@jandelgado jandelgado reopened this Aug 20, 2024
@jandelgado
Copy link
Owner

jandelgado commented Aug 20, 2024

Newer govaluate versions have unfortunately bugs (e.g. Knetic/govaluate#172) and the lib seems to be unmaintained (last commit 2017)

considering to change to https://github.com/expr-lang/expr

@jandelgado jandelgado closed this Aug 20, 2024
@dependabot dependabot bot deleted the dependabot/go_modules/github.com/Knetic/govaluate-3.0.0incompatible branch August 20, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant