Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
mhordynski committed Nov 29, 2024
1 parent a9f47d4 commit e93a656
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
SimpleTypes = str | int | float | bool | None


def flatten_dict(
input_dict: dict[str, Any], parent_key: str = "", sep: str = "."
) -> dict[str, SimpleTypes]:
def flatten_dict(input_dict: dict[str, Any], parent_key: str = "", sep: str = ".") -> dict[str, SimpleTypes]:
"""
Recursively flatten a nested dictionary and lists, converting non-primitive types to strings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,4 @@ async def list(
@staticmethod
def _flatten_metadata(metadata: dict) -> dict:
"""Flattens the metadata dictionary. Removes any None values as they are not supported by ChromaDB."""
return {k: v for k, v in flatten_dict(metadata).items() if v is not None}
return {k: v for k, v in flatten_dict(metadata).items() if v is not None}

0 comments on commit e93a656

Please sign in to comment.