Skip to content

Commit

Permalink
python 3.9 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Oct 15, 2024
1 parent 96bd7e6 commit c6c04be
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 132 deletions.
61 changes: 31 additions & 30 deletions tests/test_loaders_dumpers/models/books_normalized_pydantic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations
from enum import Enum
from typing import Optional
from pydantic import BaseModel as BaseModel, Field

metamodel_version = "None"
Expand Down Expand Up @@ -31,66 +32,66 @@ class GenreEnum(str, Enum):

class CreativeWork(ConfiguredBaseModel):

id: str | None = Field(None)
name: str | None = Field(None)
genres: list[GenreEnum] | None = Field(default_factory=list)
creator: Author | None = Field(None)
summary: str | None = Field(None)
reviews: list[Review] | None = Field(default_factory=list)
id: Optional[str] = Field(None)
name: Optional[str] = Field(None)
genres: Optional[list[GenreEnum]] = Field(default_factory=list)
creator: Optional[Author] = Field(None)
summary: Optional[str] = Field(None)
reviews: Optional[list[Review]] = Field(default_factory=list)



class Book(CreativeWork):

price: float | None = Field(None)
inStock: str | None = Field(None)
id: str | None = Field(None)
name: str | None = Field(None)
genres: list[GenreEnum] | None = Field(default_factory=list)
creator: Author | None = Field(None)
summary: str | None = Field(None)
reviews: list[Review] | None = Field(default_factory=list)
price: Optional[float] = Field(None)
inStock: Optional[str] = Field(None)
id: Optional[str] = Field(None)
name: Optional[str] = Field(None)
genres: Optional[list[GenreEnum]] = Field(default_factory=list)
creator: Optional[Author] = Field(None)
summary: Optional[str] = Field(None)
reviews: Optional[list[Review]] = Field(default_factory=list)



class BookSeries(CreativeWork):

books: list[Book] | None = Field(default_factory=list)
genres: list[GenreEnum] | None = Field(default_factory=list)
price: float | None = Field(None)
id: str | None = Field(None)
name: str | None = Field(None)
creator: Author | None = Field(None)
summary: str | None = Field(None)
reviews: list[Review] | None = Field(default_factory=list)
books: Optional[list[Book]] = Field(default_factory=list)
genres: Optional[list[GenreEnum]] = Field(default_factory=list)
price: Optional[float] = Field(None)
id: Optional[str] = Field(None)
name: Optional[str] = Field(None)
creator: Optional[Author] = Field(None)
summary: Optional[str] = Field(None)
reviews: Optional[list[Review]] = Field(default_factory=list)



class Author(ConfiguredBaseModel):

name: str | None = Field(None)
genres: list[GenreEnum] | None = Field(default_factory=list)
from_country: str | None = Field(None)
name: Optional[str] = Field(None)
genres: Optional[list[GenreEnum]] = Field(default_factory=list)
from_country: Optional[str] = Field(None)



class Shop(ConfiguredBaseModel):

all_book_series: list[BookSeries] | None = Field(default_factory=list)
all_book_series: Optional[list[BookSeries]] = Field(default_factory=list)



class Country(ConfiguredBaseModel):

name: str | None = Field(None)
name: Optional[str] = Field(None)



class Review(ConfiguredBaseModel):

creator: Author | None = Field(None)
rating: int | None = Field(None)
review_text: str | None = Field(None)
creator: Optional[Author] = Field(None)
rating: Optional[int] = Field(None)
review_text: Optional[str] = Field(None)



Expand Down
Loading

0 comments on commit c6c04be

Please sign in to comment.