You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the config yaml file contains a string with all numeric values and an 'E' in the string (e.g., 1E234), it will read the string as scientific notation (1e+234). This occurs even if the structured config defines the field as string.
Checklist
[ X ] I checked on the latest version of Hydra
[ X ] I created a minimal repro (See this for tips).
Within the config yaml, create a parameter with a string of all numbers and a single 'E' character (e.g., 123E456)
Create an app script that loads the config and prints the parameter values
Notice that the parameter created in step 2 was handled as a number in scientific notation (e.g., 123e+456)
This even occurs if a structured config store instance is created to enforce a schema that defines this parameter as a string. This can be found in the repo mentioned above.
** Stack trace/error message **
The output below can be obtained by cloning the previously mentioned repository and running python app.py
account:
user: user_123
password: '1e+234'
Expected Behavior
It would be expected that the schema defined within the structured config store instance would be enforced, and the string would not be converted to a number.
System information
Hydra Version : 1.3.2
Python version : 3.8.16
Virtual environment type and version : NA
Operating system : all
Additional context
Adding quotes around the value will prevent this from occurring, but our project has numerous config files with long alphanumeric strings as parameter values, and this only occurs when the value happens to be only numbers with a single 'E' character.
The text was updated successfully, but these errors were encountered:
This originates with OmegaConf attempting to represent floats better. Unfortunatelly this is not something that can be fixed without breaking compatibility for people depending floats being interpreted as floats automatically.
Here is some discussion and past attempts at making this better: omry/omegaconf#838
🐛 Bug
Description
When the config yaml file contains a string with all numeric values and an 'E' in the string (e.g., 1E234), it will read the string as scientific notation (1e+234). This occurs even if the structured config defines the field as string.
Checklist
To reproduce
A minimal example has been created in this repository.
A short summary to reproduce:
This even occurs if a structured config store instance is created to enforce a schema that defines this parameter as a string. This can be found in the repo mentioned above.
** Stack trace/error message **
The output below can be obtained by cloning the previously mentioned repository and running
python app.py
Expected Behavior
It would be expected that the schema defined within the structured config store instance would be enforced, and the string would not be converted to a number.
System information
Additional context
Adding quotes around the value will prevent this from occurring, but our project has numerous config files with long alphanumeric strings as parameter values, and this only occurs when the value happens to be only numbers with a single 'E' character.
The text was updated successfully, but these errors were encountered: