Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #159

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black

Expand Down Expand Up @@ -28,7 +28,7 @@ repos:
]

- repo: https://github.com/PyCQA/flake8
rev: "6.1.0" # pick a git hash / tag to point to
rev: "7.0.0" # pick a git hash / tag to point to
hooks:
- id: flake8
additional_dependencies: ["flake8-bugbear"]
Expand Down
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()
}
Loading