Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Casting does not work with Box'd settings (eg dicts) #445

Closed
jhesketh opened this issue Oct 8, 2020 · 0 comments · Fixed by #446
Closed

[bug] Casting does not work with Box'd settings (eg dicts) #445

jhesketh opened this issue Oct 8, 2020 · 0 comments · Fixed by #446

Comments

@jhesketh
Copy link

jhesketh commented Oct 8, 2020

Describe the bug
Using any of the cast or "as_bool" etc methods do not work with nested/boxed settings.

To Reproduce

Python interpreter
>>> settings.UPSTREAM_ROOK 
<Box: {'BUILD_ROOK_FROM_GIT': 'TRUE'}>
>>> settings.UPSTREAM_ROOK.BUILD_ROOK_FROM_GIT
'TRUE'
>>> settings.as_bool('UPSTREAM_ROOK.BUILD_ROOK_FROM_GIT')
False
>>> settings.get('UPSTREAM_ROOK.BUILD_ROOK_FROM_GIT') 
'TRUE'
>>> settings.get('UPSTREAM_ROOK.BUILD_ROOK_FROM_GIT', cast="@bool")
False
  1. Having the following config files:
Config files
[upstream_rook]
build_rook_from_git = true

Expected behavior

settings.as_bool('UPSTREAM_ROOK.BUILD_ROOK_FROM_GIT') returns True.

@jhesketh jhesketh added the bug label Oct 8, 2020
rochacbruno added a commit that referenced this issue Oct 9, 2020
Fix the rebound of `cast` on dotted get.

Fix #445
rochacbruno added a commit that referenced this issue Oct 9, 2020
* Fix #445 casting on dottet get.

Fix the rebound of `cast` on dotted get.

Fix #445

* better handling of casting data
rochacbruno added a commit that referenced this issue Mar 1, 2021
Shortlog of commits since last release:

    Bruno Rocha (11):
          Release version 3.1.2
          Fix #445 casting on dottet get. (#446)
          Fix docs regarding --django argument on cli (#477)
          Fix #521 - FlaskDynaconf should raise KeyError for non existing keys (#522)
          Case insensitive envvar traversal (#524)
          Allow load_file to accept pathlib.Path (#525)
          Allow Title case lookup and validation. (#526)
          Fix #482 - formatter case insensitive (#527)
          Fix #449 - Django lazy templating Fix #449 (#528)
          Added a test to reproduce #492 (not able to reproduce) (#530)
          Fix #511 allow user to specify loaders argument to execute_loaders (#531)

    FrankBattaglia (1):
          Specify flask extension initializers by entry point object reference (#456)

    Ilito Torquato (3):
          fix merging hyperlink to fix  #454 (#458)
          Changed enabled_core_loaders elements to be upper case to fix #455 (#457)
          Fix doc secrets from vault #403 (#459)

    Marcelo Lino (1):
          Add __contains__ to Dynaconf (#502)

    Michal Odnous (1):
          Fix: Environment variables filtering #470 (#474)

    dependabot-preview[bot] (5):
          Bump mkdocs-material from 6.0.2 to 6.1.0 (#453)
          Bump mkdocs-git-revision-date-localized-plugin from 0.5.2 to 0.7.3 (#463)
          Bump mkdocs-material from 6.1.0 to 6.1.5 (#473)
          Bump mkdocs-versioning from 0.2.1 to 0.3.1 (#475)
          Bump mkdocs-material from 6.1.5 to 6.1.6 (#476)

    mirrorrim (1):
          Fix reading secret from Vault kv v2 (#483) (#487)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants