dasl-client 1.0.11__py3-none-any.whl → 1.0.13__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dasl-client might be problematic. Click here for more details.

dasl_client/client.py CHANGED
@@ -648,5 +648,7 @@ class Client:
648
648
  """
649
649
  with error_handler():
650
650
  return DataSourcePreset.from_api_obj(
651
- self._content_client().content_v1_get_preset_datasource(self._workspace(), name)
651
+ self._content_client().content_v1_get_preset_datasource(
652
+ self._workspace(), name
653
+ )
652
654
  )
@@ -2,9 +2,14 @@ from typing import Optional, List, Dict
2
2
  from pydantic import BaseModel
3
3
 
4
4
  from dasl_api import (
5
- ContentV1PresetDataSourceList, ContentV1PresetDataSourceListItemsInner, ContentV1DatasourcePresetAutoloader,
6
- ContentV1DatasourcePresetSilver, ContentV1DatasourcePresetSilverPreTransformInner,
7
- ContentV1DatasourcePresetSilverTransformInner, ContentV1DatasourcePresetGoldInner, ContentV1DatasourcePreset,
5
+ ContentV1PresetDataSourceList,
6
+ ContentV1PresetDataSourceListItemsInner,
7
+ ContentV1DatasourcePresetAutoloader,
8
+ ContentV1DatasourcePresetSilver,
9
+ ContentV1DatasourcePresetSilverPreTransformInner,
10
+ ContentV1DatasourcePresetSilverTransformInner,
11
+ ContentV1DatasourcePresetGoldInner,
12
+ ContentV1DatasourcePreset,
8
13
  ContentV1DatasourcePresetAutoloaderCloudFiles,
9
14
  )
10
15
 
@@ -22,7 +27,7 @@ class SilverPreset(BaseModel):
22
27
 
23
28
  @staticmethod
24
29
  def from_api_obj(
25
- obj: Optional[ContentV1DatasourcePresetSilverPreTransformInner],
30
+ obj: Optional[ContentV1DatasourcePresetSilverPreTransformInner],
26
31
  ) -> Optional["SilverPreset.PreTransform"]:
27
32
  if obj is None:
28
33
  return None
@@ -48,7 +53,7 @@ class SilverPreset(BaseModel):
48
53
 
49
54
  @staticmethod
50
55
  def from_api_obj(
51
- obj: Optional[ContentV1DatasourcePresetSilverTransformInner],
56
+ obj: Optional[ContentV1DatasourcePresetSilverTransformInner],
52
57
  ) -> Optional["SilverPreset.Transform"]:
53
58
  if obj is None:
54
59
  return None
@@ -70,22 +75,26 @@ class SilverPreset(BaseModel):
70
75
 
71
76
  @staticmethod
72
77
  def from_api_obj(
73
- obj: Optional[ContentV1DatasourcePresetSilver],
78
+ obj: Optional[ContentV1DatasourcePresetSilver],
74
79
  ) -> Optional["SilverPreset"]:
75
80
  if obj is None:
76
81
  return None
77
82
 
78
83
  if obj.pre_transform is not None:
79
- pre_transform = [SilverPreset.PreTransform.from_api_obj(item) for item in obj.pre_transform]
84
+ pre_transform = [
85
+ SilverPreset.PreTransform.from_api_obj(item)
86
+ for item in obj.pre_transform
87
+ ]
80
88
  else:
81
89
  pre_transform = None
82
90
 
83
91
  if obj.transform is not None:
84
- transform = [SilverPreset.Transform.from_api_obj(item) for item in obj.transform]
92
+ transform = [
93
+ SilverPreset.Transform.from_api_obj(item) for item in obj.transform
94
+ ]
85
95
  else:
86
96
  transform = None
87
97
 
88
-
89
98
  return SilverPreset(
90
99
  pre_transform=pre_transform,
91
100
  transform=transform,
@@ -102,7 +111,7 @@ class GoldPreset(BaseModel):
102
111
 
103
112
  @staticmethod
104
113
  def from_api_obj(
105
- obj: Optional[ContentV1DatasourcePresetGoldInner],
114
+ obj: Optional[ContentV1DatasourcePresetGoldInner],
106
115
  ) -> Optional["GoldPreset"]:
107
116
  if obj is None:
108
117
  return None
@@ -127,7 +136,7 @@ class PresetCloudFiles(BaseModel):
127
136
 
128
137
  @staticmethod
129
138
  def from_api_obj(
130
- obj: Optional[ContentV1DatasourcePresetAutoloaderCloudFiles],
139
+ obj: Optional[ContentV1DatasourcePresetAutoloaderCloudFiles],
131
140
  ) -> Optional["PresetCloudFiles"]:
132
141
  if obj is None:
133
142
  return None
@@ -146,7 +155,7 @@ class PresetAutoloader(BaseModel):
146
155
 
147
156
  @staticmethod
148
157
  def from_api_obj(
149
- obj: Optional[ContentV1DatasourcePresetAutoloader],
158
+ obj: Optional[ContentV1DatasourcePresetAutoloader],
150
159
  ) -> Optional["PresetAutoloader"]:
151
160
  if obj is None:
152
161
  return None
@@ -158,6 +167,7 @@ class PresetAutoloader(BaseModel):
158
167
  cloud_files=PresetCloudFiles.from_api_obj(obj.cloud_files),
159
168
  )
160
169
 
170
+
161
171
  class DataSourcePreset(BaseModel):
162
172
 
163
173
  name: Optional[str] = None
@@ -169,7 +179,7 @@ class DataSourcePreset(BaseModel):
169
179
 
170
180
  @staticmethod
171
181
  def from_api_obj(
172
- obj: Optional[ContentV1DatasourcePreset],
182
+ obj: Optional[ContentV1DatasourcePreset],
173
183
  ) -> Optional["DataSourcePreset"]:
174
184
  if obj is None:
175
185
  return None
@@ -182,7 +192,7 @@ class DataSourcePreset(BaseModel):
182
192
  silver=SilverPreset.from_api_obj(obj.silver),
183
193
  gold=[GoldPreset.from_api_obj(item) for item in obj.gold],
184
194
  )
185
-
195
+
186
196
 
187
197
  class DataSourcePresetSummary(BaseModel):
188
198
  name: Optional[str] = None
@@ -195,7 +205,7 @@ class DataSourcePresetSummary(BaseModel):
195
205
 
196
206
  @staticmethod
197
207
  def from_api_obj(
198
- obj: Optional[ContentV1PresetDataSourceListItemsInner],
208
+ obj: Optional[ContentV1PresetDataSourceListItemsInner],
199
209
  ) -> Optional["DataSourcePresetSummary"]:
200
210
  if obj is None:
201
211
  return None
@@ -210,6 +220,7 @@ class DataSourcePresetSummary(BaseModel):
210
220
  icon_url=obj.icon_url,
211
221
  )
212
222
 
223
+
213
224
  class DataSourcePresetsList(BaseModel):
214
225
  kind: Optional[str] = None
215
226
  cursor: Optional[str] = None
@@ -217,7 +228,7 @@ class DataSourcePresetsList(BaseModel):
217
228
 
218
229
  @staticmethod
219
230
  def from_api_obj(
220
- obj: Optional[ContentV1PresetDataSourceList],
231
+ obj: Optional[ContentV1PresetDataSourceList],
221
232
  ) -> Optional["DataSourcePresetsList"]:
222
233
  if obj is None:
223
234
  return None
@@ -228,8 +239,5 @@ class DataSourcePresetsList(BaseModel):
228
239
  return DataSourcePresetsList(
229
240
  kind=obj.kind,
230
241
  cursor=cursor,
231
- items=[
232
- DataSourcePresetSummary.from_api_obj(item)
233
- for item in obj.items
234
- ],
235
- )
242
+ items=[DataSourcePresetSummary.from_api_obj(item) for item in obj.items],
243
+ )
dasl_client/types/rule.py CHANGED
@@ -18,6 +18,7 @@ from dasl_api import (
18
18
  CoreV1RuleObservableRisk,
19
19
  CoreV1RuleSpecOutput,
20
20
  CoreV1RuleSpecCollate,
21
+ CoreV1RuleSpecInputBatchCustom,
21
22
  )
22
23
 
23
24
  from .helpers import Helpers
@@ -251,9 +252,9 @@ class Rule(BaseModel):
251
252
  Input if the rule should operate on batched input data.
252
253
  """
