erdo 0.1.4__py3-none-any.whl → 0.1.6__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 erdo might be problematic. Click here for more details.

@@ -133,48 +133,49 @@ class _BaseCondition:
133
133
  return _NotCondition(self)
134
134
 
135
135
 
136
- class IsNull(_BaseCondition):
137
- def __init__(self, key: Any = None) -> None:
138
- self.key = key
136
+ class IsErrorInfoNeeded(_BaseCondition):
137
+ def __init__(self) -> None:
138
+ pass
139
139
 
140
140
  def to_dict(self) -> Dict[str, Any]:
141
141
  """Convert to dict format expected by backend."""
142
- result: Dict[str, Any] = {}
143
- result["type"] = "IsNull"
142
+ return {"type": "IsErrorInfoNeeded", "leaf": {}}
144
143
 
145
- # Add field values to leaf object (backend expects leaf format)
146
- leaf: Dict[str, Any] = {}
147
- if self.key is not None:
148
- leaf["key"] = self.key
149
144
 
150
- if leaf:
151
- result["leaf"] = leaf
145
+ class IsErrorTerminated(_BaseCondition):
146
+ def __init__(self) -> None:
147
+ pass
152
148
 
153
- return result
149
+ def to_dict(self) -> Dict[str, Any]:
150
+ """Convert to dict format expected by backend."""
151
+ return {"type": "IsErrorTerminated", "leaf": {}}
154
152
 
155
153
 
156
- class IsSuccess(_BaseCondition):
154
+ class IsFormattedError(_BaseCondition):
157
155
  def __init__(self) -> None:
158
156
  pass
159
157
 
160
158
  def to_dict(self) -> Dict[str, Any]:
161
159
  """Convert to dict format expected by backend."""
162
- return {"type": "IsSuccess", "leaf": {}}
160
+ return {"type": "IsFormattedError", "leaf": {}}
163
161
 
164
162
 
165
- class AndCondition(_BaseCondition):
166
- def __init__(self, conditions: Any = None) -> None:
167
- self.conditions = conditions
163
+ class TextEndsWith(_BaseCondition):
164
+ def __init__(self, text: Any = None, value: Any = None) -> None:
165
+ self.text = text
166
+ self.value = value
168
167
 
169
168
  def to_dict(self) -> Dict[str, Any]:
170
169
  """Convert to dict format expected by backend."""
171
170
  result: Dict[str, Any] = {}
172
- result["type"] = "AndCondition"
171
+ result["type"] = "TextEndsWith"
173
172
 
174
173
  # Add field values to leaf object (backend expects leaf format)
175
174
  leaf: Dict[str, Any] = {}
176
- if self.conditions is not None:
177
- leaf["conditions"] = self.conditions
175
+ if self.text is not None:
176
+ leaf["text"] = self.text
177
+ if self.value is not None:
178
+ leaf["value"] = self.value
178
179
 
179
180
  if leaf:
180
181
  result["leaf"] = leaf
@@ -182,20 +183,20 @@ class AndCondition(_BaseCondition):
182
183
  return result
183
184
 
184
185
 
185
- class EarlierThan(_BaseCondition):
186
- def __init__(self, time: Any = None, value: Any = None) -> None:
187
- self.time = time
186
+ class IsAny(_BaseCondition):
187
+ def __init__(self, key: Any = None, value: Any = None) -> None:
188
+ self.key = key
188
189
  self.value = value
189
190
 
190
191
  def to_dict(self) -> Dict[str, Any]:
191
192
  """Convert to dict format expected by backend."""
192
193
  result: Dict[str, Any] = {}
193
- result["type"] = "EarlierThan"
194
+ result["type"] = "IsAny"
194
195
 
195
196
  # Add field values to leaf object (backend expects leaf format)
196
197
  leaf: Dict[str, Any] = {}
