Skip to content

Commit

Permalink
Merge pull request #1046 from RasaHQ/ENG-669-deprecation-warnings
Browse files Browse the repository at this point in the history
[ENG-669] Remove deprecation warnings
  • Loading branch information
tmbo authored Nov 22, 2023
2 parents 541a7c9 + 68f0b3b commit 446b378
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions rasa_sdk/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,38 @@
import logging
import os
import types
import warnings
import zlib
import json
from opentelemetry.sdk.trace import TracerProvider
from typing import List, Text, Union, Optional
from ssl import SSLContext

from sanic import Sanic, response
from sanic.response import HTTPResponse
from sanic.request import Request
from sanic_cors import CORS

from rasa_sdk import utils
from rasa_sdk.cli.arguments import add_endpoint_arguments
from rasa_sdk.constants import DEFAULT_KEEP_ALIVE_TIMEOUT, DEFAULT_SERVER_PORT
from rasa_sdk.executor import ActionExecutor
from rasa_sdk.interfaces import ActionExecutionRejection, ActionNotFoundException
from rasa_sdk.plugin import plugin_manager
from rasa_sdk.tracing.utils import get_tracer_and_context, set_span_attributes

# catching:
# - all `pkg_resources` deprecation warning from multiple dependencies
# - google rcp warnings (`pkg_resources.namespaces`)
# - open telemetry (`pkg_resources`)
# - sanic-cors (`distutils Version classes...`)
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore", category=DeprecationWarning, message=".*pkg_resources.*"
)
warnings.filterwarnings(
"ignore",
category=DeprecationWarning,
message="distutils Version classes are deprecated",
)
from opentelemetry.sdk.trace import TracerProvider
from sanic_cors import CORS
from sanic.request import Request
from rasa_sdk import utils
from rasa_sdk.cli.arguments import add_endpoint_arguments
from rasa_sdk.constants import DEFAULT_KEEP_ALIVE_TIMEOUT, DEFAULT_SERVER_PORT
from rasa_sdk.executor import ActionExecutor
from rasa_sdk.interfaces import ActionExecutionRejection, ActionNotFoundException
from rasa_sdk.plugin import plugin_manager
from rasa_sdk.tracing.utils import get_tracer_and_context, set_span_attributes

logger = logging.getLogger(__name__)

Expand Down

0 comments on commit 446b378

Please sign in to comment.