Skip to content

Commit

Permalink
mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Davis committed Jul 30, 2020
1 parent c398e8c commit 6958ea8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions superset/views/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from typing import Dict, Optional, Union

from croniter import croniter
from flask_appbuilder import CompactCRUDMixin
Expand Down Expand Up @@ -50,7 +51,10 @@ class AlertModelView(SupersetModelView): # pylint: disable=too-many-ancestors
datamodel = SQLAInterface(Alert)
route_base = "/alert"
include_route_methods = RouteMethod.CRUD_SET
_extra_data = {"test_alert": False, "test_email_recipients": None}
_extra_data: Dict[str, Union[bool, Optional[str]]] = {
"test_alert": False,
"test_email_recipients": None,
}

list_columns = (
"label",
Expand Down Expand Up @@ -130,7 +134,7 @@ def process_form(self, form: Form, is_created: bool) -> None:
email_recipients = get_email_address_str(form.test_email_recipients.data)

self._extra_data["test_alert"] = form.test_alert.data
self._extra_data["test_email_recipients"] = email_recipients # type: ignore
self._extra_data["test_email_recipients"] = email_recipients

def pre_add(self, item: "AlertModelView") -> None:
item.recipients = get_email_address_str(item.recipients)
Expand Down

0 comments on commit 6958ea8

Please sign in to comment.