diff --git a/dlt/destinations/impl/weaviate/configuration.py b/dlt/destinations/impl/weaviate/configuration.py index 211a6ec029..1a053e41f4 100644 --- a/dlt/destinations/impl/weaviate/configuration.py +++ b/dlt/destinations/impl/weaviate/configuration.py @@ -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 diff --git a/tests/load/weaviate/test_weaviate_client.py b/tests/load/weaviate/test_weaviate_client.py index 11d3f13db9..8c3344f152 100644 --- a/tests/load/weaviate/test_weaviate_client.py +++ b/tests/load/weaviate/test_weaviate_client.py @@ -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") diff --git a/tests/sources/helpers/rest_client/test_client.py b/tests/sources/helpers/rest_client/test_client.py index e7e9f7edc4..79a57d0e82 100644 --- a/tests/sources/helpers/rest_client/test_client.py +++ b/tests/sources/helpers/rest_client/test_client.py @@ -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( @@ -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):