197
- if self.time is not None:
198
- leaf["time"] = self.time
198
+ if self.key is not None:
199
+ leaf["key"] = self.key
199
200
  if self.value is not None:
200
201
  leaf["value"] = self.value
201
202
 
@@ -205,22 +206,22 @@ class EarlierThan(_BaseCondition):
205
206
  return result
206
207
 
207
208
 
208
- class FalseCondition(_BaseCondition):
209
+ class IsErrorActionNotFound(_BaseCondition):
209
210
  def __init__(self) -> None:
210
211
  pass
211
212
 
212
213
  def to_dict(self) -> Dict[str, Any]:
213
214
  """Convert to dict format expected by backend."""
214
- return {"type": "FalseCondition", "leaf": {}}
215
+ return {"type": "IsErrorActionNotFound", "leaf": {}}
215
216
 
216
217
 
217
- class IsError(_BaseCondition):
218
+ class IsErrorInternalError(_BaseCondition):
218
219
  def __init__(self) -> None:
219
220
  pass
220
221
 
221
222
  def to_dict(self) -> Dict[str, Any]:
222
223
  """Convert to dict format expected by backend."""
223
- return {"type": "IsError", "leaf": {}}
224
+ return {"type": "IsErrorInternalError", "leaf": {}}
224
225
 
225
226
 
226
227
  class LessThan(_BaseCondition):
@@ -246,43 +247,20 @@ class LessThan(_BaseCondition):
246
247
  return result
247
248
 
248
249
 
249
- class TextEquals(_BaseCondition):
250
- def __init__(self, text: Any = None, value: Any = None) -> None:
251
- self.text = text
252
- self.value = value
253
-
254
- def to_dict(self) -> Dict[str, Any]:
255
- """Convert to dict format expected by backend."""
256
- result: Dict[str, Any] = {}
257
- result["type"] = "TextEquals"
258
-
259
- # Add field values to leaf object (backend expects leaf format)
260
- leaf: Dict[str, Any] = {}
261
- if self.text is not None:
262
- leaf["text"] = self.text
263
- if self.value is not None:
264
- leaf["value"] = self.value
265
-
266
- if leaf:
267
- result["leaf"] = leaf
268
-
269
- return result
270
-
271
-
272
- class TextStartsWith(_BaseCondition):
273
- def __init__(self, text: Any = None, value: Any = None) -> None:
274
- self.text = text
250
+ class EarlierThan(_BaseCondition):
251
+ def __init__(self, time: Any = None, value: Any = None) -> None:
252
+ self.time = time
275
253
  self.value = value
276
254
 
277
255
  def to_dict(self) -> Dict[str, Any]:
278
256
  """Convert to dict format expected by backend."""
279
257
  result: Dict[str, Any] = {}
280
- result["type"] = "TextStartsWith"
258
+ result["type"] = "EarlierThan"
281
259
 
282
260
  # Add field values to leaf object (backend expects leaf format)
283
261
  leaf: Dict[str, Any] = {}
284
- if self.text is not None:
285
- leaf["text"] = self.text
262
+ if self.time is not None:
263
+ leaf["time"] = self.time
286
264
  if self.value is not None:
287
265
  leaf["value"] = self.value
288
266
 
@@ -292,28 +270,31 @@ class TextStartsWith(_BaseCondition):
292
270
  return result
293
271
 
294
272
 
295
- class TrueCondition(_BaseCondition):
273
+ class FalseCondition(_BaseCondition):
296
274
  def __init__(self) -> None:
297
275
  pass
298
276
 
299
277
  def to_dict(self) -> Dict[str, Any]:
300
278
  """Convert to dict format expected by backend."""
301
- return {"type": "TrueCondition", "leaf": {}}
279
+ return {"type": "FalseCondition", "leaf": {}}
302
280
 
303
281
 
304
- class NotCondition(_BaseCondition):
305
- def __init__(self, condition: Any = None) -> None:
306
- self.condition = condition
282
+ class GreaterThan(_BaseCondition):
283
+ def __init__(self, number: Any = None, value: Any = None) -> None:
284
+ self.number = number
285
+ self.value = value
307
286
 
308
287
  def to_dict(self) -> Dict[str, Any]:
309
288
  """Convert to dict format expected by backend."""
310
289
  result: Dict[str, Any] = {}
311
- result["type"] = "NotCondition"
290
+ result["type"] = "GreaterThan"
312
291
 
313
292
  # Add field values to leaf object (backend expects leaf format)
314
293
  leaf: Dict[str, Any] = {}
315
- if self.condition is not None:
316
- leaf["condition"] = self.condition
294
+ if self.number is not None:
295
+ leaf["number"] = self.number
296
+ if self.value is not None:
297
+ leaf["value"] = self.value
317
298
 
318
299
  if leaf:
319
300
  result["leaf"] = leaf
@@ -321,22 +302,13 @@ class NotCondition(_BaseCondition):
321
302
  return result
322
303
 
323
304
 
324
- class IsErrorActionNotFound(_BaseCondition):
325
- def __init__(self) -> None:
326
- pass
327
-
328
- def to_dict(self) -> Dict[str, Any]:
329
- """Convert to dict format expected by backend."""
330
- return {"type": "IsErrorActionNotFound", "leaf": {}}
331
-
332
-
333
- class IsErrorTerminated(_BaseCondition):
305
+ class IsErrorTimeout(_BaseCondition):
334
306
  def __init__(self) -> None:
335
307
  pass
336
308
 
337
309
  def to_dict(self) -> Dict[str, Any]:
338
310
  """Convert to dict format expected by backend."""
339
- return {"type": "IsErrorTerminated", "leaf": {}}
311
+ return {"type": "IsErrorTimeout", "leaf": {}}
340
312
 
341
313
 
342
314
  class TextContains(_BaseCondition):
@@ -362,19 +334,22 @@ class TextContains(_BaseCondition):
362
334
  return result
363
335
 
364
336
 
365
- class OrCondition(_BaseCondition):
366
- def __init__(self, conditions: Any = None) -> None:
367
- self.conditions = conditions
337
+ class TextEquals(_BaseCondition):
338
+ def __init__(self, text: Any = None, value: Any = None) -> None:
339
+ self.text = text
340
+ self.value = value
368
341
 
369
342
  def to_dict(self) -> Dict[str, Any]:
370
343
  """Convert to dict format expected by backend."""
371
344
  result: Dict[str, Any] = {}
372
- result["type"] = "OrCondition"
345
+ result["type"] = "TextEquals"
373
346
 
374
347
  # Add field values to leaf object (backend expects leaf format)
375
348
  leaf: Dict[str, Any] = {}
376
- if self.conditions is not None:
377
- leaf["conditions"] = self.conditions
349
+ if self.text is not None:
350
+ leaf["text"] = self.text
351
+ if self.value is not None:
352
+ leaf["value"] = self.value
378
353
 
379
354
  if leaf:
380
355
  result["leaf"] = leaf
@@ -382,20 +357,20 @@ class OrCondition(_BaseCondition):
382
357
  return result
383
358
 
384
359
 
385
- class GreaterThan(_BaseCondition):
386
- def __init__(self, number: Any = None, value: Any = None) -> None:
387
- self.number = number
360
+ class TextStartsWith(_BaseCondition):
361
+ def __init__(self, text: Any = None, value: Any = None) -> None:
362
+ self.text = text
388
363
  self.value = value
389
364
 
390
365
  def to_dict(self) -> Dict[str, Any]:
391
366
  """Convert to dict format expected by backend."""
392
367
  result: Dict[str, Any] = {}
393
- result["type"] = "GreaterThan"
368
+ result["type"] = "TextStartsWith"
394
369
 
395
370
  # Add field values to leaf object (backend expects leaf format)
396
371
  leaf: Dict[str, Any] = {}
