Skip to content

Commit

Permalink
Ignore aiohttp warning recommending use of web.AppKey (#861)
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio authored Feb 3, 2025
1 parent cb9ecac commit e779964
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dask-gateway-server/dask_gateway_server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import os
import signal
import sys
import warnings

from aiohttp import web
from aiohttp.web_exceptions import NotAppKeyWarning
from traitlets import Bool, List, Unicode, default, validate
from traitlets.config import catch_config_error

Expand Down Expand Up @@ -176,6 +178,9 @@ def initialize(self, argv=None):
# Initialize aiohttp application
self.app = web.Application(logger=self.log)
self.app.add_routes(default_routes)
# Ignore recommendation to use web.AppKey instances as keys. Details at
# https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config.
warnings.simplefilter("ignore", NotAppKeyWarning)
self.app["gateway"] = self
self.app["backend"] = self.backend
self.app["authenticator"] = self.authenticator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
import sys
import time
import uuid
import warnings
from base64 import b64encode

from aiohttp import web
from aiohttp.web_exceptions import NotAppKeyWarning
from kubernetes_asyncio import client, config
from kubernetes_asyncio.client.rest import ApiException
from traitlets import Float, Integer, List, Unicode, validate
Expand Down Expand Up @@ -312,6 +314,9 @@ def initialize(self, argv=None):

# Initialize aiohttp application
self.app = web.Application(logger=self.log)
# Ignore recommendation to use web.AppKey instances as keys. Details at
# https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config.
warnings.simplefilter("ignore", NotAppKeyWarning)
self.app["controller"] = self

def start(self):
Expand Down

0 comments on commit e779964

Please sign in to comment.