Skip to content

Commit

Permalink
type
Browse files Browse the repository at this point in the history
  • Loading branch information
chamini2 committed Oct 30, 2024
1 parent dfac930 commit 4e0628c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions projects/fal/src/fal/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from argparse import ArgumentParser
from collections import Counter
from dataclasses import dataclass, field
from typing import Any, Iterator, Union, cast
from typing import Any, Dict, Iterator, List, Union, cast

import graphlib
import rich
Expand All @@ -21,8 +21,8 @@
from fal.exceptions import FalServerlessException
from fal.rest_client import REST_CLIENT

JSONType = Union[dict[str, Any], list[Any], str, int, float, bool, None, "Leaf"]
SchemaType = dict[str, Any]
JSONType = Union[Dict[str, Any], List[Any], str, int, float, bool, None, "Leaf"]
SchemaType = Dict[str, Any]

VARIABLE_PREFIX = "$"
INPUT_VARIABLE_NAME = "input"
Expand Down
3 changes: 2 additions & 1 deletion projects/fal/tests/cli/test_run.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Optional, Tuple
from unittest.mock import MagicMock, patch

import pytest
Expand Down Expand Up @@ -34,7 +35,7 @@ def mocked_fal_serverless_host(host):
return mock


def mock_args(host, func_ref: tuple[str]):
def mock_args(host, func_ref: Tuple[str, Optional[str]]):
args = MagicMock()
args.host = host
args.func_ref = func_ref
Expand Down
12 changes: 6 additions & 6 deletions projects/fal/tests/test_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import time
from contextlib import contextmanager, suppress
from datetime import datetime
from typing import Generator
from typing import Generator, List, Tuple

import fal
import fal.api as api
Expand Down Expand Up @@ -224,7 +224,7 @@ class RTOutput(BaseModel):


class RTOutputs(BaseModel):
texts: list[str]
texts: List[str]


class RealtimeApp(fal.App, keep_alive=300, max_concurrency=1):
Expand Down Expand Up @@ -252,7 +252,7 @@ def generate_rt_batched(self, input: RTInput, *inputs: RTInput) -> RTOutputs:


@pytest.fixture(scope="module")
def aliased_app() -> Generator[tuple[str, str], None, None]:
def aliased_app() -> Generator[Tuple[str, str], None, None]:
# Create a temporary app, register it, and return the ID of it.

import uuid
Expand Down Expand Up @@ -516,7 +516,7 @@ def test_404_response(test_app: str, request: pytest.FixtureRequest):
apps.run(test_app, path="/other", arguments={"lhs": 1, "rhs": 2})


def test_app_deploy_scale(aliased_app: tuple[str, str]):
def test_app_deploy_scale(aliased_app: Tuple[str, str]):
import uuid
from dataclasses import replace

Expand Down Expand Up @@ -558,7 +558,7 @@ def test_app_deploy_scale(aliased_app: tuple[str, str]):
assert found.max_multiplexing == 30


def test_app_update_app(aliased_app: tuple[str, str]):
def test_app_update_app(aliased_app: Tuple[str, str]):
app_revision, app_alias = aliased_app

host: api.FalServerlessHost = addition_app.host # type: ignore
Expand Down Expand Up @@ -608,7 +608,7 @@ def test_app_update_app(aliased_app: tuple[str, str]):
assert res.max_multiplexing == new_max_multiplexing


def test_app_set_delete_alias(aliased_app: tuple[str, str]):
def test_app_set_delete_alias(aliased_app: Tuple[str, str]):
app_revision, app_alias = aliased_app

host: api.FalServerlessHost = addition_app.host # type: ignore
Expand Down

0 comments on commit 4e0628c

Please sign in to comment.