fractal-server 2.3.5__py3-none-any.whl → 2.3.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.
@@ -1 +1 @@
1
- __VERSION__ = "2.3.5"
1
+ __VERSION__ = "2.3.6"
@@ -1,5 +1,3 @@
1
- import json
2
- import logging
3
1
  from typing import Any
4
2
  from typing import Optional
5
3
 
@@ -41,53 +39,3 @@ class TaskV2(SQLModel, table=True):
41
39
 
42
40
  input_types: dict[str, bool] = Field(sa_column=Column(JSON), default={})
43
41
  output_types: dict[str, bool] = Field(sa_column=Column(JSON), default={})
44
-
45
- @property
46
- def default_args_non_parallel_from_args_schema(self) -> dict[str, Any]:
47
- """
48
- Extract default arguments from args_schema
49
- """
50
- # Return {} if there is no args_schema
51
- if self.args_schema_non_parallel is None:
52
- return {}
53
- # Try to construct default_args
54
- try:
55
- default_args = {}
56
- properties = self.args_schema_non_parallel["properties"]
57
- for prop_name, prop_schema in properties.items():
58
- default_value = prop_schema.get("default", None)
59
- if default_value is not None:
60
- default_args[prop_name] = default_value
61
- return default_args
62
- except KeyError as e:
63
- logging.warning(
64
- "Cannot set default_args from args_schema_non_parallel="
65
- f"{json.dumps(self.args_schema_non_parallel)}\n"
66
- f"Original KeyError: {str(e)}"
67
- )
68
- return {}
69
-
70
- @property
71
- def default_args_parallel_from_args_schema(self) -> dict[str, Any]:
72
- """
73
- Extract default arguments from args_schema
74
- """
75
- # Return {} if there is no args_schema
76
- if self.args_schema_parallel is None:
77
- return {}
78
- # Try to construct default_args
79
- try:
80
- default_args = {}
81
- properties = self.args_schema_parallel["properties"]
82
- for prop_name, prop_schema in properties.items():
83
- default_value = prop_schema.get("default", None)
84
- if default_value is not None:
85
- default_args[prop_name] = default_value
86
- return default_args
87
- except KeyError as e:
88
- logging.warning(
89
- "Cannot set default_args from args_schema_parallel="
90
- f"{json.dumps(self.args_schema_parallel)}\n"
91
- f"Original KeyError: {str(e)}"
92
- )
93
- return {}
@@ -422,6 +422,8 @@ async def _workflow_insert_task(
422
422
 
423
423
  # Get task from db, and extract default arguments via a Task property
424
424
  # method
425
+ # NOTE: this logic remains there for V1 tasks only. When we deprecate V1
426
+ # tasks, we can simplify this block
425
427
  if is_legacy_task is True:
426
428
  db_task = await db.get(Task, task_id)
427
429
  if db_task is None:
@@ -439,12 +441,8 @@ async def _workflow_insert_task(
439
441
  raise ValueError(f"TaskV2 {task_id} not found.")
440
442
  task_type = db_task.type
441
443
 
442
- final_args_non_parallel = (
443
- db_task.default_args_non_parallel_from_args_schema.copy()
444
- )
445
- final_args_parallel = (
446
- db_task.default_args_parallel_from_args_schema.copy()
447
- )
444
+ final_args_non_parallel = {}
445
+ final_args_parallel = {}
448
446
  final_meta_parallel = (db_task.meta_parallel or {}).copy()
449
447
  final_meta_non_parallel = (db_task.meta_non_parallel or {}).copy()
450
448
 
@@ -186,34 +186,17 @@ async def update_workflowtask(
186
186
  default_args = (
187
187
  db_wf_task.task_legacy.default_args_from_args_schema
188
188
  )
189
+ actual_args = deepcopy(default_args)
190
+ if value is not None:
191
+ for k, v in value.items():
192
+ actual_args[k] = v
189
193
  else:
190
- default_args = (
191
- db_wf_task.task.default_args_parallel_from_args_schema
192
- )
193
- # Override default_args with args value items
194
- actual_args = deepcopy(default_args)
195
- if value is not None:
196
- for k, v in value.items():
197
- actual_args[k] = v
194
+ actual_args = deepcopy(value)
198
195
  if not actual_args:
199
196
  actual_args = None
200
197
  setattr(db_wf_task, key, actual_args)
201
198
  elif key == "args_non_parallel":
202
- # Get default arguments via a Task property method
203
- if db_wf_task.is_legacy_task:
204
- # This is only needed so that we don't have to modify the rest
205
- # of this block, but legacy task cannot take any non-parallel
206
- # args (see checks above).
207
- default_args = {}
208
- else:
209
- default_args = deepcopy(
210
- db_wf_task.task.default_args_non_parallel_from_args_schema
211
- )
212
- # Override default_args with args value items
213
- actual_args = default_args.copy()
214
- if value is not None:
215
- for k, v in value.items():
216
- actual_args[k] = v
199
+ actual_args = deepcopy(value)
217
200
  if not actual_args:
218
201
  actual_args = None
219
202
  setattr(db_wf_task, key, actual_args)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fractal-server
3
- Version: 2.3.5
3
+ Version: 2.3.6
4
4
  Summary: Server component of the Fractal analytics platform
5
5
  Home-page: https://github.com/fractal-analytics-platform/fractal-server
6
6
  License: BSD-3-Clause
@@ -33,7 +33,7 @@ Requires-Dist: psycopg[binary] (>=3.1.0,<4.0.0) ; extra == "postgres-psycopg-bin
33
33
  Requires-Dist: pydantic (>=1.10.8,<2)
34
34
  Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
35
35
  Requires-Dist: sqlalchemy[asyncio] (>=2.0.23,<2.1)
36
- Requires-Dist: sqlmodel (>=0.0.19,<0.0.20)
36
+ Requires-Dist: sqlmodel (>=0.0.21,<0.0.22)
37
37
  Requires-Dist: uvicorn (>=0.29.0,<0.30.0)
38
38
  Project-URL: Changelog, https://github.com/fractal-analytics-platform/fractal-server/blob/main/CHANGELOG.md
39
39
  Project-URL: Documentation, https://fractal-analytics-platform.github.io/fractal-server
@@ -1,4 +1,4 @@
1
- fractal_server/__init__.py,sha256=RqyrrNV86fgXA3ZGY013Ddl0XCyYA-YaiOneKISOYXc,22
1
+ fractal_server/__init__.py,sha256=lCtPuZps1Hbf7xTBL9gN0BnZZFuDzV5N5mezQVbB9lA,22
2
2
  fractal_server/__main__.py,sha256=CocbzZooX1UtGqPi55GcHGNxnrJXFg5tUU5b3wyFCyo,4958
3
3
  fractal_server/alembic.ini,sha256=MWwi7GzjzawI9cCAK1LW7NxIBQDUqD12-ptJoq5JpP0,3153
4
4
  fractal_server/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -18,7 +18,7 @@ fractal_server/app/models/v2/collection_state.py,sha256=nxb042i8tt8rCpmgbFJoBCYW
18
18
  fractal_server/app/models/v2/dataset.py,sha256=-7sxHEw4IIAvF_uSan7tA3o8hvoakBkQ0SRvqS2iOQU,1455
19
19
  fractal_server/app/models/v2/job.py,sha256=ypJmN-qspkKBGhBG7Mt-HypSQqcQ2EmB4Bzzb2-y550,1535
20
20
  fractal_server/app/models/v2/project.py,sha256=CRBnZ8QITNp6u1f5bMxvi1_mcvEfXpWyitsWB5f7gn8,759
21
- fractal_server/app/models/v2/task.py,sha256=9ZPhug3VWyeqgT8wQ9_8ZXQ2crSiiicRipxrxTslOso,3257
21
+ fractal_server/app/models/v2/task.py,sha256=Esf2j9c-0pGYjdbb__Ptpdx7NCAKVxqbQMoza524miU,1286
22
22
  fractal_server/app/models/v2/workflow.py,sha256=YBgFGCziUgU0aJ5EM3Svu9W2c46AewZO9VBlFCHiSps,1069
23
23
  fractal_server/app/models/v2/workflowtask.py,sha256=3jEkObsSnlI05Pur_dSsXYdJxRqPL60Z7tK5-EJLOks,1532
24
24
  fractal_server/app/routes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -36,7 +36,7 @@ fractal_server/app/routes/api/v1/task_collection.py,sha256=82XBsJHlPiDPCbpLa-16o
36
36
  fractal_server/app/routes/api/v1/workflow.py,sha256=7r9IoIevg_rvYCrerMOsIsUabSOQatxdPCfLdkP0dRs,10942
37
37
  fractal_server/app/routes/api/v1/workflowtask.py,sha256=qcHQlzlSFf_k8gtId-mA3tnyzgSR7i1m7pvR4R86blE,5582
38
38
  fractal_server/app/routes/api/v2/__init__.py,sha256=JrPWfKIJy9btRCP-zw2nZwLpSdBxEKY5emuCuJbqG0s,1813
39
- fractal_server/app/routes/api/v2/_aux_functions.py,sha256=tYJr5EPaA0CVGp-Y4jottFJUVToWvjcSY6PJqN_d--s,14938
39
+ fractal_server/app/routes/api/v2/_aux_functions.py,sha256=yeA0650pBk43M5ZQGpVQ17nH5D97NIGY-3tNNLQIW1M,14901
40
40
  fractal_server/app/routes/api/v2/dataset.py,sha256=_HjKNP9XsMGoqyubGdF2ZyeW7vXC3VdK_0_TaUxgIF0,8248
41
41
  fractal_server/app/routes/api/v2/images.py,sha256=4r_HblPWyuKSZSJZfn8mbDaLv1ncwZU0gWdKneZcNG4,7894
42
42
  fractal_server/app/routes/api/v2/job.py,sha256=RkIj7ANK-nkxUvcG9K2r4dFdPnvGomx7jdB6U9bqOVQ,5202
@@ -48,7 +48,7 @@ fractal_server/app/routes/api/v2/task_collection.py,sha256=BiZ5s6DwdQbM79s_dPivg
48
48
  fractal_server/app/routes/api/v2/task_collection_custom.py,sha256=cvZorN_Xt57Rj-2JATRrdtSw6I_5befB0ua3FWh6hW4,5988
49
49
  fractal_server/app/routes/api/v2/task_legacy.py,sha256=P_VJv9v0yzFUBuS-DQHhMVSOe20ecGJJcFBqiiFciOM,1628
50
50
  fractal_server/app/routes/api/v2/workflow.py,sha256=2GlcYNjpvCdjwC_Kn7y0UP16B3pOLSNXBvIVsVDtDKM,11863
51
- fractal_server/app/routes/api/v2/workflowtask.py,sha256=l4eTD5IIun5cOdYzsxh3ajmnOISaSccYA_mVf15Cjtw,8802
51
+ fractal_server/app/routes/api/v2/workflowtask.py,sha256=l_eQPniK1zR0u249bJj4c2hFlyDwsSJgsFR6hxJaOjs,8007
52
52
  fractal_server/app/routes/auth.py,sha256=Xv80iqdyfY3lyicYs2Y8B6zEDEnyUu_H6_6psYtv3R4,4885
53
53
  fractal_server/app/routes/aux/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  fractal_server/app/routes/aux/_job.py,sha256=HUItNm0SZFAYsyL1rXSjBre1-rXSe6x51qH9KAQWS1w,1361
@@ -193,8 +193,8 @@ fractal_server/tasks/v2/templates/_5_pip_show.sh,sha256=GrJ19uHYQxANEy9JaeNJZVTq
193
193
  fractal_server/tasks/v2/utils.py,sha256=JOyCacb6MNvrwfLNTyLwcz8y79J29YuJeJ2MK5kqXRM,1657
194
194
  fractal_server/urls.py,sha256=5o_qq7PzKKbwq12NHSQZDmDitn5RAOeQ4xufu-2v9Zk,448
195
195
  fractal_server/utils.py,sha256=b7WwFdcFZ8unyT65mloFToYuEDXpQoHRcmRNqrhd_dQ,2115
196
- fractal_server-2.3.5.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
197
- fractal_server-2.3.5.dist-info/METADATA,sha256=dElt7KKeyH2IIRToMdsTiVKeIEww0ZsbFzlQcCskrKE,4425
198
- fractal_server-2.3.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
199
- fractal_server-2.3.5.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
200
- fractal_server-2.3.5.dist-info/RECORD,,
196
+ fractal_server-2.3.6.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
197
+ fractal_server-2.3.6.dist-info/METADATA,sha256=WrV14I1NR6DeXCeuHJTZqsnJfCf4EqdY-IZSeeGPAPM,4425
198
+ fractal_server-2.3.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
199
+ fractal_server-2.3.6.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
200
+ fractal_server-2.3.6.dist-info/RECORD,,