Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
diptanu committed Dec 2, 2024
1 parent bb2f134 commit b0ad30c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion python-sdk/indexify/executor/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from pathlib import Path
from typing import Dict, List, Optional

import structlog
from httpx_sse import aconnect_sse
from pydantic import BaseModel
import structlog

from indexify.common_util import get_httpx_client
from indexify.functions_sdk.data_objects import (
Expand Down
3 changes: 2 additions & 1 deletion python-sdk/indexify/executor/task_reporter.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from typing import Optional
import structlog

import nanoid
import structlog
from httpx import Timeout
from pydantic import BaseModel

from indexify.common_util import get_httpx_client
from indexify.executor.api_objects import RouterOutput as ApiRouterOutput
from indexify.executor.api_objects import TaskResult
Expand Down
2 changes: 1 addition & 1 deletion python-sdk/indexify/functions_sdk/graph.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
import json
import sys
from collections import defaultdict
from queue import deque
from typing import (
Expand Down
4 changes: 1 addition & 3 deletions python-sdk/indexify/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,7 @@ def _download_output(
encoding = "cloudpickle"
else:
encoding = "json"
return IndexifyData(
id=output_id, payload=response.content, encoder=encoding
)
return IndexifyData(id=output_id, payload=response.content, encoder=encoding)

def graph_outputs(
self,
Expand Down
16 changes: 9 additions & 7 deletions python-sdk/tests/test_graph_behaviours.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import unittest
from pathlib import Path
from typing import List, Union
from typing_extensions import TypedDict


from parameterized import parameterized
from pydantic import BaseModel
from typing_extensions import TypedDict

from indexify import (
Graph,
Expand Down Expand Up @@ -120,8 +119,11 @@ def sum_of_squares(init_value: Sum, x: int) -> Sum:
init_value.val += x
return init_value


class JsonSum(TypedDict):
val: int


@indexify_function(accumulate=JsonSum, encoder="json")
def sum_of_squares_with_json_encoding(init_value: JsonSum, x: int) -> JsonSum:
val = init_value.get("val", 0)
Expand Down Expand Up @@ -391,11 +393,11 @@ def test_invoke_file(self, is_remote):

@parameterized.expand([(False), (True)])
def test_pipeline(self, is_remote):
p = create_simple_pipeline()
p = remote_or_local_pipeline(p, is_remote)
invocation_id = p.run(block_until_done=True, x=3)
output = p.output(invocation_id, "make_it_string")
self.assertEqual(output, ["5"])
p = create_simple_pipeline()
p = remote_or_local_pipeline(p, is_remote)
invocation_id = p.run(block_until_done=True, x=3)
output = p.output(invocation_id, "make_it_string")
self.assertEqual(output, ["5"])

@parameterized.expand([(False), (True)])
def test_ignore_none_in_map(self, is_remote):
Expand Down

0 comments on commit b0ad30c

Please sign in to comment.