Skip to content

Commit

Permalink
Fixed validator data typing to Mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
maykcaldas committed Jan 16, 2025
1 parent 52fbe24 commit 937eafb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions paperqa/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import os
import re
import warnings
from collections.abc import Collection
from copy import deepcopy
from collections.abc import Collection, Mapping
from datetime import datetime
from typing import Any, ClassVar, cast
from uuid import UUID, uuid4
Expand Down Expand Up @@ -609,8 +608,8 @@ def populate_bibtex_key_citation( # noqa: PLR0912

@model_validator(mode="before")
@classmethod
def validate_all_fields(cls, data: dict[str, Any]) -> dict[str, Any]:
data = deepcopy(data) # Avoid mutating input
def validate_all_fields(cls, data: Mapping[str, Any]) -> dict[str, Any]:
data = dict(data.items()) # Avoid mutating input
data = cls.lowercase_doi_and_populate_doc_id(data)
data = cls.remove_invalid_authors(data)
data = cls.misc_string_cleaning(data)
Expand Down

0 comments on commit 937eafb

Please sign in to comment.