Skip to content

Commit

Permalink
Use pydantic shims
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek committed Jul 21, 2023
1 parent 60080dc commit a98f95f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/python_opensky/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@

from dataclasses import dataclass

from pydantic import BaseModel, Field
try:
from pydantic.v1 import BaseModel, Field
except ImportError:
from pydantic import BaseModel, Field

from .const import AircraftCategory, PositionSource
from .exceptions import OpenSkyCoordinateError


class StatesResponse(BaseModel):
class StatesResponse(BaseModel): # type: ignore[misc]
"""Represents the states response."""

states: list[StateVector] = Field(...)
time: int = Field(...)


class StateVector(BaseModel):
class StateVector(BaseModel): # type: ignore[misc]
"""Represents the state of a vehicle at a particular time.
Attributes
Expand Down

0 comments on commit a98f95f

Please sign in to comment.