Skip to content

Commit

Permalink
remove WriteData type in python-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
0div committed Dec 13, 2024
1 parent 502c414 commit 724fbc6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
7 changes: 2 additions & 5 deletions packages/python-sdk/e2b/sandbox/filesystem/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@ class EntryInfo:
"""


WriteData = Union[str, bytes, IO]


@dataclass
dataclass
class WriteEntry:
"""
Contains path and data of the file to be written to the filesystem.
"""

path: str
data: WriteData
data: Union[str, bytes, IO]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from io import TextIOBase
from typing import AsyncIterator, List, Literal, Optional, overload, Union
from e2b.sandbox.filesystem.filesystem import WriteData, WriteEntry
from typing import AsyncIterator, IO, List, Literal, Optional, overload, Union
from e2b.sandbox.filesystem.filesystem import WriteEntry

import e2b_connect as connect
import httpcore
Expand Down Expand Up @@ -134,7 +134,7 @@ async def read(
async def write(
self,
path: str,
data: WriteData,
data: Union[str, bytes, IO],
user: Username = "user",
request_timeout: Optional[float] = None,
) -> EntryInfo:
Expand Down Expand Up @@ -174,7 +174,7 @@ async def write(
async def write(
self,
path_or_files: Union[str, List[WriteEntry]],
data_or_user: Union[WriteData, Username] = "user",
data_or_user: Union[str, bytes, IO, Username] = "user",
user_or_request_timeout: Optional[Union[float, Username]] = None,
request_timeout_or_none: Optional[float] = None
) -> Union[EntryInfo, List[EntryInfo]]:
Expand Down
8 changes: 4 additions & 4 deletions packages/python-sdk/e2b/sandbox_sync/filesystem/filesystem.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from io import TextIOBase
from typing import Iterator, List, Literal, Optional, overload, Union
from e2b.sandbox.filesystem.filesystem import WriteData, WriteEntry
from typing import IO, Iterator, List, Literal, Optional, overload, Union
from e2b.sandbox.filesystem.filesystem import WriteEntry

import e2b_connect
import httpcore
Expand Down Expand Up @@ -131,7 +131,7 @@ def read(
def write(
self,
path: str,
data: WriteData,
data: Union[str, bytes, IO],
user: Username = "user",
request_timeout: Optional[float] = None,
) -> EntryInfo:
Expand Down Expand Up @@ -174,7 +174,7 @@ def write(
def write(
self,
path_or_files: Union[str, List[WriteEntry]],
data_or_user: Union[WriteData, Username] = "user",
data_or_user: Union[str, bytes, IO, Username] = "user",
user_or_request_timeout: Optional[Union[float, Username]] = None,
request_timeout_or_none: Optional[float] = None
) -> Union[EntryInfo, List[EntryInfo]]:
Expand Down

0 comments on commit 724fbc6

Please sign in to comment.