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

Add Webhook storage (fixes #2835) #3000

Merged
merged 21 commits into from
Aug 4, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
linting
  • Loading branch information
jameslamb committed Aug 2, 2020
commit a2d40a10b622247d7203f7086f1e634fb1951e01
10 changes: 5 additions & 5 deletions src/prefect/environments/storage/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from collections.abc import Mapping
from copy import deepcopy
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional
from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional

from requests import Session
from requests.adapters import HTTPAdapter
Expand All @@ -32,7 +32,7 @@ class _SecretMapping(Mapping):
"""

def __getitem__(self, key: str) -> str:
out = os.getenv(key, None)
out = os.getenv(key, None) # type: ignore
if out is None:
try:
out = Secret(key).get()
Expand All @@ -42,9 +42,9 @@ def __getitem__(self, key: str) -> str:
"environment variable or Prefect secret."
)
raise RuntimeError(msg.format(key))
return out
return out # type: ignore

def __iter__(self) -> Iterable:
def __iter__(self) -> Iterator[Any]:
return iter([])

def __len__(self) -> int:
Expand Down Expand Up @@ -86,7 +86,7 @@ def _render_dict(input_dict: Dict[str, Any]) -> Dict[str, Any]:
new_value = string.Template(value).substitute(_mapping)
output_dict[key] = new_value
elif isinstance(value, dict):
output_dict[key] = _render_dict(value)
output_dict[key] = _render_dict(value) # type: ignore
else:
output_dict[key] = value

Expand Down