Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanocerza committed Feb 15, 2024
1 parent 5bf2f8e commit 74406e5
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from typing import Any, Dict, Type

from haystack.core.errors import DeserializationError
from haystack.core.serialization import default_from_dict, default_to_dict
from haystack.utils.auth import Secret, deserialize_secrets_inplace

from weaviate.auth import AuthApiKey as WeaviateAuthApiKey
Expand Down Expand Up @@ -49,11 +48,11 @@ def to_dict(self) -> Dict[str, Any]:
Converts the object to a dictionary representation for serialization.
"""
_fields = {}
for field in fields(self):
if field.type is Secret:
_fields[field.name] = getattr(self, field.name).to_dict()
for _field in fields(self):
if _field.type is Secret:
_fields[_field.name] = getattr(self, _field.name).to_dict()
else:
_fields[field.name] = getattr(self, field.name)
_fields[_field.name] = getattr(self, _field.name)

return {"type": str(SupportedAuthTypes.from_class(self.__class__)), "init_parameters": _fields}

Expand Down

0 comments on commit 74406e5

Please sign in to comment.