Skip to content

Commit a09a6f2

Browse files
committed
test(flagd): follow the @numeric-coercion rename
The capability was renamed on the base branch, so these declarations named a symbol that no longer exists. Both resolvers keep declaring it: this provider satisfies the rule in both paths, which is worth noting because the other two languages' flagd providers do not. The rationale comments already recorded why, and they are now the evidence that the defect is narrower than it was described as being. RPC asks flagd for an Int and flagd answers INVALID_ARGUMENT for a float-valued flag, which the provider maps to TypeMismatchError. In-process is local and strict: an integer request admits only int, and the float mapping is deliberately the wider (int, float) because widening towards float loses nothing -- which is the lossless-coercion rule arrived at independently, before it had a name here. So flagd's float narrowing is a property of the Go and Java provider layers rather than of flagd itself. The Go adoption's comment currently says the opposite, calling it "a flagd-wide issue", and needs correcting. Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>
1 parent 1f79483 commit a09a6f2

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎providers/openfeature-provider-flagd/tests/tck/test_in_process_conformance.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
# deadline passes without a synced ruleset, which the SDK's registry turns
5151
# into PROVIDER_ERROR.
5252
#
53-
# STRICT_NUMERIC_TYPING
53+
# NUMERIC_COERCION
5454
# Local, and strict: flagd_core.py:25 admits only `int` for an integer
5555
# request, and flagd_core.py:228-231 raises TypeMismatchError for anything
5656
# else -- so `float-flag`'s 0.5 is reported as a mismatch rather than
@@ -70,7 +70,7 @@
7070
Capability.CONFIGURATION_CHANGE,
7171
Capability.OBJECT,
7272
Capability.UNAVAILABLE_INIT,
73-
Capability.STRICT_NUMERIC_TYPING,
73+
Capability.NUMERIC_COERCION,
7474
}
7575
)
7676

‎providers/openfeature-provider-flagd/tests/tck/test_rpc_conformance.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
# passes without a connection, which the SDK's registry turns into
5454
# PROVIDER_ERROR.
5555
#
56-
# STRICT_NUMERIC_TYPING
56+
# NUMERIC_COERCION
5757
# RPC does not type-check locally; it asks flagd for an Int and flagd answers
5858
# INVALID_ARGUMENT for a float-valued flag, which grpc.py:461-462 maps to
5959
# TypeMismatchError. So 0.5 is never narrowed to 0.
@@ -71,7 +71,7 @@
7171
Capability.CONFIGURATION_CHANGE,
7272
Capability.OBJECT,
7373
Capability.UNAVAILABLE_INIT,
74-
Capability.STRICT_NUMERIC_TYPING,
74+
Capability.NUMERIC_COERCION,
7575
}
7676
)
7777

0 commit comments

Comments
 (0)