Conversation
QueryKit does not use the public method ArithmeticOperator.FromSymbol. Mark it obsolete, so that callers get a warning before the next major version removes it. BREAKING CHANGE: a call to ArithmeticOperator.FromSymbol now gives warning CS0618. A project that treats warnings as errors does not compile. Map the symbol to ArithmeticOperator.Add, Subtract, Multiply, Divide, or Modulo in your own code.
pdevito3
force-pushed
the
fm/qk-breaking-fromsymbol-obsolete
branch
from
October 1, 2026 21:48
4ec4330 to
e27202a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For later consideration in a major version. Do not merge now. #134 removed the
Obsoletemark to keep v1.x compatible (restore commit19125d1). This PR re-applies theObsoletemark ofd507c87. The captain decides on this PR separately.Alternative to PR 124
This PR and #124 are alternatives. Merge only one of them. This PR keeps
FromSymboland marks it[Obsolete]. PR 124 removesFromSymbol. The captain picks one.Summary
+ [Obsolete("QueryKit does not use FromSymbol. The next major version removes it.")] public static ArithmeticOperator? FromSymbol(string symbol) => symbol switchThe change is in
QueryKit/Operators/ArithmeticOperator.csonly. The method body does not change.v1.14.2 behavior (and main)
ArithmeticOperator.FromSymbolis a public method with noObsoleteattribute. A call to it compiles with no warning.New behavior
A call to
ArithmeticOperator.FromSymbolcompiles with warning CS0618 and the message "QueryKit does not use FromSymbol. The next major version removes it." The method returns the same values as before.Example
warning CS0618: 'ArithmeticOperator.FromSymbol(string)' is obsolete: 'QueryKit does not use FromSymbol. The next major version removes it.'WithTreatWarningsAsErrors, the build fails.Justification
QueryKit does not use
FromSymbol. TheObsoletemark tells callers before the next major version removes the method. A removal with no warning breaks callers with no notice.Migration
Replace the call with your own map from the symbol to
ArithmeticOperator.Add,Subtract,Multiply,Divide, orModulo. Or suppress CS0618 at the call until the removal.README
No change. The README does not document
FromSymbol.Tests
The CS0618 pragmas come back from main before #134 in 2 unit tests in
ArithmeticOperatorTests:from_symbol_returns_the_operator_for_the_symbolandfrom_symbol_returns_null_for_an_unknown_symbol. The assertions do not change. No integration test changes.dotnet test: 470 unit tests and 297 Postgres integration tests (Testcontainers) pass, 0 failures.Rebase on main
This branch is rebased on current main (#169). The rebase had no conflicts. The breaking change did not change.