253
254
 
254
- class Custom(BaseModel):
255
+ class CustomStream(BaseModel):
255
256
  """
256
- Specification of a custom notebook for generating input to
257
+ Specification of a stream custom notebook for generating input to
257
258
  the Rule.
258
259
 
259
260
  Attributes:
@@ -267,10 +268,10 @@ class Rule(BaseModel):
267
268
  @staticmethod
268
269
  def from_api_obj(
269
270
  obj: Optional[CoreV1RuleSpecInputStreamCustom],
270
- ) -> "Rule.Input.Custom":
271
+ ) -> "Rule.Input.CustomStream":
271
272
  if obj is None:
272
273
  return None
273
- return Rule.Input.Custom(
274
+ return Rule.Input.CustomStream(
274
275
  notebook=obj.notebook,
275
276
  options=obj.options,
276
277
  )
@@ -281,6 +282,36 @@ class Rule(BaseModel):
281
282
  options=self.options,
282
283
  )
283
284
 
285
+ class CustomBatch(BaseModel):
286
+ """
287
+ Specification of a batch custom notebook for generating input to
288
+ the Rule.
289
+
290
+ Attributes:
291
+ notebook (Optional[str]):
292
+ options (Optional[Dict[str, str]]):
293
+ """
294
+
295
+ notebook: Optional[str] = None
296
+ options: Optional[Dict[str, str]] = None
297
+
298
+ @staticmethod
299
+ def from_api_obj(
300
+ obj: Optional[CoreV1RuleSpecInputBatchCustom],
301
+ ) -> "Rule.Input.CustomBatch":
302
+ if obj is None:
303
+ return None
304
+ return Rule.Input.CustomBatch(
305
+ notebook=obj.notebook,
306
+ options=obj.options,
307
+ )
308
+
309
+ def to_api_obj(self) -> CoreV1RuleSpecInputBatchCustom:
310
+ return CoreV1RuleSpecInputBatchCustom(
311
+ notebook=self.notebook,
312
+ options=self.options,
313
+ )
314
+
284
315
  class Stream(BaseModel):
285
316
  """
