@@ -15,7 +15,6 @@ __all__ = [
15
15
"BadRequestError" ,
16
16
"Branch" ,
17
17
"BranchExistsError" ,
18
- "BranchHasChildrenError" ,
19
18
"BranchNotFoundError" ,
20
19
"BranchView" ,
21
20
"Branches" ,
@@ -24,7 +23,6 @@ __all__ = [
24
23
"CanNotCreateTensorWithProvidedCompressions" ,
25
24
"CannotDeleteMainBranchError" ,
26
25
"CannotRenameMainBranchError" ,
27
- "CannotTagUncommittedDatasetError" ,
28
26
"Client" ,
29
27
"Column" ,
30
28
"ColumnAlreadyExistsError" ,
@@ -77,6 +75,8 @@ __all__ = [
77
75
"NotLoggedInAgreementError" ,
78
76
"PushError" ,
79
77
"QuantizationType" ,
78
+ "Random" ,
79
+ "random" ,
80
80
"ReadOnlyDataset" ,
81
81
"ReadOnlyDatasetModificationError" ,
82
82
"ReadOnlyMetadata" ,
@@ -140,6 +140,8 @@ __all__ = [
140
140
"storage" ,
141
141
"tql" ,
142
142
"types" ,
143
+ "TelemetryClient" ,
144
+ "telemetry_client"
143
145
]
144
146
145
147
class Future :
@@ -739,6 +741,14 @@ class Client:
739
741
"""
740
742
endpoint : str
741
743
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
+
742
752
class Branch :
743
753
"""
744
754
Describes a branch within the dataset.
@@ -2152,6 +2162,38 @@ class Dataset(DatasetView):
2152
2162
"""
2153
2163
...
2154
2164
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
+
2155
2197
def tag (self , name : str , version : str | None = None ) -> Tag :
2156
2198
"""
2157
2199
Tags a version of the dataset. If no version is given, the current version is tagged.
@@ -2879,18 +2921,12 @@ class BranchExistsError(Exception):
2879
2921
class BranchNotFoundError (Exception ):
2880
2922
pass
2881
2923
2882
- class BranchHasChildrenError (Exception ):
2883
- pass
2884
-
2885
2924
class TagNotFoundError (Exception ):
2886
2925
pass
2887
2926
2888
2927
class TagExistsError (Exception ):
2889
2928
pass
2890
2929
2891
- class CannotTagUncommittedDatasetError (Exception ):
2892
- pass
2893
-
2894
2930
class PushError (Exception ):
2895
2931
pass
2896
2932
@@ -3176,7 +3212,7 @@ def create(
3176
3212
```
3177
3213
3178
3214
Raises:
3179
- ValueError : if a dataset already exists at the given URL
3215
+ LogExistsError : if a dataset already exists at the given URL
3180
3216
"""
3181
3217
3182
3218
def create_async (
@@ -3239,7 +3275,7 @@ def create_async(
3239
3275
```
3240
3276
3241
3277
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)
3243
3279
"""
3244
3280
3245
3281
def copy (
@@ -3661,3 +3697,10 @@ def from_coco(
3661
3697
"""
3662
3698
3663
3699
def __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