Skip to content

fix: Prevent string discrete values which are string of numbers from passing as numeric condition values.#130

Merged
RSam-NI merged 9 commits intomasterfrom
users/sam/fix-string-numbers-as-numeric-condition
Apr 28, 2025
Merged

fix: Prevent string discrete values which are string of numbers from passing as numeric condition values.#130
RSam-NI merged 9 commits intomasterfrom
users/sam/fix-string-numbers-as-numeric-condition

Conversation

@RSam-NI
Copy link
Contributor

@RSam-NI RSam-NI commented Apr 18, 2025

What does this Pull Request accomplish?

  • It makes sure that string discrete values are correctly passing as string condition values numeric discrete values are correctly passing as numeric condition values.
  • Data type of discrete value of NumericConditionValue is set to List[Union[StringFloat, StrictInt]]. Used StrictFloat and StrictInt because we only need integer and float values to be stored here and not string of numbers. If int/float are used, pydantic tries to convert the string of numbers into float/int.
  • Data type of discrete value of StringConditionValue is set to StrictStr. Used StrictStr beause, we only want strings to be stored here and not any other datatypes. If str is used, pydantic converts any other datatypes to string and stores it.

Why should this Pull Request be merged?

  • String discrete values which has string of numbers are being converted into numeric condition values.
  • This PR has changes which converts such discrete values correctly as string condition values. And also makes sure that real numeric discrete values are being converted into numeric condition values.

What testing has been done?

Automated integration tests are included.

@RSam-NI RSam-NI merged commit 40b68af into master Apr 28, 2025
12 checks passed
@RSam-NI RSam-NI deleted the users/sam/fix-string-numbers-as-numeric-condition branch April 28, 2025 04:49
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.

4 participants