Skip to content

Commit

Permalink
[#3885] Partially parse when environment variables in schema files ch…
Browse files Browse the repository at this point in the history
…ange (#4162)

* [#3885] Partially parse when environment variables in schema files
change

* Add documentation for test kwargs

* Add test and fix for schema configs with env_var

automatic commit by git-black, original commits:
  16e055a
  bda70c9
  • Loading branch information
gshank authored and iknox-fa committed Feb 8, 2022
1 parent 4a3349b commit d52de06
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions core/dbt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,23 +189,16 @@ def _deep_map_render(
ret: Any

if isinstance(value, list):
ret = [
_deep_map_render(func, v, (keypath + (idx,)))
for idx, v in enumerate(value)
]
ret = [_deep_map_render(func, v, (keypath + (idx,))) for idx, v in enumerate(value)]
elif isinstance(value, dict):
ret = {
k: _deep_map_render(func, v, (keypath + (str(k),)))
for k, v in value.items()
}
ret = {k: _deep_map_render(func, v, (keypath + (str(k),))) for k, v in value.items()}
elif isinstance(value, atomic_types):
ret = func(value, keypath)
else:
container_types: Tuple[Type[Any], ...] = (list, dict)
ok_types = container_types + atomic_types
raise dbt.exceptions.DbtConfigError(
'in _deep_map_render, expected one of {!r}, got {!r}'
.format(ok_types, type(value))
"in _deep_map_render, expected one of {!r}, got {!r}".format(ok_types, type(value))
)

return ret
Expand Down

0 comments on commit d52de06

Please sign in to comment.