@@ -15,7 +15,6 @@ __all__ = [
1515 "BadRequestError" ,
1616 "Branch" ,
1717 "BranchExistsError" ,
18- "BranchHasChildrenError" ,
1918 "BranchNotFoundError" ,
2019 "BranchView" ,
2120 "Branches" ,
@@ -24,7 +23,6 @@ __all__ = [
2423 "CanNotCreateTensorWithProvidedCompressions" ,
2524 "CannotDeleteMainBranchError" ,
2625 "CannotRenameMainBranchError" ,
27- "CannotTagUncommittedDatasetError" ,
2826 "Client" ,
2927 "Column" ,
3028 "ColumnAlreadyExistsError" ,
@@ -77,6 +75,8 @@ __all__ = [
7775 "NotLoggedInAgreementError" ,
7876 "PushError" ,
7977 "QuantizationType" ,
78+ "Random" ,
79+ "random" ,
8080 "ReadOnlyDataset" ,
8181 "ReadOnlyDatasetModificationError" ,
8282 "ReadOnlyMetadata" ,
@@ -140,6 +140,8 @@ __all__ = [
140140 "storage" ,
141141 "tql" ,
142142 "types" ,
143+ "TelemetryClient" ,
144+ "telemetry_client"
143145]
144146
145147class Future :
@@ -739,6 +741,14 @@ class Client:
739741 """
740742 endpoint : str
741743
744+ class Random :
745+ """
746+ A pseudorandom number generator class that allows for deterministic random number generation
747+ through seed control.
748+ """
749+
750+ seed : int | None
751+
742752class Branch :
743753 """
744754 Describes a branch within the dataset.
@@ -2152,6 +2162,38 @@ class Dataset(DatasetView):
21522162 """
21532163 ...
21542164
2165+ def merge (self , branch_name : str , version : str | None = None ) -> None :
2166+ """
2167+ Merge the given branch into the current branch. If no version is given, the current version will be picked up.
2168+
2169+ Parameters:
2170+ name: The name of the branch
2171+ version: The version of the dataset
2172+
2173+ <!-- test-context
2174+ ```python
2175+ import deeplake
2176+ ```
2177+ -->
2178+
2179+ Examples:
2180+ ```python
2181+ ds = deeplake.create("mem://merge_branch")
2182+ ds.add_column("c1", deeplake.types.Int64())
2183+ ds.append({"c1": [1, 2, 3]})
2184+ ds.commit()
2185+
2186+ b = ds.branch("Branch1")
2187+ branch_ds = b.open()
2188+ branch_ds.append({"c1": [4, 5, 6]})
2189+ branch_ds.commit()
2190+
2191+ ds.merge("Branch1")
2192+ print(len(ds))
2193+ ```
2194+ """
2195+ ...
2196+
21552197 def tag (self , name : str , version : str | None = None ) -> Tag :
21562198 """
21572199 Tags a version of the dataset. If no version is given, the current version is tagged.
@@ -2879,18 +2921,12 @@ class BranchExistsError(Exception):
28792921class BranchNotFoundError (Exception ):
28802922 pass
28812923
2882- class BranchHasChildrenError (Exception ):
2883- pass
2884-
28852924class TagNotFoundError (Exception ):
28862925 pass
28872926
28882927class TagExistsError (Exception ):
28892928 pass
28902929
2891- class CannotTagUncommittedDatasetError (Exception ):
2892- pass
2893-
28942930class PushError (Exception ):
28952931 pass
28962932
@@ -3176,7 +3212,7 @@ def create(
31763212 ```
31773213
31783214 Raises:
3179- ValueError : if a dataset already exists at the given URL
3215+ LogExistsError : if a dataset already exists at the given URL
31803216 """
31813217
31823218def create_async (
@@ -3239,7 +3275,7 @@ def create_async(
32393275 ```
32403276
32413277 Raises:
3242- ValueError : if a dataset already exists at the given URL (will be raised when the future is awaited)
3278+ RuntimeError : if a dataset already exists at the given URL (will be raised when the future is awaited)
32433279 """
32443280
32453281def copy (
@@ -3661,3 +3697,10 @@ def from_coco(
36613697 """
36623698
36633699def __prepare_atfork () -> None : ...
3700+
3701+ class TelemetryClient :
3702+ """
3703+ Client for logging deeplake messages to telemetry.
3704+ """
3705+ endpoint : str
3706+ api_key : str
0 commit comments