-
-
Notifications
You must be signed in to change notification settings - Fork 318
[bug] Setting auto_cast in instance options is ignored #772
Copy link
Copy link
Closed
Description
Affected version: 3.1.9
Describe the bug
Setting auto_cast option inside config.py to False is ignored, even though the docs say otherwise.
To Reproduce
Add auto_cast to Dynaconf initialization.
from dynaconf import Dynaconf
settings = Dynaconf(
settings_files=["settings.toml", ".secrets.toml"],
auto_cast=False,
**more_options
)
Add the following to the settings.toml:
foo="@int 32"
Check value of foo in your program.py:
from config import settings
foo = settings.get('foo', False)
print(f"{foo=}", type(foo))
Executing program.py will return:
foo=32 <class 'int'>
when it should return:
foo='@int 32' <class 'str'>
Running program.py with AUTO_CAST_FOR_DYNACONF=false works as expected.
Reactions are currently unavailable