397
- if self.number is not None:
398
- leaf["number"] = self.number
372
+ if self.text is not None:
373
+ leaf["text"] = self.text
399
374
  if self.value is not None:
400
375
  leaf["value"] = self.value
401
376
 
@@ -405,22 +380,37 @@ class GreaterThan(_BaseCondition):
405
380
  return result
406
381
 
407
382
 
408
- class IsAny(_BaseCondition):
409
- def __init__(self, key: Any = None, value: Any = None) -> None:
383
+ class TrueCondition(_BaseCondition):
384
+ def __init__(self) -> None:
385
+ pass
386
+
387
+ def to_dict(self) -> Dict[str, Any]:
388
+ """Convert to dict format expected by backend."""
389
+ return {"type": "TrueCondition", "leaf": {}}
390
+
391
+
392
+ class IsError(_BaseCondition):
393
+ def __init__(self) -> None:
394
+ pass
395
+
396
+ def to_dict(self) -> Dict[str, Any]:
397
+ """Convert to dict format expected by backend."""
398
+ return {"type": "IsError", "leaf": {}}
399
+
400
+
401
+ class IsNull(_BaseCondition):
402
+ def __init__(self, key: Any = None) -> None:
410
403
  self.key = key
411
- self.value = value
412
404
 
413
405
  def to_dict(self) -> Dict[str, Any]:
414
406
  """Convert to dict format expected by backend."""
415
407
  result: Dict[str, Any] = {}
416
- result["type"] = "IsAny"
408
+ result["type"] = "IsNull"
417
409
 
418
410
  # Add field values to leaf object (backend expects leaf format)
419
411
  leaf: Dict[str, Any] = {}
420
412
  if self.key is not None:
421
413
  leaf["key"] = self.key
422
- if self.value is not None:
423
- leaf["value"] = self.value
424
414
 
425
415
  if leaf:
426
416
  result["leaf"] = leaf
@@ -428,49 +418,68 @@ class IsAny(_BaseCondition):
428
418
  return result
429
419
 
430
420
 
431
- class IsErrorInfoNeeded(_BaseCondition):
421
+ class IsSuccess(_BaseCondition):
432
422
  def __init__(self) -> None:
433
423
  pass
434
424
 
435
425
  def to_dict(self) -> Dict[str, Any]:
436
426
  """Convert to dict format expected by backend."""
437
- return {"type": "IsErrorInfoNeeded", "leaf": {}}
427
+ return {"type": "IsSuccess", "leaf": {}}
438
428
 
439
429
 
440
- class IsErrorInternalError(_BaseCondition):
441
- def __init__(self) -> None:
442
- pass
430
+ class AndCondition(_BaseCondition):
431
+ def __init__(self, conditions: Any = None) -> None:
432
+ self.conditions = conditions
443
433
 
444
434
  def to_dict(self) -> Dict[str, Any]:
445
435
  """Convert to dict format expected by backend."""
446
- return {"type": "IsErrorInternalError", "leaf": {}}
436
+ result: Dict[str, Any] = {}
437
+ result["type"] = "AndCondition"
438
+
439
+ # Add field values to leaf object (backend expects leaf format)
440
+ leaf: Dict[str, Any] = {}
441
+ if self.conditions is not None:
442
+ leaf["conditions"] = self.conditions
447
443
 
444
+ if leaf:
445
+ result["leaf"] = leaf
446
+
447
+ return result
448
448
 
449
- class IsFormattedError(_BaseCondition):
450
- def __init__(self) -> None:
451
- pass
449
+
450
+ class OrCondition(_BaseCondition):
451
+ def __init__(self, conditions: Any = None) -> None:
452
+ self.conditions = conditions
452
453
 
453
454
  def to_dict(self) -> Dict[str, Any]:
454
455
  """Convert to dict format expected by backend."""
