Skip to content

Commit

Permalink
Merge pull request #184 from aisk/fix-error-type
Browse files Browse the repository at this point in the history
fix a type mismatch for TransactionCanceled
  • Loading branch information
y26805 authored Jun 17, 2024
2 parents eb5814e + 158fca7 commit ca86d46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/aiodynamo/errors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
from dataclasses import dataclass
from typing import Any, Dict, List, Union
from typing import Any, Dict, List, Optional


@dataclass(frozen=True)
Expand Down Expand Up @@ -117,11 +117,11 @@ class PointInTimeRecoveryUnavailable(AIODynamoError):


class TransactionCanceled(AIODynamoError):
cancellation_reasons: List[Union[CancellationReason, None]]
cancellation_reasons: List[Optional[CancellationReason]]

def __init__(self, body: Dict[str, Any]):
self.body = body
self.cancellation_reasons: List[CancellationReason] = [
self.cancellation_reasons: List[Optional[CancellationReason]] = [
CancellationReason(reason["Code"], reason["Message"])
if reason["Code"] != "None"
else None
Expand Down

0 comments on commit ca86d46

Please sign in to comment.