Skip to content

Commit

Permalink
fixes weaviate test
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfix committed May 27, 2024
1 parent 34f5d83 commit f2742b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 3 additions & 1 deletion dlt/destinations/impl/weaviate/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def __str__(self) -> str:
class WeaviateClientConfiguration(DestinationClientDwhConfiguration):
destination_type: Final[str] = dataclasses.field(default="weaviate", init=False, repr=False, compare=False) # type: ignore
# make it optional so empty dataset is allowed
dataset_name: Annotated[Optional[str], NotResolved()] = None
dataset_name: Annotated[Optional[str], NotResolved()] = dataclasses.field(
default=None, init=False, repr=False, compare=False
)

batch_size: int = 100
batch_workers: int = 1
Expand Down
8 changes: 4 additions & 4 deletions tests/load/weaviate/test_weaviate_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def drop_weaviate_schema() -> Iterator[None]:


def get_client_instance(schema: Schema) -> WeaviateClient:
dest = weaviate(dataset_name="ClientTest" + uniq_id())
return dest.client(schema, dest.spec())
# with Container().injectable_context(ConfigSectionContext(sections=('destination', 'weaviate'))):
# return dest.client(schema, config)
dest = weaviate()
return dest.client(
schema, dest.spec()._bind_dataset_name(dataset_name="ClientTest" + uniq_id())
)


@pytest.fixture(scope="function")
Expand Down
2 changes: 0 additions & 2 deletions tests/sources/helpers/rest_client/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ def test_oauth_jwt_auth_success(self, rest_client: RESTClient):

assert_pagination(list(pages_iter))


def test_custom_session_client(self, mocker):
mocked_warning = mocker.patch.object(logger, "warning")
RESTClient(
Expand All @@ -202,7 +201,6 @@ def test_custom_session_client(self, mocker):
" behavior."
)


def test_custom_auth_success(self, rest_client: RESTClient):
class CustomAuthConfigBase(AuthConfigBase):
def __init__(self, token: str):
Expand Down

0 comments on commit f2742b9

Please sign in to comment.