Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 5, 2024
1 parent 9f15437 commit 54dddb5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ankipandas/ankidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ def _get_ids(self, n=1) -> list[int]:
def add_notes(
self,
nmodel: str,
nflds: (list[list[str]] | dict[str, list[str]] | list[dict[str, str]]),
nflds: list[list[str]] | dict[str, list[str]] | list[dict[str, str]],
ntags: list[list[str]] | None = None,
nid=None,
nguid=None,
Expand Down
6 changes: 3 additions & 3 deletions ankipandas/test/test_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ def test_update(self):
for mode in ["update", "replace", "append"]:
with self.subTest(mode=mode):
self._reset()
notes2.loc[
notes2["id"] == 1555579337683, "tags"
] = "definitelynew!"
notes2.loc[notes2["id"] == 1555579337683, "tags"] = (
"definitelynew!"
)
set_table(self.db_write, notes2, "notes", mode)
if mode == "append":
self._check_db_equal()
Expand Down
8 changes: 5 additions & 3 deletions ankipandas/util/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ def nested_dict():

def defaultdict2dict(defdict: collections.defaultdict) -> dict:
return {
key: defaultdict2dict(value)
if isinstance(value, collections.defaultdict)
else value
key: (
defaultdict2dict(value)
if isinstance(value, collections.defaultdict)
else value
)
for key, value in defdict.items()
}

0 comments on commit 54dddb5

Please sign in to comment.