Skip to content

Commit

Permalink
get rid of cycle-imports
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBogdan committed Aug 13, 2021
1 parent 4b13843 commit e6d57a0
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 21 deletions.
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ good-names=i,
k,
ex,
Run,
do,
_

# Good variable names regexes, separated by a comma. If names match any regex,
Expand Down
4 changes: 2 additions & 2 deletions weaviate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'SchemaValidationException',
]

from .auth import AuthClientCredentials, AuthClientPassword
from .version import __version__
from .exceptions import *
from .auth import AuthClientCredentials, AuthClientPassword
from .client import Client
from .version import __version__
2 changes: 1 addition & 1 deletion weaviate/batch/crud_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from numbers import Real
from typing import Tuple, Callable, Optional, Sequence
from requests import ReadTimeout, Response
from weaviate import RequestsConnectionError, UnexpectedStatusCodeException
from weaviate.exceptions import RequestsConnectionError, UnexpectedStatusCodeException
from weaviate.connect import Connection
from .requests import BatchRequest, ObjectsBatchRequest, ReferenceBatchRequest

Expand Down
2 changes: 1 addition & 1 deletion weaviate/classification/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Classification class definition.
"""
import validators
from weaviate import UnexpectedStatusCodeException, RequestsConnectionError
from weaviate.exceptions import UnexpectedStatusCodeException, RequestsConnectionError
from weaviate.connect import Connection
from .config_builder import ConfigBuilder

Expand Down
4 changes: 2 additions & 2 deletions weaviate/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"""
from typing import Optional, Tuple, Union
from numbers import Real
from weaviate import UnexpectedStatusCodeException, RequestsConnectionError
from .auth import AuthCredentials
from .exceptions import UnexpectedStatusCodeException, RequestsConnectionError
from .connect import Connection
from .classification import Classification
from .schema import Schema
from .contextionary import Contextionary
from .batch import Batch
from .data import DataObject
from .gql import Query
from .auth import AuthCredentials


class Client:
Expand Down
2 changes: 1 addition & 1 deletion weaviate/connect/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from numbers import Real
import requests
from requests import RequestException
from weaviate import AuthenticationFailedException
from weaviate.exceptions import AuthenticationFailedException
from weaviate.auth import AuthCredentials
from weaviate.util import _get_valid_timeout_config

Expand Down
2 changes: 1 addition & 1 deletion weaviate/contextionary/crud_contextionary.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Contextionary class definition.
"""
from weaviate import RequestsConnectionError, UnexpectedStatusCodeException
from weaviate.exceptions import RequestsConnectionError, UnexpectedStatusCodeException
from weaviate.connect import Connection


Expand Down
8 changes: 5 additions & 3 deletions weaviate/data/crud_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
from typing import Union, Optional, List, Sequence
import validators
from weaviate.connect import Connection
from weaviate import ObjectAlreadyExistsException
from weaviate import RequestsConnectionError
from weaviate import UnexpectedStatusCodeException
from weaviate.exceptions import (
ObjectAlreadyExistsException,
RequestsConnectionError,
UnexpectedStatusCodeException
)
from weaviate.util import _get_dict_from_object, get_vector, get_valid_uuid
from weaviate.data.references import Reference

Expand Down
2 changes: 1 addition & 1 deletion weaviate/data/references/crud_references.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from typing import Union
from weaviate.connect import Connection
from weaviate import RequestsConnectionError, UnexpectedStatusCodeException
from weaviate.exceptions import RequestsConnectionError, UnexpectedStatusCodeException
from weaviate.util import get_valid_uuid


Expand Down
2 changes: 1 addition & 1 deletion weaviate/gql/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Optional
from abc import ABC, abstractmethod
from weaviate.connect import Connection
from weaviate import UnexpectedStatusCodeException, RequestsConnectionError
from weaviate.exceptions import UnexpectedStatusCodeException, RequestsConnectionError
from weaviate.util import get_vector

class GraphQL(ABC):
Expand Down
2 changes: 1 addition & 1 deletion weaviate/gql/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from typing import List, Union
from weaviate.connect import Connection
from weaviate import UnexpectedStatusCodeException, RequestsConnectionError
from weaviate.exceptions import UnexpectedStatusCodeException, RequestsConnectionError
from .get import GetBuilder
from .aggregate import AggregateBuilder

Expand Down
2 changes: 1 addition & 1 deletion weaviate/schema/crud_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Union, Optional
from weaviate.connect import Connection
from weaviate.util import _get_dict_from_object, _is_sub_schema
from weaviate import UnexpectedStatusCodeException, RequestsConnectionError
from weaviate.exceptions import UnexpectedStatusCodeException, RequestsConnectionError
from weaviate.schema.validate_schema import validate_schema, check_class
from weaviate.schema.properties import Property

Expand Down
2 changes: 1 addition & 1 deletion weaviate/schema/properties/crud_properties.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Property class definition.
"""
from weaviate import UnexpectedStatusCodeException, RequestsConnectionError
from weaviate.exceptions import UnexpectedStatusCodeException, RequestsConnectionError
from weaviate.schema.validate_schema import check_property
from weaviate.util import _get_dict_from_object
from weaviate.connect import Connection
Expand Down
2 changes: 1 addition & 1 deletion weaviate/schema/validate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Schema validation module.
"""
from typing import Any
from weaviate import SchemaValidationException
from weaviate.exceptions import SchemaValidationException


def validate_schema(schema: dict) -> None:
Expand Down
4 changes: 2 additions & 2 deletions weaviate/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import json
import base64
import uuid
import uuid as uuid_lib
from typing import Union, Sequence, Tuple, Any
from numbers import Real
from io import BufferedReader
Expand Down Expand Up @@ -446,4 +446,4 @@ def generate_uuid5(identifier: Any, namespace: Any = "") -> str:
The UUID as a string.
"""

return str(uuid.uuid5(uuid.NAMESPACE_DNS, str(namespace) + str(identifier)))
return str(uuid_lib.uuid5(uuid_lib.NAMESPACE_DNS, str(namespace) + str(identifier)))
2 changes: 1 addition & 1 deletion weaviate/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Weaviate-Python-Client version.
"""

__version__ = "3.0.0"
__version__ = "3.1.0.dev0"
2 changes: 1 addition & 1 deletion weaviate/wcs/crud_wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import json
from tqdm import tqdm
from weaviate.connect import Connection
from weaviate import RequestsConnectionError, UnexpectedStatusCodeException
from weaviate.exceptions import RequestsConnectionError, UnexpectedStatusCodeException
from weaviate.auth import AuthCredentials


Expand Down

0 comments on commit e6d57a0

Please sign in to comment.