Repository navigation
fix: validate cloud variables using SDK types - #125
pcbeingused333 wants to merge 1 commit into
Conversation
|
I'm not sure this aligns with the other default behaviour that we have specified in the other SDKs. Can you clarify a use case this fails in? |
|
Thanks for looking. A concrete case where the current check fails: a Number variable whose value is The second part was that The change compares the SDK type of the default ( |
|
The concrete scenario covered by the regression test is a Number variable returned by bucketing as (Prepared with the assistance of an AI coding agent.) |
Cloud variable validation uses Python runtime classes, so an integer default rejects a floating-point Number and a float default rejects an integer Number. Since Python treats bool as a subclass of int, an integer response can also be accepted for a boolean default.
Compare the default's existing SDK type classification with the returned variable type. This accepts both numeric representations as Number and keeps Boolean separate.
Testing and validation
python -m unittest test.test_cloud_client: 20 tests pass. Before the fix, the added regression cases produce three failures: both mixed numeric directions and an integer response with a boolean default. Coverage also checks matching numeric representations and the reverse Boolean/Number mismatch.AI assistance: this change and its tests were generated with Codex.