horsies 0.1.0a1__py3-none-any.whl → 0.1.0a2__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.
@@ -12,6 +12,7 @@ from typing import (
12
12
  TypeGuard,
13
13
  cast,
14
14
  )
15
+ import datetime as dt
15
16
  import json
16
17
  import traceback as tb
17
18
  from pydantic import BaseModel
@@ -187,6 +188,16 @@ def to_jsonable(value: Any) -> Json:
187
188
  if _is_json_native(value):
188
189
  return value
189
190
 
191
+ # datetime.datetime is a subclass of datetime.date — check datetime first.
192
+ if isinstance(value, dt.datetime):
193
+ return {'__datetime__': True, 'value': value.isoformat()}
194
+
195
+ if isinstance(value, dt.date):
196
+ return {'__date__': True, 'value': value.isoformat()}
197
+
198
+ if isinstance(value, dt.time):
199
+ return {'__time__': True, 'value': value.isoformat()}
200
+
190
201
  # Is value a `TaskResult`?
191
202
  if _is_task_result(value):
192
203
  # Represent discriminated union explicitly
@@ -447,6 +458,16 @@ def rehydrate_value(value: Json) -> Any:
447
458
  f'Failed to rehydrate dataclass {cache_key}: {str(e)}'
448
459
  )
449
460
 
461
+ # Handle datetime rehydration (datetime before date — subclass ordering)
462
+ if isinstance(value, dict) and value.get('__datetime__'):
463
+ return dt.datetime.fromisoformat(cast(str, value['value']))
464
+
465
+ if isinstance(value, dict) and value.get('__date__'):
466
+ return dt.date.fromisoformat(cast(str, value['value']))
467
+
468
+ if isinstance(value, dict) and value.get('__time__'):
469
+ return dt.time.fromisoformat(cast(str, value['value']))
470
+
450
471
  # Handle nested TaskResult rehydration
451
472
  if isinstance(value, dict) and value.get('__task_result__'):
452
473
  return task_result_from_json(value)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: horsies
3
- Version: 0.1.0a1
3
+ Version: 0.1.0a2
4
4
  Summary: A Python library for distributed task execution
5
5
  Author: Suleyman Ozkeskin
6
6
  License-Expression: MIT
@@ -28,4 +28,8 @@ Requires-Dist: sqlalchemy>=2.0.46
28
28
 
29
29
  A PostgreSQL-backed distributed task queue and workflow engine for Python.
30
30
 
31
- Documentation: [horsies docs](https://github.com/suleymanozkeskin/horsies/tree/main/website)
31
+ Documentation: [horsies docs](https://suleymanozkeskin.github.io/horsies/)
32
+
33
+ ## Syce
34
+
35
+ Monitoring TUI for horsies. Documentation: [syce overview](https://suleymanozkeskin.github.io/horsies/monitoring/syce-overview/)
@@ -10,7 +10,7 @@ horsies/core/task_decorator.py,sha256=kn1xD76dqF4mjXAut5GWUHwHZ4JIBsavNvW1-8Fr-O
10
10
  horsies/core/brokers/__init__.py,sha256=a_5xkHhRKY-1PRq6UidMBGq1bX-zeuSdxIvI6GdSiSQ,94
11
11
  horsies/core/brokers/listener.py,sha256=pxnnAgLAWqODPV_J0XwUqAhBSrHstL77PSHYEfGoVhc,18637
12
12
  horsies/core/brokers/postgres.py,sha256=n_WjM7-Fbg9R5Vao9RJgDSy7eBIL1_pVvnKrjMayzd4,35134
13
- horsies/core/codec/serde.py,sha256=kTU8d0TGqcv70fgMwJc1uGedqKMiLOFamXAYlZMYQaw,19182
13
+ horsies/core/codec/serde.py,sha256=-dUEwyE4-DcAnP2CTbJYxBW3rOzXIUMsX_OSZSjNnpU,20043
14
14
  horsies/core/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  horsies/core/models/app.py,sha256=I3HKztjNzii75bDwlbB7Jl9CPrFMfjLInUJRacQ39_s,11863
16
16
  horsies/core/models/broker.py,sha256=yNf-tKSvJP1oIDis-jZwFMsT5exDCe27oAcnLRFSrRA,3041
@@ -35,8 +35,8 @@ horsies/core/workflows/__init__.py,sha256=JA-8wcYUHp-wF5OCEqJwKElT8PaZZB1G7iglDZ
35
35
  horsies/core/workflows/engine.py,sha256=8Gjmch52g1IObKqzGVMWxZaZDC0diB6TuAtRfqr67l0,86927
36
36
  horsies/core/workflows/recovery.py,sha256=xRKQPiYaLcX4vLuvcNGy5cV14eW4Cp_sewD1nXv8gc8,19445
37
37
  horsies/core/workflows/registry.py,sha256=ItpjTN8yK9NNSV8Q8OwDnHdQSO-hxDzxeWAyGvExpRk,3194
38
- horsies-0.1.0a1.dist-info/METADATA,sha256=lhzFDdWeU-Ss1nMFmU9nnY6Lh1ffXYqBDBcHsd6JwVM,1200
39
- horsies-0.1.0a1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
40
- horsies-0.1.0a1.dist-info/entry_points.txt,sha256=6b_OhuNbJ1ky9WSOt3UfNQXETG2YuH0lKimcibILrEE,50
41
- horsies-0.1.0a1.dist-info/top_level.txt,sha256=ZQ_NurgT-yr3pE4a1svlO_VAhGJ6NFA31vJDLT1yyOA,8
42
- horsies-0.1.0a1.dist-info/RECORD,,
38
+ horsies-0.1.0a2.dist-info/METADATA,sha256=XJ8Gw2iRCTlKSRkhU3mri_3Q4yuTxRA77lTMmqBJpYs,1321
39
+ horsies-0.1.0a2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
40
+ horsies-0.1.0a2.dist-info/entry_points.txt,sha256=6b_OhuNbJ1ky9WSOt3UfNQXETG2YuH0lKimcibILrEE,50
41
+ horsies-0.1.0a2.dist-info/top_level.txt,sha256=ZQ_NurgT-yr3pE4a1svlO_VAhGJ6NFA31vJDLT1yyOA,8
42
+ horsies-0.1.0a2.dist-info/RECORD,,