Conversation
…ly as type=decimal
10 tasks
Contributor
Author
|
Discussed at connectathon breakout session: the tests where the expected type changed between 1.5.3 and 2.0.0 need to be versioned, so I'll update those |
dehall
marked this pull request as draft
September 19, 2026 16:10
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 detailed context on this PR, see Zulip thread here: #cql > Ambiguous Decimal/Integer Literals in Spec and Tests
In short, tests whose expected result is a Decimal without any decimal places are currently represented ambiguously. In some tests, the result is numeric without any decimal places, but technically that represents an Integer literal, not a Decimal. Alternatively, some tests use a Decimal literal, but doing so adds decimal places and implies a precision which should not be present in the final value.
This PR attempts to standardize by using the
typeparameter on theoutput, only on tests where the expected result is a Decimal with no decimal places.Specifically:
Poweras of 2.0.0 always returns a Decimal, regardless of input https://cql.hl7.org/09-b-cqlreference.html#powerTruncatedDividereturns a Decimal if at least one operand is a Decimal (other numeric values get promoted to Decimal) https://cql.hl7.org/09-b-cqlreference.html#truncated-divideRound, with precision 0 or unspecified, returns a Decimal with no decimal places https://cql.hl7.org/09-b-cqlreference.html#round