Skip to content

Commit

Permalink
Reduce deprecation warning stacklevel
Browse files Browse the repository at this point in the history
Jinja2 makes the call stack in the context object disappear.
Not sure how it does it, but it does.

Co-authored-by: Jed Cunningham <[email protected]>
  • Loading branch information
uranusjr and jedcunningham committed Dec 13, 2021
1 parent 39e07cb commit b9295c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/utils/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __copy__(self) -> "Context":

def __getitem__(self, key: str) -> Any:
with contextlib.suppress(KeyError):
warnings.warn(_create_deprecation_warning(key, self._deprecation_replacements[key]), stacklevel=2)
warnings.warn(_create_deprecation_warning(key, self._deprecation_replacements[key]))
with contextlib.suppress(KeyError):
return self._context[key]
raise KeyError(key)
Expand Down

0 comments on commit b9295c0

Please sign in to comment.