tinyfan 0.2.6__tar.gz → 0.2.8__tar.gz
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.
- {tinyfan-0.2.6 → tinyfan-0.2.8}/PKG-INFO +1 -1
- {tinyfan-0.2.6 → tinyfan-0.2.8}/examples/getting-started.py +9 -2
- {tinyfan-0.2.6 → tinyfan-0.2.8}/pyproject.toml +1 -1
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/codegen.py +53 -30
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/flow.py +1 -1
- {tinyfan-0.2.6 → tinyfan-0.2.8}/uv.lock +1 -1
- {tinyfan-0.2.6 → tinyfan-0.2.8}/.github/workflows/publish.yml +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/.gitignore +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/.python-version +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/README.md +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/examples/README.md +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/examples/configmap.yaml +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/examples/configs.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/examples/packaged/.python-version +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/examples/packaged/Dockerfile +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/examples/packaged/README.md +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/examples/packaged/pyproject.toml +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/examples/packaged/src/tinyfan_examples_packaged/__init__.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/examples/packaged/src/tinyfan_examples_packaged/asset.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/examples/resource.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/examples/secret.yaml +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/__init__.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/argo_typing.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/cli.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/config.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/dagviz.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/flowrundata.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/py.typed +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/resources/__init__.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/resources/base.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/stores/__init__.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/stores/base.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/stores/bigquery.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/stores/gcs_pickle.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/stores/naive.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/utils/__init__.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/utils/embed.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/utils/exjson.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/utils/merge.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/utils/typing.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/src/tinyfan/utils/yaml.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/__init__.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/codegen_samples/directory/__init__.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/codegen_samples/directory/asset.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/codegen_samples/directory/asset2.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/codegen_samples/singlefile.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/conftest.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/helpers.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/openapi2jsonschema.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/test_codegen.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/test_config.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/test_decorators.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/utils/__init__.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/utils/embed_samples/directory/__init__.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/utils/embed_samples/directory/dep.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/utils/embed_samples/singlefile.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/utils/test_embed.py +0 -0
- {tinyfan-0.2.6 → tinyfan-0.2.8}/tests/utils/test_exjson.py +0 -0
|
@@ -9,9 +9,16 @@ def target() -> str:
|
|
|
9
9
|
return "world"
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
@tinyfan.asset(
|
|
13
|
+
schedule="*/1 * * * *",
|
|
14
|
+
)
|
|
15
|
+
def target2() -> str:
|
|
16
|
+
return "earth"
|
|
17
|
+
|
|
18
|
+
|
|
12
19
|
@tinyfan.asset()
|
|
13
|
-
def greeting(target: str):
|
|
14
|
-
print("hello " + target)
|
|
20
|
+
def greeting(target: str, target2: str):
|
|
21
|
+
print("hello " + target, "hello " + target2)
|
|
15
22
|
|
|
16
23
|
|
|
17
24
|
@tinyfan.asset(
|
|
@@ -229,12 +229,11 @@ class AssetTree:
|
|
|
229
229
|
root_location = get_root_path(list(self.nodes.values())[0].asset.func)
|
|
230
230
|
source += embed(root_location)
|
|
231
231
|
if not root_location.endswith(".py"):
|
|
232
|
-
source += "
|
|
232
|
+
source += """{{=join(map(fromJSON(inputs.parameters.moduledata), {"from " + .module + " import " + .name}), ";")}}\n"""
|
|
233
233
|
source += "asset = {{inputs.parameters.asset_name}}.asset\n"
|
|
234
234
|
else:
|
|
235
235
|
source = (
|
|
236
|
-
"
|
|
237
|
-
" import {{inputs.parameters.asset_name}}\n"
|
|
236
|
+
"""{{=join(map(fromJSON(inputs.parameters.moduledata), {"from " + .module + " import " + .name}), ";")}}\n"""
|
|
238
237
|
"asset = {{inputs.parameters.asset_name}}.asset\n"
|
|
239
238
|
)
|
|
240
239
|
source += (
|
|
@@ -263,23 +262,28 @@ class AssetTree:
|
|
|
263
262
|
"workflowSpec": {
|
|
264
263
|
"entrypoint": "flow",
|
|
265
264
|
**dropnone({"serviceAccountName": serviceAccountName or self.flow.serviceAccountName}),
|
|
266
|
-
|
|
265
|
+
**dropnone(
|
|
267
266
|
{
|
|
268
|
-
"
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
267
|
+
"podSpecPatch": (container or self.flow.container)
|
|
268
|
+
and yaml_dump(
|
|
269
|
+
{
|
|
270
|
+
"containers": [
|
|
271
|
+
deepmerge(
|
|
273
272
|
{
|
|
274
|
-
"name": "
|
|
275
|
-
"
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
273
|
+
"name": "main",
|
|
274
|
+
"env": [
|
|
275
|
+
{
|
|
276
|
+
"name": "TINYFAN_SOURCE",
|
|
277
|
+
"value": source,
|
|
278
|
+
}
|
|
279
|
+
],
|
|
280
|
+
},
|
|
281
|
+
container or {},
|
|
282
|
+
self.flow.container or {},
|
|
283
|
+
)
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
)
|
|
283
287
|
}
|
|
284
288
|
),
|
|
285
289
|
"templates": [
|
|
@@ -340,16 +344,21 @@ class AssetTree:
|
|
|
340
344
|
self.flow.container or {},
|
|
341
345
|
node.asset.container or {},
|
|
342
346
|
),
|
|
343
|
-
|
|
347
|
+
**dropnone(
|
|
344
348
|
{
|
|
345
|
-
"
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
349
|
+
"podSpecPatch": node.asset.container
|
|
350
|
+
and yaml_dump(
|
|
351
|
+
{
|
|
352
|
+
"containers": [
|
|
353
|
+
deepmerge(
|
|
354
|
+
{
|
|
355
|
+
"name": "main",
|
|
356
|
+
},
|
|
357
|
+
node.asset.container,
|
|
358
|
+
)
|
|
359
|
+
]
|
|
360
|
+
}
|
|
361
|
+
),
|
|
353
362
|
}
|
|
354
363
|
),
|
|
355
364
|
"synchronization": {
|
|
@@ -366,7 +375,7 @@ class AssetTree:
|
|
|
366
375
|
"value": "{{= nil }}",
|
|
367
376
|
},
|
|
368
377
|
{
|
|
369
|
-
"name": "
|
|
378
|
+
"name": "moduledata",
|
|
370
379
|
"value": "{{= nil }}",
|
|
371
380
|
},
|
|
372
381
|
]
|
|
@@ -406,8 +415,22 @@ class AssetTree:
|
|
|
406
415
|
"value": node.asset.name,
|
|
407
416
|
},
|
|
408
417
|
{
|
|
409
|
-
"name": "
|
|
410
|
-
"value":
|
|
418
|
+
"name": "moduledata",
|
|
419
|
+
"value": json.dumps(
|
|
420
|
+
[
|
|
421
|
+
{
|
|
422
|
+
"module": node.asset_module_name(),
|
|
423
|
+
"name": node.asset.name,
|
|
424
|
+
},
|
|
425
|
+
*(
|
|
426
|
+
{
|
|
427
|
+
"module": p.asset_module_name(),
|
|
428
|
+
"name": p.asset.name,
|
|
429
|
+
}
|
|
430
|
+
for p in node.parents
|
|
431
|
+
),
|
|
432
|
+
]
|
|
433
|
+
),
|
|
411
434
|
},
|
|
412
435
|
]
|
|
413
436
|
},
|
|
@@ -81,7 +81,7 @@ class Asset(Generic[Ret, UMeta, StoreIdx]):
|
|
|
81
81
|
for name, prundata in parent_flowrundatas.items():
|
|
82
82
|
parent = self.flow.assets[name]
|
|
83
83
|
index = prundata.get("store_entry_idx", None)
|
|
84
|
-
data = parent.store.retrieve(index, source_rundata=prundata, target_rundata=rundata)
|
|
84
|
+
data = index and parent.store.retrieve(index, source_rundata=prundata, target_rundata=rundata)
|
|
85
85
|
if name in func_param_names:
|
|
86
86
|
params[name] = data
|
|
87
87
|
ret = self.func(**params)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|