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
index on number type differentiates between integer and decimal notation #6526
Closed
Comments
sanderr
changed the title
index on number type differentiates between int and float
index on number type differentiates between integer and decimal notation
Sep 19, 2023
Indexes seem to be built using inmanta-core/src/inmanta/ast/entity.py Line 384 in 0c5ce06
|
Discussed in planning meeting:
|
7 tasks
7 tasks
9 tasks
FloLey
added a commit
that referenced
this issue
Dec 2, 2023
…l notation when used in indexes. (Issue #6526, PR #6772) # Description 1. create the float type which is like a float in python. Update documentation to mention number will be deprecated 2. add testcases for following scenario and fix it ``` entity A: float x end implement A using std::none index A(x) std::print(A(x=0) == A(x=0.0)) ``` This will still not work with the number type 3. index lookup on float with int should work closes #6526 # Self Check: Strike through any lines that are not applicable (`~~line~~`) then check the box - [x] Attached issue to pull request - [x] Changelog entry - [x] Type annotations are present - [x] Code is clear and sufficiently documented - [x] No (preventable) type errors (check using make mypy or make mypy-diff) - [x] Sufficient test cases (reproduces the bug/tests the requested feature) - [x] Correct, in line with design - [x] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) - [ ] If this PR fixes a race condition in the test suite, also push the fix to the relevant stable branche(s) (see [test-fixes](https://internal.inmanta.com/development/core/tasks/build-master.html#test-fixes) for more info)
9 tasks
inmantaci
pushed a commit
that referenced
this issue
Dec 4, 2023
…l notation when used in indexes. (Issue #6526, PR #6800) …l notation when used in indexes. (Issue #6526, PR #6772) # Description 1. create the float type which is like a float in python. Update documentation to mention number will be deprecated 2. add testcases for following scenario and fix it ``` entity A: float x end implement A using std::none index A(x) std::print(A(x=0) == A(x=0.0)) ``` This will still not work with the number type 3. index lookup on float with int should work closes #6526 # Self Check: Strike through any lines that are not applicable (`~~line~~`) then check the box - [x] Attached issue to pull request - [x] Changelog entry - [x] Type annotations are present - [x] Code is clear and sufficiently documented - [x] No (preventable) type errors (check using make mypy or make mypy-diff) - [x] Sufficient test cases (reproduces the bug/tests the requested feature) - [x] Correct, in line with design - [x] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) - [ ] If this PR fixes a race condition in the test suite, also push the fix to the relevant stable branche(s) (see [test-fixes](https://internal.inmanta.com/development/core/tasks/build-master.html#test-fixes) for more info)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actionables
ISO7 only!
number(x)
cast should be verified to work so it can be used to assign int values to number types.float
alias fornumber
because it more clearly conveys what it means. Update documentation to usefloat
rather thannumber
.lsm
andinmanta-lsm
can work with this newfloat
typeMotivation
An index on an attribute of type
number
only considers a number expressed respectively with and without.0
to be diffferent, while these are just different representations of the samenumber
. As an example, the following model printsFalse
.The text was updated successfully, but these errors were encountered: