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.

@@ -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
- seconds = td.seconds
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
- if seconds % DAY == 0:
17
- return f"{seconds // DAY}d"
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"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hatchet-sdk
3
- Version: 1.6.1
3
+ Version: 1.6.2
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Alexander Belanger
@@ -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=n5jIxlcswN9GwFPjktuMceedekzWWT6X7U6gbsZciIQ,455
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.1.dist-info/METADATA,sha256=dCS8JsUXaBxKoJ1w0Q2GwA3lnuJ8CdLYjPuJUQk3DmM,3635
510
- hatchet_sdk-1.6.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
511
- hatchet_sdk-1.6.1.dist-info/entry_points.txt,sha256=uYc-ivF7fUATjrWnwHP32ojgMCmogIs6yFOU8lEA4mk,1276
512
- hatchet_sdk-1.6.1.dist-info/RECORD,,
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,,