Skip to content

chore(operators)!: remove ArithmeticOperator.FromSymbol - #124

Open
pdevito3 wants to merge 1 commit into
mainfrom
fm/qk-breaking-from-symbol
Open

pdevito3 wants to merge 1 commit into
mainfrom
fm/qk-breaking-from-symbol

Conversation

@pdevito3

@pdevito3 pdevito3 commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

For later consideration in a major version. Do not merge now. #122 added FromSymbol back as [Obsolete] to keep v1.x non-breaking. Then #134 removed the Obsolete mark. This PR removes the method.

Summary

 public abstract class ArithmeticOperator
 {
     public static ArithmeticOperator Add => new AddOperator();
     ...
     public static ArithmeticOperator Modulo => new ModuloOperator();
-
-    public static ArithmeticOperator? FromSymbol(string symbol) => symbol switch { ... };
 }
  • v1.14.2: ArithmeticOperator.FromSymbol(string) returns the operator for +, -, *, /, or %.
  • New: The method does not exist.
  • Why: No code in QueryKit calls FromSymbol, and the parser does not use it to read arithmetic. The method is dead public API. This major version removes it.

Evidence

var op = ArithmeticOperator.FromSymbol("+");
  • v1.14.2: returns an AddOperator. On main it also compiles, with no warning.
  • This PR:
    • Source break: error CS0117: 'ArithmeticOperator' does not contain a definition for 'FromSymbol'.
    • Binary break: System.MissingMethodException: Method not found: 'QueryKit.Operators.ArithmeticOperator QueryKit.Operators.ArithmeticOperator.FromSymbol(System.String)'.

ArithmeticOperatorTests.cs replaces the restore tests with one test:

from_symbol_is_not_part_of_the_public_api
  typeof(ArithmeticOperator).GetMethod("FromSymbol") -> null

dotnet test on the branch after the rebase on main: 465 unit tests and 297 integration tests pass, 0 failures.

Alternative to PR 148

This PR and #148 are alternatives. Merge only one of them. This PR removes FromSymbol. PR 148 keeps FromSymbol and marks it [Obsolete]. The captain picks one.

Merge Danger

Door: two-way

A later release can add the method back with the same signature.

Blast Radius: consumers

Only consumer code that calls FromSymbol breaks. Callers can use Add, Subtract, Multiply, Divide, or Modulo directly. Filter parsing does not change.

No code in QueryKit calls FromSymbol, and the parser does not use it to read arithmetic. The method is dead public API. v1.x marks it obsolete, and this change removes it.

BREAKING CHANGE: ArithmeticOperator.FromSymbol is removed. Code that calls it does not compile, and a library built against v1.14.2 fails with MissingMethodException. Use ArithmeticOperator.Add, Subtract, Multiply, Divide, or Modulo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant