Skip to content

Commit 5f0831e

Browse files
artem1205octavia-squidington-iii
andauthored
feat: add sorting import option for ruff (#94)
Signed-off-by: Artem Inzhyyants <[email protected]> Co-authored-by: octavia-squidington-iii <[email protected]>
1 parent a8b1b2b commit 5f0831e

File tree

260 files changed

+415
-161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+415
-161
lines changed

airbyte_cdk/cli/source_declarative_manifest/_run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
from pathlib import Path
2626
from typing import Any, cast
2727

28+
from orjson import orjson
29+
2830
from airbyte_cdk.entrypoint import AirbyteEntrypoint, launch
2931
from airbyte_cdk.models import (
3032
AirbyteErrorTraceMessage,
@@ -42,7 +44,6 @@
4244
)
4345
from airbyte_cdk.sources.declarative.yaml_declarative_source import YamlDeclarativeSource
4446
from airbyte_cdk.sources.source import TState
45-
from orjson import orjson
4647

4748

4849
class SourceLocalYaml(YamlDeclarativeSource):

airbyte_cdk/config_observation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
from copy import copy
1111
from typing import Any, List, MutableMapping
1212

13+
from orjson import orjson
14+
1315
from airbyte_cdk.models import (
1416
AirbyteControlConnectorConfigMessage,
1517
AirbyteControlMessage,
@@ -18,7 +20,6 @@
1820
OrchestratorType,
1921
Type,
2022
)
21-
from orjson import orjson
2223

2324

2425
class ObservedDict(dict): # type: ignore # disallow_any_generics is set to True, and dict is equivalent to dict[Any]

airbyte_cdk/connector.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from typing import Any, Generic, Mapping, Optional, Protocol, TypeVar
1212

1313
import yaml
14+
1415
from airbyte_cdk.models import (
1516
AirbyteConnectionStatus,
1617
ConnectorSpecification,

airbyte_cdk/connector_builder/connector_builder_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
AirbyteRecordMessage,
1313
AirbyteStateMessage,
1414
ConfiguredAirbyteCatalog,
15+
Type,
1516
)
16-
from airbyte_cdk.models import Type
1717
from airbyte_cdk.models import Type as MessageType
1818
from airbyte_cdk.sources.declarative.declarative_source import DeclarativeSource
1919
from airbyte_cdk.sources.declarative.manifest_declarative_source import ManifestDeclarativeSource

airbyte_cdk/connector_builder/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import sys
77
from typing import Any, List, Mapping, Optional, Tuple
88

9+
from orjson import orjson
10+
911
from airbyte_cdk.connector import BaseConnector
1012
from airbyte_cdk.connector_builder.connector_builder_handler import (
1113
TestReadLimits,
@@ -25,7 +27,6 @@
2527
from airbyte_cdk.sources.declarative.manifest_declarative_source import ManifestDeclarativeSource
2628
from airbyte_cdk.sources.source import Source
2729
from airbyte_cdk.utils.traced_exception import AirbyteTracedException
28-
from orjson import orjson
2930

3031

3132
def get_config_and_catalog_from_args(

airbyte_cdk/destinations/destination.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from abc import ABC, abstractmethod
1010
from typing import Any, Iterable, List, Mapping
1111

12+
from orjson import orjson
13+
1214
from airbyte_cdk.connector import Connector
1315
from airbyte_cdk.exception_handler import init_uncaught_exception_handler
1416
from airbyte_cdk.models import (
@@ -20,7 +22,6 @@
2022
)
2123
from airbyte_cdk.sources.utils.schema_helpers import check_config_against_spec_or_exit
2224
from airbyte_cdk.utils.traced_exception import AirbyteTracedException
23-
from orjson import orjson
2425

2526
logger = logging.getLogger("airbyte")
2627

airbyte_cdk/destinations/vector_db_based/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
from typing import Any, Dict, List, Literal, Optional, Union
66

77
import dpath
8+
from pydantic.v1 import BaseModel, Field
9+
810
from airbyte_cdk.utils.oneof_option_config import OneOfOptionConfig
911
from airbyte_cdk.utils.spec_schema_transformations import resolve_refs
10-
from pydantic.v1 import BaseModel, Field
1112

1213

1314
class SeparatorSplitterConfigModel(BaseModel):

airbyte_cdk/destinations/vector_db_based/document_processor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
from typing import Any, Dict, List, Mapping, Optional, Tuple
99

1010
import dpath
11+
from langchain.text_splitter import Language, RecursiveCharacterTextSplitter
12+
from langchain.utils import stringify_dict
13+
from langchain_core.documents.base import Document
14+
1115
from airbyte_cdk.destinations.vector_db_based.config import (
1216
ProcessingConfigModel,
1317
SeparatorSplitterConfigModel,
@@ -21,9 +25,6 @@
2125
DestinationSyncMode,
2226
)
2327
from airbyte_cdk.utils.traced_exception import AirbyteTracedException, FailureType
24-
from langchain.text_splitter import Language, RecursiveCharacterTextSplitter
25-
from langchain.utils import stringify_dict
26-
from langchain_core.documents.base import Document
2728

2829
METADATA_STREAM_FIELD = "_ab_stream"
2930
METADATA_RECORD_ID_FIELD = "_ab_record_id"

airbyte_cdk/destinations/vector_db_based/embedder.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
from dataclasses import dataclass
88
from typing import List, Optional, Union, cast
99

10+
from langchain.embeddings.cohere import CohereEmbeddings
11+
from langchain.embeddings.fake import FakeEmbeddings
12+
from langchain.embeddings.localai import LocalAIEmbeddings
13+
from langchain.embeddings.openai import OpenAIEmbeddings
14+
1015
from airbyte_cdk.destinations.vector_db_based.config import (
1116
AzureOpenAIEmbeddingConfigModel,
1217
CohereEmbeddingConfigModel,
@@ -19,10 +24,6 @@
1924
from airbyte_cdk.destinations.vector_db_based.utils import create_chunks, format_exception
2025
from airbyte_cdk.models import AirbyteRecordMessage
2126
from airbyte_cdk.utils.traced_exception import AirbyteTracedException, FailureType
22-
from langchain.embeddings.cohere import CohereEmbeddings
23-
from langchain.embeddings.fake import FakeEmbeddings
24-
from langchain.embeddings.localai import LocalAIEmbeddings
25-
from langchain.embeddings.openai import OpenAIEmbeddings
2627

2728

2829
@dataclass

airbyte_cdk/entrypoint.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
from urllib.parse import urlparse
1717

1818
import requests
19+
from orjson import orjson
20+
from requests import PreparedRequest, Response, Session
21+
1922
from airbyte_cdk.connector import TConfig
2023
from airbyte_cdk.exception_handler import init_uncaught_exception_handler
2124
from airbyte_cdk.logger import init_logger
@@ -38,8 +41,6 @@
3841
from airbyte_cdk.utils.airbyte_secrets_utils import get_secrets, update_secrets
3942
from airbyte_cdk.utils.constants import ENV_REQUEST_CACHE_PATH
4043
from airbyte_cdk.utils.traced_exception import AirbyteTracedException
41-
from orjson import orjson
42-
from requests import PreparedRequest, Response, Session
4344

4445
logger = init_logger("airbyte")
4546

0 commit comments

Comments
 (0)