From 677c8200db64d1c2185aa87500de8a534d01d4c8 Mon Sep 17 00:00:00 2001 From: Eniwoke Date: Wed, 3 Jan 2024 12:22:28 +0000 Subject: [PATCH] refactor: add Union to content (2nd) parameter in upload function --- databricks/sdk/mixins/workspace.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/databricks/sdk/mixins/workspace.py b/databricks/sdk/mixins/workspace.py index 9409a1112..b492521ca 100644 --- a/databricks/sdk/mixins/workspace.py +++ b/databricks/sdk/mixins/workspace.py @@ -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, @@ -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, @@ -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