hatchet-sdk 1.6.1__py3-none-any.whl → 1.6.2__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 hatchet-sdk might be problematic. Click here for more details.
- hatchet_sdk/utils/timedelta_to_expression.py +6 -5
- {hatchet_sdk-1.6.1.dist-info → hatchet_sdk-1.6.2.dist-info}/METADATA +1 -1
- {hatchet_sdk-1.6.1.dist-info → hatchet_sdk-1.6.2.dist-info}/RECORD +5 -5
- {hatchet_sdk-1.6.1.dist-info → hatchet_sdk-1.6.2.dist-info}/WHEEL +0 -0
- {hatchet_sdk-1.6.1.dist-info → hatchet_sdk-1.6.2.dist-info}/entry_points.txt +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from datetime import timedelta
|
|
2
2
|
|
|
3
|
-
DAY = 86400
|
|
4
3
|
HOUR = 3600
|
|
5
4
|
MINUTE = 60
|
|
6
5
|
|
|
@@ -11,11 +10,13 @@ def timedelta_to_expr(td: Duration) -> str:
|
|
|
11
10
|
if isinstance(td, str):
|
|
12
11
|
return td
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
## `total_seconds` gives the entire duration,
|
|
14
|
+
## while `seconds` gives the seconds component of the timedelta
|
|
15
|
+
## e.g. 1 day and 1 second would give 86401 total seconds but 1 second
|
|
16
|
+
seconds = int(td.total_seconds())
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
elif seconds % HOUR == 0:
|
|
18
|
+
## IMPORTANT: We only support hours, minutes, and seconds on the engine
|
|
19
|
+
if seconds % HOUR == 0:
|
|
19
20
|
return f"{seconds // HOUR}h"
|
|
20
21
|
elif seconds % MINUTE == 0:
|
|
21
22
|
return f"{seconds // MINUTE}m"
|
|
@@ -265,7 +265,7 @@ hatchet_sdk/runnables/workflow.py,sha256=PvQeDglpyGhJdgOTqjRmIOHKmEhtmRcF3DWZqbr
|
|
|
265
265
|
hatchet_sdk/token.py,sha256=KjIiInwG5Kqd_FO4BSW1x_5Uc7PFbnzIVJqr50-ZldE,779
|
|
266
266
|
hatchet_sdk/utils/backoff.py,sha256=6B5Rb5nLKw_TqqgpJMYjIBV1PTTtbOMRZCveisVhg_I,353
|
|
267
267
|
hatchet_sdk/utils/proto_enums.py,sha256=0UybwE3s7TcqmzoQSO8YnhgAKOS8WZXsyPchB8-eksw,1247
|
|
268
|
-
hatchet_sdk/utils/timedelta_to_expression.py,sha256=
|
|
268
|
+
hatchet_sdk/utils/timedelta_to_expression.py,sha256=kwuYZ51JdDdc3h9Sw4vgBFmJBMPkgbGJA4v9uO4_NGk,660
|
|
269
269
|
hatchet_sdk/utils/typing.py,sha256=huflXWR7fvRfIFYdqQIrQmn9jtukzOWoTpW3AXGk5c0,427
|
|
270
270
|
hatchet_sdk/v0/__init__.py,sha256=YNh-0rPHS0rcphmykJ1N2NMfgvERF4oJpBtx3IH_E_M,9657
|
|
271
271
|
hatchet_sdk/v0/client.py,sha256=G1RDZln9Og7tRQulogXkZw8TsVlx7f0VvmtFI_VAe6E,3495
|
|
@@ -506,7 +506,7 @@ hatchet_sdk/worker/runner/runner.py,sha256=J-gTpoYF9WphB1zZhpPJryCv10VjU-MiCdJgM
|
|
|
506
506
|
hatchet_sdk/worker/runner/utils/capture_logs.py,sha256=nHRPSiDBqzhObM7i2X7t03OupVFnE7kQBdR2Ckgg-2w,2709
|
|
507
507
|
hatchet_sdk/worker/worker.py,sha256=m11u3QPyAqXJpF6Y3lTUEVqTKdIigGKTXTymNPqq6hw,16149
|
|
508
508
|
hatchet_sdk/workflow_run.py,sha256=ZwH0HLFGFVXz6jbiqSv4w0Om2XuR52Tzzw6LH4y65jQ,2765
|
|
509
|
-
hatchet_sdk-1.6.
|
|
510
|
-
hatchet_sdk-1.6.
|
|
511
|
-
hatchet_sdk-1.6.
|
|
512
|
-
hatchet_sdk-1.6.
|
|
509
|
+
hatchet_sdk-1.6.2.dist-info/METADATA,sha256=72ohc-_J3ViNh-QrgzKEQsdbT8ZaoPVshORzZkZ5Jok,3635
|
|
510
|
+
hatchet_sdk-1.6.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
511
|
+
hatchet_sdk-1.6.2.dist-info/entry_points.txt,sha256=uYc-ivF7fUATjrWnwHP32ojgMCmogIs6yFOU8lEA4mk,1276
|
|
512
|
+
hatchet_sdk-1.6.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|