Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Apolinario <[email protected]>
  • Loading branch information
eapolinario committed Aug 17, 2021
1 parent 5c991e3 commit e3170b0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/flytekit/unit/core/test_local_cache.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import datetime
import typing
from dataclasses import dataclass
from dataclasses_json import dataclass_json
from pytest import fixture

import pandas
from dataclasses_json import dataclass_json
from pytest import fixture

from flytekit import SQLTask, kwtypes
from flytekit.core.local_cache import LocalCache
from flytekit.core.task import TaskMetadata, task
from flytekit.core.testing import task_mock
from flytekit.core.workflow import workflow
from flytekit.types.schema import FlyteSchema
from flytekit.core.testing import patch, task_mock

# Global counter used to validate number of calls to cache
n_cached_task_calls = 0
Expand All @@ -25,6 +25,7 @@ def setup():
LocalCache.initialize()
LocalCache.clear()


def test_1():
@task(cache=True, cache_version="v1")
def f1(n: int) -> int:
Expand All @@ -50,6 +51,7 @@ def wf(n: int) -> (int, int):
assert wf(n=1) == (1, 2)
assert 1 == 2


def test_single_task_workflow():
@task(cache=True, cache_version="v1")
def is_even(n: int) -> bool:
Expand Down Expand Up @@ -110,8 +112,10 @@ def check_oddness_wf2(n: int) -> bool:
assert check_oddness_wf2(n=99) is True
assert n_cached_task_calls == 2


# TODO add test with typing.List[str]


def test_sql_task():
sql = SQLTask(
"my-query",
Expand Down Expand Up @@ -143,6 +147,7 @@ def my_wf() -> FlyteSchema:
assert (my_wf().open().all() == pandas.DataFrame(data={"x": [1, 2], "y": ["3", "4"]})).all().all()
assert n_cached_task_calls == 1


def test_wf_custom_types():
@dataclass_json
@dataclass
Expand Down

0 comments on commit e3170b0

Please sign in to comment.