286
317
  Specification for streaming input from a table or tables,
@@ -290,7 +321,7 @@ class Rule(BaseModel):
290
321
  tables (Optional[List[Rule.Input.Stream.Table]]):
291
322
  filter (Optional[str]):
292
323
  sql (Optional[str]):
293
- custom (Optional[Rule.Input.Custom]):
324
+ custom (Optional[Rule.Input.CustomStream]):
294
325
  """
295
326
 
296
327
  class Table(BaseModel):
@@ -395,7 +426,7 @@ class Rule(BaseModel):
395
426
  tables: Optional[List["Rule.Input.Stream.Table"]] = None
396
427
  filter: Optional[str] = None
397
428
  sql: Optional[str] = None
398
- custom: Optional["Rule.Input.Custom"] = None
429
+ custom: Optional["Rule.Input.CustomStream"] = None
399
430
 
400
431
  @staticmethod
401
432
  def from_api_obj(
@@ -413,7 +444,7 @@ class Rule(BaseModel):
413
444
  tables=tables,
414
445
  filter=obj.filter,
415
446
  sql=obj.sql,
416
- custom=Rule.Input.Custom.from_api_obj(obj.custom),
447
+ custom=Rule.Input.CustomStream.from_api_obj(obj.custom),
417
448
  )
418
449
 
419
450
  def to_api_obj(self) -> CoreV1RuleSpecInputStream:
@@ -434,11 +465,11 @@ class Rule(BaseModel):
434
465
 
435
466
  Attributes:
436
467
  sql (Optional[str]):
437
- custom (Optional[Rule.Input.Custom]):
468
+ custom (Optional[Rule.Input.CustomBatch]):
438
469
  """
439
470
 
440
471
  sql: Optional[str] = None
441
- custom: Optional["Rule.Input.Custom"] = None
472
+ custom: Optional["Rule.Input.CustomBatch"] = None
442
473
 
443
474
  @staticmethod
444
475
  def from_api_obj(
@@ -448,7 +479,7 @@ class Rule(BaseModel):
448
479
  return None
449
480
  return Rule.Input.Batch(
450
481
  sql=obj.sql,
451
- custom=Rule.Input.Custom.from_api_obj(obj.custom),
482
+ custom=Rule.Input.CustomBatch.from_api_obj(obj.custom),
452
483
  )
453
484
 
454
485
  def to_api_obj(self) -> CoreV1RuleSpecInputBatch:
@@ -656,6 +656,7 @@ class WorkspaceConfig(BaseModel):
656
656
  ),
657
657
  observables=Helpers.maybe(to_api_obj, self.observables),
658
658
  dasl_storage_path=self.dasl_storage_path,
659
+ dasl_custom_presets_path=self.dasl_custom_presets_path,
659
660
  default_config=Helpers.maybe(to_api_obj, self.default_config),
660
661
  managed_retention=managed_retention,
661
662
  ),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dasl_client
3
- Version: 1.0.11
3
+ Version: 1.0.13
4
4
  Summary: The DASL client library used for interacting with the DASL workspace
5
5
  Home-page: https://github.com/antimatter/asl
6
6
  Author: Antimatter Team
@@ -8,7 +8,7 @@ Author-email: Antimatter Team <support@antimatter.io>
8
8
  Requires-Python: >=3.8
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
- Requires-Dist: dasl-api ==0.1.14
11
+ Requires-Dist: dasl-api ==0.1.15
12
12
  Requires-Dist: databricks-sdk >=0.41.0
