Skip to content

Commit

Permalink
shalika10|PrefectHQ#3306|Fix environments -storage module for explici…
Browse files Browse the repository at this point in the history
…t chaining
  • Loading branch information
Shalika Singhal authored and Shalika Singhal committed Oct 8, 2020
1 parent cb31eab commit 1b14314
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion changes/issue3306.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ enhancement:
- "Use explicit exception chaining - [#3306](https://github.com/PrefectHQ/prefect/issues/3306)"

contributor:
- "[Aaron Richter](https://github.com/rikturr)"
- "[Aaron Richter](https://github.com/rikturr)"
- "[Shalika Singhal](https://github.com/shalika10)"
4 changes: 2 additions & 2 deletions src/prefect/environments/storage/_healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ def environment_dependency_check(flows: list):
for dependency in required_imports:
try:
importlib.import_module(dependency)
except ModuleNotFoundError:
except ModuleNotFoundError as moduleNotFoundError:
raise ModuleNotFoundError(
"Using {} requires the `{}` dependency".format(
flow.environment.__class__.__name__, dependency
)
)
) from moduleNotFoundError

print("Environment dependency check: OK")

Expand Down
4 changes: 2 additions & 2 deletions src/prefect/environments/storage/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ def __getitem__(self, key: str) -> str:
if out is None:
try:
out = Secret(key).get()
except ValueError:
except ValueError as valueError:
msg = (
"Template value '{}' does not refer to an "
"environment variable or Prefect secret."
)
raise RuntimeError(msg.format(key))
raise RuntimeError(msg.format(key)) from valueError
return out # type: ignore

def __iter__(self) -> Iterator[Any]:
Expand Down

0 comments on commit 1b14314

Please sign in to comment.