Skip to content

Commit

Permalink
remove unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
achille-roussel committed Jun 14, 2024
1 parent f1337e2 commit f13e242
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/dispatch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

import os
from concurrent import futures
from http.server import ThreadingHTTPServer
from typing import Any, Callable, Coroutine, Optional, TypeVar, overload
from urllib.parse import urlsplit
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/experimental/lambda_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def handler(event, context):
import base64
import json
import logging
from typing import Optional, Union
from typing import Optional

from awslambdaric.lambda_context import LambdaContext

Expand Down
1 change: 0 additions & 1 deletion src/dispatch/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def read_root():
my_function.dispatch()
"""

import asyncio
import logging
from typing import Optional, Union

Expand Down
1 change: 0 additions & 1 deletion src/dispatch/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def read_root():

import asyncio
import logging
import threading

# from queue import Queue
from typing import Optional, Union
Expand Down
3 changes: 0 additions & 3 deletions src/dispatch/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import logging
import os
from functools import wraps
from types import CoroutineType
from typing import (
Any,
Awaitable,
Expand Down Expand Up @@ -204,10 +203,8 @@ def __init__(
Raises:
ValueError: If any of the required arguments are missing.
"""
endpoint_from = "endpoint argument"
if not endpoint:
endpoint = os.getenv("DISPATCH_ENDPOINT_URL")
endpoint_from = "DISPATCH_ENDPOINT_URL"
if not endpoint:
raise ValueError(
"missing application endpoint: set it with the DISPATCH_ENDPOINT_URL environment variable"
Expand Down
3 changes: 0 additions & 3 deletions src/dispatch/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

import asyncio
import logging
import os
from datetime import timedelta
from http.server import BaseHTTPRequestHandler
from typing import (
Any,
Callable,
Coroutine,
Iterable,
List,
Mapping,
Optional,
Tuple,
Expand Down
3 changes: 1 addition & 2 deletions src/dispatch/proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pickle
from dataclasses import dataclass
from traceback import format_exception
from types import TracebackType
from typing import Any, Dict, List, Optional, Tuple

import google.protobuf.any_pb2
Expand Down Expand Up @@ -83,7 +82,7 @@ def __init__(self, req: function_pb.RunRequest):
input_bytes = input_pb.value
try:
self._input = pickle.loads(input_bytes)
except Exception as e:
except Exception:
self._input = input_bytes
else:
self._input = _pb_any_unpack(req.input)
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import unittest
from datetime import datetime, timedelta
from functools import wraps
from typing import Any, Callable, Coroutine, Dict, Optional, TypeVar, overload
from typing import Any, Callable, Coroutine, Dict, Optional, TypeVar

import aiohttp
from aiohttp import web
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/test/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime
from typing import Mapping, Optional, Protocol, Union
from typing import Optional

import grpc

Expand Down
6 changes: 0 additions & 6 deletions tests/test_fastapi.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import asyncio
import base64
import os
import pickle
import socket
import struct
import unittest
from typing import Any, Optional
from unittest import mock

import fastapi
import google.protobuf.any_pb2
Expand Down
1 change: 0 additions & 1 deletion tests/test_http.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import socket
from datetime import datetime
from http.server import HTTPServer

import dispatch.test
Expand Down

0 comments on commit f13e242

Please sign in to comment.