FlowerPower 0.11.6.7__py3-none-any.whl → 0.11.6.9__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.
- flowerpower/fs/ext.py +4 -4
- flowerpower/plugins/io/base.py +1 -1
- flowerpower/utils/misc.py +50 -23
- {flowerpower-0.11.6.7.dist-info → flowerpower-0.11.6.9.dist-info}/METADATA +1 -1
- {flowerpower-0.11.6.7.dist-info → flowerpower-0.11.6.9.dist-info}/RECORD +9 -9
- {flowerpower-0.11.6.7.dist-info → flowerpower-0.11.6.9.dist-info}/WHEEL +0 -0
- {flowerpower-0.11.6.7.dist-info → flowerpower-0.11.6.9.dist-info}/entry_points.txt +0 -0
- {flowerpower-0.11.6.7.dist-info → flowerpower-0.11.6.9.dist-info}/licenses/LICENSE +0 -0
- {flowerpower-0.11.6.7.dist-info → flowerpower-0.11.6.9.dist-info}/top_level.txt +0 -0
flowerpower/fs/ext.py
CHANGED
@@ -949,10 +949,10 @@ def _read_parquet(
|
|
949
949
|
if concat:
|
950
950
|
# Unify schemas before concatenation if opt_dtypes or multiple tables
|
951
951
|
if isinstance(tables, list):
|
952
|
-
if len(tables) > 1:
|
953
|
-
|
954
|
-
|
955
|
-
|
952
|
+
# if len(tables) > 1:
|
953
|
+
# schemas = [t.schema for t in tables]
|
954
|
+
# unified_schema = unify_schemas_pa(schemas)
|
955
|
+
# tables = [cast_schema(t, unified_schema) for t in tables]
|
956
956
|
result = pa.concat_tables(
|
957
957
|
[table for table in tables if table.num_rows > 0],
|
958
958
|
promote_options="permissive",
|
flowerpower/plugins/io/base.py
CHANGED
@@ -185,7 +185,7 @@ class BaseFileReader(BaseFileIO, gc=False):
|
|
185
185
|
include_file_path: bool = field(default=False)
|
186
186
|
concat: bool = field(default=True)
|
187
187
|
batch_size: int | None = field(default=None)
|
188
|
-
opt_dtypes: bool = field(default=
|
188
|
+
opt_dtypes: bool = field(default=False)
|
189
189
|
use_threads: bool = field(default=True)
|
190
190
|
conn: duckdb.DuckDBPyConnection | None = field(default=None)
|
191
191
|
ctx: datafusion.SessionContext | None = field(default=None)
|
flowerpower/utils/misc.py
CHANGED
@@ -266,6 +266,8 @@ else:
|
|
266
266
|
|
267
267
|
if importlib.util.find_spec("joblib"):
|
268
268
|
from joblib import Parallel, delayed
|
269
|
+
from rich.progress import (BarColumn, Progress, TextColumn,
|
270
|
+
TimeElapsedColumn)
|
269
271
|
|
270
272
|
def run_parallel(
|
271
273
|
func: callable,
|
@@ -299,19 +301,15 @@ if importlib.util.find_spec("joblib"):
|
|
299
301
|
>>> # Only kwargs iterables
|
300
302
|
>>> run_parallel(func, x=[1,2,3], y=[4,5,6], fixed=42)
|
301
303
|
"""
|
302
|
-
# Special kwargs for run_parallel itself
|
303
304
|
parallel_kwargs = {"n_jobs": n_jobs, "backend": backend, "verbose": 0}
|
304
305
|
|
305
|
-
# Process args and kwargs to separate iterables and fixed values
|
306
306
|
iterables = []
|
307
307
|
fixed_args = []
|
308
308
|
iterable_kwargs = {}
|
309
309
|
fixed_kwargs = {}
|
310
310
|
|
311
|
-
# Get the length of the first iterable to determine number of iterations
|
312
311
|
first_iterable_len = None
|
313
312
|
|
314
|
-
# Process args
|
315
313
|
for arg in args:
|
316
314
|
if isinstance(arg, (list, tuple)) and not isinstance(arg[0], (list, tuple)):
|
317
315
|
iterables.append(arg)
|
@@ -324,7 +322,6 @@ if importlib.util.find_spec("joblib"):
|
|
324
322
|
else:
|
325
323
|
fixed_args.append(arg)
|
326
324
|
|
327
|
-
# Process kwargs
|
328
325
|
for key, value in kwargs.items():
|
329
326
|
if isinstance(value, (list, tuple)) and not isinstance(
|
330
327
|
value[0], (list, tuple)
|
@@ -342,26 +339,56 @@ if importlib.util.find_spec("joblib"):
|
|
342
339
|
if first_iterable_len is None:
|
343
340
|
raise ValueError("At least one iterable argument is required")
|
344
341
|
|
345
|
-
# Create parameter combinations
|
346
342
|
all_iterables = iterables + list(iterable_kwargs.values())
|
347
|
-
param_combinations = list(zip(*all_iterables))
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
343
|
+
param_combinations = list(zip(*all_iterables))
|
344
|
+
|
345
|
+
if not verbose:
|
346
|
+
return Parallel(**parallel_kwargs)(
|
347
|
+
delayed(func)(
|
348
|
+
*(list(param_tuple[: len(iterables)]) + fixed_args),
|
349
|
+
**{
|
350
|
+
k: v
|
351
|
+
for k, v in zip(
|
352
|
+
iterable_kwargs.keys(), param_tuple[len(iterables) :]
|
353
|
+
)
|
354
|
+
},
|
355
|
+
**fixed_kwargs,
|
356
|
+
)
|
357
|
+
for param_tuple in param_combinations
|
362
358
|
)
|
363
|
-
|
364
|
-
|
359
|
+
else:
|
360
|
+
results = [None] * len(param_combinations)
|
361
|
+
with Progress(
|
362
|
+
TextColumn("[progress.description]{task.description}"),
|
363
|
+
BarColumn(),
|
364
|
+
"[progress.percentage]{task.percentage:>3.0f}%",
|
365
|
+
TimeElapsedColumn(),
|
366
|
+
transient=True,
|
367
|
+
) as progress:
|
368
|
+
task = progress.add_task(
|
369
|
+
"Running in parallel...", total=len(param_combinations)
|
370
|
+
)
|
371
|
+
|
372
|
+
def wrapper(idx, param_tuple):
|
373
|
+
res = func(
|
374
|
+
*(list(param_tuple[: len(iterables)]) + fixed_args),
|
375
|
+
**{
|
376
|
+
k: v
|
377
|
+
for k, v in zip(
|
378
|
+
iterable_kwargs.keys(), param_tuple[len(iterables) :]
|
379
|
+
)
|
380
|
+
},
|
381
|
+
**fixed_kwargs,
|
382
|
+
)
|
383
|
+
progress.update(task, advance=1)
|
384
|
+
return idx, res
|
385
|
+
|
386
|
+
for idx, result in Parallel(**parallel_kwargs)(
|
387
|
+
delayed(wrapper)(i, param_tuple)
|
388
|
+
for i, param_tuple in enumerate(param_combinations)
|
389
|
+
):
|
390
|
+
results[idx] = result
|
391
|
+
return results
|
365
392
|
|
366
393
|
else:
|
367
394
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: FlowerPower
|
3
|
-
Version: 0.11.6.
|
3
|
+
Version: 0.11.6.9
|
4
4
|
Summary: A simple workflow framework. Hamilton + APScheduler = FlowerPower
|
5
5
|
Author-email: "Volker L." <ligno.blades@gmail.com>
|
6
6
|
Project-URL: Homepage, https://github.com/legout/flowerpower
|
@@ -18,7 +18,7 @@ flowerpower/cli/pipeline.py,sha256=60P6u_QOSgp0jJXEMxazEEo5Sh7-SWFo-Kkuaz21YuI,3
|
|
18
18
|
flowerpower/cli/utils.py,sha256=nDSSj_1nlYlMmj252kRZeohhFqHv9yvdgDEduQCyWOc,5152
|
19
19
|
flowerpower/fs/__init__.py,sha256=uZaPXErEfQqQRbKRIjkB9yiygd45X5_psYn9-VVrBTQ,910
|
20
20
|
flowerpower/fs/base.py,sha256=TqgqBsaFj13O1NpAr8kHuGJ9CTlaSWViMB8Ai_iuCjs,22761
|
21
|
-
flowerpower/fs/ext.py,sha256=
|
21
|
+
flowerpower/fs/ext.py,sha256=RXEu2VYl1I1V2kb4kwny2nEzUByBzWFH81mMH8HNoTk,70210
|
22
22
|
flowerpower/fs/storage_options.py,sha256=msq5TpxAU8tcE_Bxjw6SyxaFa75UjdYnR4-O9U2wmbk,48034
|
23
23
|
flowerpower/job_queue/__init__.py,sha256=a25hIqv2xoFKb4JZlyUukS0ppZ9-2sJKH3XAvbk3rlk,10788
|
24
24
|
flowerpower/job_queue/base.py,sha256=YwLunDQSyqkSU_vJ69C5SSybJeJP1bAiZ3teUtOchxA,13640
|
@@ -44,7 +44,7 @@ flowerpower/pipeline/manager.py,sha256=KVpOclUEUAETUNJamJJGuKt3oxCaLitQgxWxkE1q0
|
|
44
44
|
flowerpower/pipeline/registry.py,sha256=6ngmHyKyQsxvIO4qRYxljedY0BE1wE3lpfksEGOzjNs,18963
|
45
45
|
flowerpower/pipeline/runner.py,sha256=dsSVYixFXqlxFk8EJfT4wV_7IwgkXq0ErwH_yf_NGS8,25654
|
46
46
|
flowerpower/pipeline/visualizer.py,sha256=amjMrl5NetErE198HzZBPWVZBi_t5jj9ydxWpuNLoTI,5013
|
47
|
-
flowerpower/plugins/io/base.py,sha256=
|
47
|
+
flowerpower/plugins/io/base.py,sha256=oGxTKobs0M19hPV842EelAeJ01EBz6kDdGv_4GTyFzk,97098
|
48
48
|
flowerpower/plugins/io/metadata.py,sha256=PCrepLilXRWKDsB5BKFF_-OFs712s1zBeitW-84lDLQ,7005
|
49
49
|
flowerpower/plugins/io/helpers/datetime.py,sha256=1WBUg2ywcsodJQwoF6JiIGc9yhVobvE2IErWp4i95m4,10649
|
50
50
|
flowerpower/plugins/io/helpers/polars.py,sha256=cuzMby0a90AMFXhNEycf53UOwdHw4uxnx322l3m7jB0,27443
|
@@ -89,14 +89,14 @@ flowerpower/settings/logging.py,sha256=xzoiM-87WGduC-RJu8RfyeweHGTM7SnHXHQPbxKwe
|
|
89
89
|
flowerpower/settings/retry.py,sha256=W3AAVSxmTUAeeSbzRGA37RxqtKKyUdi2MkwDzCsXP94,181
|
90
90
|
flowerpower/utils/callback.py,sha256=sGYSrEbnl0xfRa1X-mA-om3erpH7pmpsWdyPQ9HpU7E,6736
|
91
91
|
flowerpower/utils/logging.py,sha256=QO1Q3pv-m3mK2xT_VbkjTsomFnDeuqBmRuOtoxaowgg,864
|
92
|
-
flowerpower/utils/misc.py,sha256=
|
92
|
+
flowerpower/utils/misc.py,sha256=SK913FEYmOjS7GfSQ8oXNFiQ7owrH70fxp952vN5aWg,17099
|
93
93
|
flowerpower/utils/monkey.py,sha256=VPl3yimoWhwD9kI05BFsjNvtyQiDyLfY4Q85Bb6Ma0w,2903
|
94
94
|
flowerpower/utils/open_telemetry.py,sha256=fQWJWbIQFtKIxMBjAWeF12NGnqT0isO3A3j-DSOv_vE,949
|
95
95
|
flowerpower/utils/scheduler.py,sha256=2zJ_xmLXpvXUQNF1XS2Gqm3Ogo907ctZ50GtvQB_rhE,9354
|
96
96
|
flowerpower/utils/templates.py,sha256=ouyEeSDqa9PjW8c32fGpcINlpC0WToawRFZkMPtwsLE,1591
|
97
|
-
flowerpower-0.11.6.
|
98
|
-
flowerpower-0.11.6.
|
99
|
-
flowerpower-0.11.6.
|
100
|
-
flowerpower-0.11.6.
|
101
|
-
flowerpower-0.11.6.
|
102
|
-
flowerpower-0.11.6.
|
97
|
+
flowerpower-0.11.6.9.dist-info/licenses/LICENSE,sha256=9AkLexxrmr0aBgSHiqxpJk9wgazpP1CTJyiDyr56J9k,1063
|
98
|
+
flowerpower-0.11.6.9.dist-info/METADATA,sha256=7NW4WfKaqeQN2ahn6Y9u_cJmRr5xMWfNcJzHjlJeqjk,21612
|
99
|
+
flowerpower-0.11.6.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
100
|
+
flowerpower-0.11.6.9.dist-info/entry_points.txt,sha256=61X11i5a2IwC9LBiP20XCDl5zMOigGCjMCx17B7bDbQ,52
|
101
|
+
flowerpower-0.11.6.9.dist-info/top_level.txt,sha256=VraH4WtEUfSxs5L-rXwDQhzQb9eLHTUtgvmFZ2dAYnA,12
|
102
|
+
flowerpower-0.11.6.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|