13
13
  Requires-Dist: pydantic >=2
14
14
  Requires-Dist: typing-extensions ==4.10.0
@@ -1,5 +1,5 @@
1
1
  dasl_client/__init__.py,sha256=E6gOgO8qg96Y38JKA-4LyNBvc2ytQPEfhdniYsCWBxA,127
2
- dasl_client/client.py,sha256=6VxOBiIwWKFAI6FX_buW-Pw4qOg19QWHY6sWQmm7d1w,25381
2
+ dasl_client/client.py,sha256=jiILjQOB4OuXXj7J0ZBYEN-pnHm8VQjj1Jqf54eJvS8,25419
3
3
  dasl_client/helpers.py,sha256=hi_SrFhEqBuLWOteuQlv__Atzq2VMCgY7A8xSt3ztuA,1035
4
4
  dasl_client/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  dasl_client/auth/auth.py,sha256=yTeijYYpfJVJ_wYyq0U6kAntg4xz5MzIR37_CpVR57k,7277
@@ -15,15 +15,15 @@ dasl_client/preset_development/preview_parameters.py,sha256=KRk3lTImyvJTeEcepwOS
15
15
  dasl_client/preset_development/stage.py,sha256=NiDuFiKvoXgqVPPjzB3TZQN1dQeVff6he6oaSVGwkCs,20154
16
16
  dasl_client/types/__init__.py,sha256=GsXC3eWuv21VTLPLPH9pzM95JByaKnKrPjJkh2rlZfQ,170
17
17
  dasl_client/types/admin_config.py,sha256=Kmx3Kuai9_LWMeO2NpWasRUgLihYSEXGtuYVfG0FkjU,2200
18
- dasl_client/types/content.py,sha256=gC3NrKrH7C1bhQv-X4ZGbD1XyutZGzARqfQf7xXJY2M,7299
18
+ dasl_client/types/content.py,sha256=b_4-6rcA6uP0aPN-nBd1QonwQ5Bc4lnrHlL6MKYnl8U,7311
19
19
  dasl_client/types/datasource.py,sha256=-ABmBh5yZwHeY-PKQMnNCNa9FSzod5n1O817m8ZCL6o,52519
20
20
  dasl_client/types/dbui.py,sha256=RZV_YxCc5KIHLcDLO5Gb1t3KnS8JKN4PbhnYGsVJiws,13200
21
21
  dasl_client/types/helpers.py,sha256=gLGTvrssAKrdkQT9h80twEosld2egwhvj-zAudxWFPs,109
22
- dasl_client/types/rule.py,sha256=NEdTwU8xtJwJHCv6LQIXVHs90XL6NZRF8auTSKr0ypk,24697
22
+ dasl_client/types/rule.py,sha256=BqhWhT8Eh95UXNytd0PxVcjqYuWQcdN1tfKjUB4Tk74,25781
23
23
  dasl_client/types/types.py,sha256=DeUOfdYGOhUGEy7yKOfo0OYTXYRrs57yYgNLUbu7Tlc,8806
24
- dasl_client/types/workspace_config.py,sha256=73O1qNhp15Q5fjq1WYs9cLDkjvLWbaU-ZxFOoN9krWU,24806
25
- dasl_client-1.0.11.dist-info/LICENSE,sha256=M35UepUPyKmFkvENlkweeaMElheQqNoM5Emh8ADO-rs,4
26
- dasl_client-1.0.11.dist-info/METADATA,sha256=T-1m_uZqV1mB8itA7vYhpTBZrhoaSAo8XCC3mVcV7Qk,741
27
- dasl_client-1.0.11.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
28
- dasl_client-1.0.11.dist-info/top_level.txt,sha256=kIv8ox_2oJPjGB8_yuey5vvuPCyfY8kywG138f9oSOY,12
29
- dasl_client-1.0.11.dist-info/RECORD,,
24
+ dasl_client/types/workspace_config.py,sha256=RThg_THS_4leITWdzBPTWdR2ytq5Uk36m6nIOUMzFCM,24878
25
+ dasl_client-1.0.13.dist-info/LICENSE,sha256=M35UepUPyKmFkvENlkweeaMElheQqNoM5Emh8ADO-rs,4
26
+ dasl_client-1.0.13.dist-info/METADATA,sha256=fXnfud7SFjMSDN_6MTVTwjpDmhV3Rio_ECGDZ36RZIA,741
27
+ dasl_client-1.0.13.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
28
+ dasl_client-1.0.13.dist-info/top_level.txt,sha256=kIv8ox_2oJPjGB8_yuey5vvuPCyfY8kywG138f9oSOY,12
29
+ dasl_client-1.0.13.dist-info/RECORD,,