455
- return {"type": "IsFormattedError", "leaf": {}}
456
+ result: Dict[str, Any] = {}
457
+ result["type"] = "OrCondition"
456
458
 
459
+ # Add field values to leaf object (backend expects leaf format)
460
+ leaf: Dict[str, Any] = {}
461
+ if self.conditions is not None:
462
+ leaf["conditions"] = self.conditions
457
463
 
458
- class TextEndsWith(_BaseCondition):
459
- def __init__(self, text: Any = None, value: Any = None) -> None:
460
- self.text = text
461
- self.value = value
464
+ if leaf:
465
+ result["leaf"] = leaf
466
+
467
+ return result
468
+
469
+
470
+ class NotCondition(_BaseCondition):
471
+ def __init__(self, condition: Any = None) -> None:
472
+ self.condition = condition
462
473
 
463
474
  def to_dict(self) -> Dict[str, Any]:
464
475
  """Convert to dict format expected by backend."""
465
476
  result: Dict[str, Any] = {}
466
- result["type"] = "TextEndsWith"
477
+ result["type"] = "NotCondition"
467
478
 
468
479
  # Add field values to leaf object (backend expects leaf format)
469
480
  leaf: Dict[str, Any] = {}
470
- if self.text is not None:
471
- leaf["text"] = self.text
472
- if self.value is not None:
473
- leaf["value"] = self.value
481
+ if self.condition is not None:
482
+ leaf["condition"] = self.condition
474
483
 
475
484
  if leaf:
476
485
  result["leaf"] = leaf
@@ -483,22 +492,23 @@ __all__ = [
483
492
  "And",
484
493
  "Or",
485
494
  "Not",
486
- "LessThan",
495
+ "EarlierThan",
496
+ "FalseCondition",
497
+ "GreaterThan",
498
+ "IsErrorTimeout",
499
+ "TextContains",
487
500
  "TextEquals",
488
501
  "TextStartsWith",
489
502
  "TrueCondition",
490
- "IsErrorActionNotFound",
491
- "IsErrorTerminated",
492
- "TextContains",
493
- "GreaterThan",
494
- "IsAny",
503
+ "IsError",
504
+ "IsNull",
505
+ "IsSuccess",
495
506
  "IsErrorInfoNeeded",
496
- "IsErrorInternalError",
507
+ "IsErrorTerminated",
497
508
  "IsFormattedError",
498
509
  "TextEndsWith",
499
- "IsNull",
500
- "IsSuccess",
501
- "EarlierThan",
502
- "FalseCondition",
503
- "IsError",
510
+ "IsAny",
511
+ "IsErrorActionNotFound",
512
+ "IsErrorInternalError",
513
+ "LessThan",
504
514
  ]
@@ -14,7 +14,19 @@ from pydantic import BaseModel
14
14
  from erdo.template import TemplateString
15
15
 
16
16
 
17
- class CheckpointAttemptParams(BaseModel):
17
+ class BaseActionParams(BaseModel):
18
+ """Base class for all action parameter classes.
19
+
20
+ Provides common fields that all actions support:
21
+ - name: The action type identifier
22
+ - step_metadata: Optional configuration for the step created from this action
23
+ """
24
+
25
+ name: str
26
+ step_metadata: Optional[Any] = None
27
+
28
+
29
+ class CheckpointAttemptParams(BaseActionParams):
18
30
  """checkpoint_attempt parameters"""
19
31
 
20
32
  name: str = "checkpoint_attempt" # Action type for roundtrip compatibility
@@ -22,7 +34,7 @@ class CheckpointAttemptParams(BaseModel):
22
34
  loops: Optional[Union[Any, TemplateString]] = None # Loop data
23
35
 
24
36
 
25
- class RefreshResourceParams(BaseModel):
37
+ class RefreshResourceParams(BaseActionParams):
26
38
  """refresh_resource parameters"""
27
39
 
28
40
  name: str = "refresh_resource" # Action type for roundtrip compatibility