Skip to content

Commit

Permalink
Use Union instead of |
Browse files Browse the repository at this point in the history
  • Loading branch information
fqqb committed Mar 5, 2024
1 parent d043ff0 commit 7b07dbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions yamcs-client/src/yamcs/storage/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import IO, Any, Iterable, Mapping, Optional
from typing import IO, Any, Iterable, Mapping, Optional, Union

from yamcs.core.context import Context
from yamcs.core.exceptions import NotFound
Expand Down Expand Up @@ -123,7 +123,7 @@ def upload_object(
self,
bucket_name: str,
object_name: str,
file_obj: str | IO,
file_obj: Union[str, IO],
content_type: Optional[str] = None,
metadata: Optional[Mapping[str, str]] = None,
):
Expand Down
10 changes: 7 additions & 3 deletions yamcs-client/src/yamcs/storage/model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import datetime
from typing import IO, List, Mapping, Optional
from typing import IO, List, Mapping, Optional, Union

from yamcs.core.helpers import parse_server_time

Expand Down Expand Up @@ -93,7 +93,7 @@ def download_object(self, object_name: str) -> bytes:
def upload_object(
self,
object_name: str,
file_obj: str | IO,
file_obj: Union[str, IO],
content_type: Optional[str] = None,
metadata: Optional[Mapping[str, str]] = None,
):
Expand Down Expand Up @@ -181,7 +181,11 @@ def download(self):
"""
return self._storage_client.download_object(self._bucket, self.name)

def upload(self, file_obj: str | IO, metadata: Optional[Mapping[str, str]] = None):
def upload(
self,
file_obj: Union[str, IO],
metadata: Optional[Mapping[str, str]] = None,
):
"""
Replace the content of this object.
Expand Down

0 comments on commit 7b07dbd

Please sign in to comment.