Skip to content

Commit

Permalink
Merge pull request #39 from questionlp/develop
Browse files Browse the repository at this point in the history
Fix issue where scores are returned as int rather than Decimal for panelist/scores
  • Loading branch information
questionlp authored Aug 30, 2023
2 parents 462951e + 73d8008 commit b4f0fba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changes

## 2.3.2

### Application Changes

- Fix issue where `panelists/scores/id` and `panelists/scores/slug` return scores as `int` instead of `Decimal` due to `Union[int, Decimal]` would return an `int`. Switched to `Union[Decimal, int]` to allow `Decimal` to take precedence

## 2.3.1

### Component Changes
Expand Down
2 changes: 1 addition & 1 deletion app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from typing import Any, Dict

API_VERSION = "2.0"
APP_VERSION = "2.3.1"
APP_VERSION = "2.3.2"


def load_config(
Expand Down
4 changes: 2 additions & 2 deletions app/models/panelists.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""Panelists Models"""

from decimal import Decimal
from typing import List, Optional, Tuple
from typing import List, Optional, Tuple, Union
from pydantic import BaseModel, conint, Field


Expand Down Expand Up @@ -193,7 +193,7 @@ class PanelistScoresList(BaseModel):
shows: Optional[List[str]] = Field(
default=None, title="List of Panelist Appearances as Show Dates"
)
scores: Optional[List[int]] = Field(default=None, title="List of Panelist Scores")
scores: Optional[List[Union[Decimal, int]]] = Field(default=None, title="List of Panelist Scores")


class ScoresOrderedPair(BaseModel):
Expand Down

0 comments on commit b4f0fba

Please sign in to comment.