Skip to content

Commit

Permalink
refactor: add Union to content (2nd) parameter in upload function
Browse files Browse the repository at this point in the history
  • Loading branch information
cornzyblack committed Jan 3, 2024
1 parent 193c3fb commit 677c820
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions databricks/sdk/mixins/workspace.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import BinaryIO, Iterator, Optional
from typing import BinaryIO, Iterator, Optional, Union

from ..core import DatabricksError
from ..service.workspace import (ExportFormat, ImportFormat, Language,
Expand Down Expand Up @@ -37,7 +37,7 @@ def list(self,

def upload(self,
path: str,
content: BinaryIO,
content: Union[bytes, BinaryIO],
*,
format: Optional[ImportFormat] = None,
language: Optional[Language] = None,
Expand All @@ -51,7 +51,7 @@ def upload(self,
* `INVALID_PARAMETER_VALUE`: if `format` and `content` values are not compatible.
:param path: target location of the file on workspace.
:param content: file-like `io.BinaryIO` of the `path` contents.
:param content: the contents as either raw binary data `bytes` or a file-like the file-like `io.BinaryIO` of the `path` contents.
:param format: By default, `ImportFormat.SOURCE`. If using `ImportFormat.AUTO` the `path`
is imported or exported as either a workspace file or a notebook, depending
on an analysis of the `item`’s extension and the header content provided in
Expand Down

0 comments on commit 677c820

Please sign in to comment.