We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ef391a commit 8b0f348Copy full SHA for 8b0f348
pydantic_extra_types/s3.py
@@ -8,7 +8,7 @@
8
from __future__ import annotations
9
10
import re
11
-from typing import Any, cast, ClassVar
+from typing import Any, ClassVar
12
13
from pydantic import GetCoreSchemaHandler
14
from pydantic_core import core_schema
@@ -47,8 +47,9 @@ def __init__(self, value: str) -> None:
47
match = self.patt.match(self.value)
48
if match is None:
49
raise ValueError(f'Invalid S3 path: {value!r}')
50
- groups = cast(tuple[str, str, str], match.groups())
51
- self.bucket, self.key, self.last_key = groups
+ self.bucket: str = match.group(1)
+ self._key: str = match.group(2)
52
+ self.last_key: str = match.group(3)
53
54
def __str__(self) -> str: # pragma: no cover
55
return self.value
0 commit comments