Skip to content

Commit b260dd5

Browse files
committed
sdks/python: fix linting issues
1 parent e9c45c2 commit b260dd5

6 files changed

Lines changed: 12 additions & 11 deletions

File tree

sdks/python/apache_beam/ml/inference/vllm_inference.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@
3131
from typing import Any
3232
from typing import Optional
3333

34+
from openai import AsyncOpenAI
35+
from openai import OpenAI
36+
3437
from apache_beam.io.filesystems import FileSystems
3538
from apache_beam.ml.inference.base import ModelHandler
3639
from apache_beam.ml.inference.base import PredictionResult
3740
from apache_beam.utils import subprocess_server
38-
from openai import AsyncOpenAI
39-
from openai import OpenAI
4041

4142
try:
4243
# VLLM logging config breaks beam logging.

sdks/python/apache_beam/ml/rag/embeddings/huggingface_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424

2525
import apache_beam as beam
2626
from apache_beam.ml.rag.embeddings.huggingface import HuggingfaceTextEmbeddings
27+
from apache_beam.ml.rag.embeddings.test_utils import chunk_approximately_equals
2728
from apache_beam.ml.rag.types import Chunk
2829
from apache_beam.ml.rag.types import Content
2930
from apache_beam.ml.rag.types import Embedding
3031
from apache_beam.ml.transforms.base import MLTransform
3132
from apache_beam.testing.test_pipeline import TestPipeline
3233
from apache_beam.testing.util import assert_that
3334
from apache_beam.testing.util import equal_to
34-
from apache_beam.ml.rag.embeddings.test_utils import chunk_approximately_equals
3535

3636
# pylint: disable=unused-import
3737
try:

sdks/python/apache_beam/ml/rag/embeddings/open_ai.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
from apache_beam.ml.rag.types import Chunk
2525
from apache_beam.ml.transforms.base import EmbeddingsManager
2626
from apache_beam.ml.transforms.base import _TextEmbeddingHandler
27-
from apache_beam.ml.transforms.embeddings.open_ai import (
28-
_OpenAITextEmbeddingHandler, )
27+
from apache_beam.ml.transforms.embeddings.open_ai import _OpenAITextEmbeddingHandler
2928

3029
__all__ = ['OpenAITextEmbeddings']
3130

sdks/python/apache_beam/ml/rag/embeddings/open_ai_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
import unittest
2020

2121
import apache_beam as beam
22+
from apache_beam.ml.rag.embeddings.open_ai import OpenAITextEmbeddings
23+
from apache_beam.ml.rag.embeddings.test_utils import chunk_approximately_equals
2224
from apache_beam.ml.rag.types import Chunk
2325
from apache_beam.ml.rag.types import Content
2426
from apache_beam.ml.rag.types import Embedding
2527
from apache_beam.ml.transforms.base import MLTransform
2628
from apache_beam.testing.test_pipeline import TestPipeline
2729
from apache_beam.testing.util import assert_that
2830
from apache_beam.testing.util import equal_to
29-
from apache_beam.ml.rag.embeddings.open_ai import OpenAITextEmbeddings
30-
from apache_beam.ml.rag.embeddings.test_utils import chunk_approximately_equals
3131

3232

3333
class OpenAITextEmbeddingsTest(unittest.TestCase):

sdks/python/apache_beam/ml/rag/embeddings/vertex_ai_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
import unittest
2222

2323
import apache_beam as beam
24+
from apache_beam.ml.rag.embeddings.test_utils import chunk_approximately_equals
2425
from apache_beam.ml.rag.types import Chunk
2526
from apache_beam.ml.rag.types import Content
2627
from apache_beam.ml.rag.types import Embedding
2728
from apache_beam.ml.transforms.base import MLTransform
2829
from apache_beam.testing.test_pipeline import TestPipeline
2930
from apache_beam.testing.util import assert_that
3031
from apache_beam.testing.util import equal_to
31-
from apache_beam.ml.rag.embeddings.test_utils import chunk_approximately_equals
3232

3333
# pylint: disable=ungrouped-imports
3434
try:

sdks/python/apache_beam/ml/transforms/embeddings/open_ai.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@
2121
from typing import TypeVar
2222
from typing import Union
2323

24-
import apache_beam as beam
2524
import openai
25+
from openai import APIError
26+
from openai import RateLimitError
27+
28+
import apache_beam as beam
2629
from apache_beam.ml.inference.base import RemoteModelHandler
2730
from apache_beam.ml.inference.base import RunInference
2831
from apache_beam.ml.transforms.base import EmbeddingsManager
2932
from apache_beam.ml.transforms.base import _TextEmbeddingHandler
3033
from apache_beam.pvalue import PCollection
3134
from apache_beam.pvalue import Row
32-
from openai import APIError
33-
from openai import RateLimitError
3435

3536
__all__ = ["OpenAITextEmbeddings"]
3637

0 commit comments

Comments
 (0)