diff --git a/python/deeplake/__init__.py b/python/deeplake/__init__.py index 37019dc04e..19173be1d5 100644 --- a/python/deeplake/__init__.py +++ b/python/deeplake/__init__.py @@ -6,7 +6,7 @@ import deeplake from ._deeplake import * -__version__ = "4.0.2" +__version__ = "4.0.3" __all__ = [ "__version__", @@ -34,6 +34,7 @@ "ColumnAlreadyExistsError", "ColumnDoesNotExistError", "InvalidColumnValueError", + "PushError", "GcsStorageProviderFailed", "History", "InvalidType", diff --git a/python/deeplake/__init__.pyi b/python/deeplake/__init__.pyi index 6ba6acc7c6..2275e15856 100644 --- a/python/deeplake/__init__.pyi +++ b/python/deeplake/__init__.pyi @@ -32,6 +32,7 @@ __all__ = [ "ColumnAlreadyExistsError", "ColumnDoesNotExistError", "InvalidColumnValueError", + "PushError", "GcsStorageProviderFailed", "History", "InvalidType", @@ -380,6 +381,9 @@ class TagExistsError(Exception): class CannotTagUncommittedDatasetError(Exception): pass +class PushError(Exception): + pass + class Tags: """ Provides access to the tags within a dataset. @@ -1155,7 +1159,7 @@ class Dataset(DatasetView): """Restores dataset from a pickled state. Args: - state (dict): The pickled state used to restore the dataset. + arg0 (dict): The pickled state used to restore the dataset. """ def add_column( @@ -1331,6 +1335,57 @@ class Dataset(DatasetView): Asynchronously reverts any in-progress changes to the dataset you have made. Does not revert any changes that have been committed. """ + def push(self, url: str, creds: dict[str, str] | None = None, token: str | None = None) -> None: + """ + Pushes any new history from this dataset to the dataset at the given url + + Similar to [deeplake.Dataset.pull][] but the other direction. + + Parameters: + url: The URL of the destination dataset + creds: Optional credentials needed to connect to the dataset + token: Optional deeplake token + """ + ... + def push_async(self, url: str, creds: dict[str, str] | None = None, token: str | None = None) -> FutureVoid: + """ + Asynchronously Pushes new any history from this dataset to the dataset at the given url + + Similar to [deeplake.Dataset.pull_async][] but the other direction. + + Parameters: + url: The URL of the destination dataset + creds: Optional credentials needed to connect to the dataset + token: Optional deeplake token + """ + ... + + def pull(self, url: str, creds: dict[str, str] | None = None, token: str | None = None) -> None: + """ + Pulls any new history from the dataset at the passed url into this dataset. + + Similar to [deeplake.Dataset.push][] but the other direction. + + Parameters: + url: The URL of the destination dataset + creds: Optional credentials needed to connect to the dataset + token: Optional deeplake token + """ + ... + def pull_async(self, url: str, creds: dict[str, str] | None = None, token: str | None = None) -> FutureVoid: + """ + Asynchronously pulls any new history from the dataset at the passed url into this dataset. + + Similar to [deeplake.Dataset.push_async][] but the other direction. + + Parameters: + url: The URL of the destination dataset + creds: Optional credentials needed to connect to the dataset + token: Optional deeplake token + """ + ... + + @property def history(self) -> History: """ @@ -1406,7 +1461,7 @@ class ReadOnlyDataset(DatasetView): @property def tags(self) -> TagsView: """ - The collection of [deeplake.TagsView][] within the dataset + The collection of [deeplake.TagView][]s within the dataset """ ... @@ -1474,6 +1529,27 @@ class ReadOnlyDataset(DatasetView): """ ... + def push(self, url: str, creds: dict[str, str] | None = None, token: str | None = None) -> None: + """ + Pushes any history from this dataset to the dataset at the given url + + Parameters: + url: The URL of the destination dataset + creds: Optional credentials needed to connect to the dataset + token: Optional deeplake token + """ + ... + def push_async(self, url: str, creds: dict[str, str] | None = None, token: str | None = None) -> FutureVoid: + """ + Asynchronously Pushes any history from this dataset to the dataset at the given url + + Parameters: + url: The URL of the destination dataset + creds: Optional credentials needed to connect to the dataset + token: Optional deeplake token + """ + ... + def __getstate__(self) -> tuple: """Returns a dict that can be pickled and used to restore this dataset. @@ -1803,7 +1879,7 @@ def create(url: str, creds: dict[str, str] | None = None, token: str | None = No - To use credentials managed in your Activeloop organization, use they key 'creds_key': 'managed_key_name'. This requires the org_id dataset argument to be set. - If nothing is given is, credentials are fetched from the environment variables. This is also the case when creds is not passed for cloud datasets token (str, optional): Activeloop token, used for fetching credentials to the dataset at path if it is a Deep Lake dataset. This is optional, tokens are normally autogenerated. - schema (dict): The initial schema to use for the dataset. See `deeplake.schema` such as [deeplake.schemas.TextDocuments][] for common starting schemas. + schema (dict): The initial schema to use for the dataset. See `deeplake.schema` such as [deeplake.schemas.TextEmbeddings][] for common starting schemas. Examples: >>> import deeplake