Skip to content

Commit e779cab

Browse files
committed
Release ready
1 parent d499665 commit e779cab

6 files changed

Lines changed: 31 additions & 17 deletions

File tree

docs/release-notes.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# Release Notes
22

3+
## v2.4.0
4+
5+
Lazy settings via pydantic-settings, JSONB params filtering for task
6+
history, and customisable route prefixes.
7+
8+
- Settings are now lazy — resolved on first access instead of at import
9+
time. Env vars use a `FLUID_` prefix by default; legacy unprefixed names
10+
are kept as aliases.
11+
([#100](https://github.com/quantmind/aio-fluid/pull/100))
12+
- The task database plugin accepts a `route_prefix` parameter for
13+
customising history route URLs and replaces `with_task_history_router()`
14+
with a `register_routes()` method.
15+
([#100](https://github.com/quantmind/aio-fluid/pull/100))
16+
- Task history queries support filtering by run params via a new `params`
17+
field (renamed from `HistoryQuery` to `TaskHistoryQuery`).
18+
([#99](https://github.com/quantmind/aio-fluid/pull/99))
19+
- **Database migration required:** the `params` column is now `JSONB` with
20+
a GIN index. See the example
21+
[migration](https://github.com/quantmind/aio-fluid/blob/main/examples/tasks/migrations/versions/d941c11ca25a_jsonb.py)
22+
for the schema changes.
23+
- Removed `get_logger` from `fluid.utils.log`. Task loggers are now obtained
24+
directly via `logging.getLogger(module)`.
25+
326
## v2.3.1
427

528
**v2.3.0 is broken — do not use it.**

examples/full_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def create_cli() -> TaskManagerCLI:
2020
# create the client
2121
task_manager_cli = TaskManagerCLI(
2222
task_app(plugins=[TaskDbPlugin(db)]),
23+
log_config=dict(app_names=["fluid", "examples"]),
2324
commands=list(DEFAULT_COMMANDS)
2425
+ [DbGroup(db, help="Task database plugin management")],
2526
help="Task Manager CLI with db plugin",

fluid/scheduler/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from typing_extensions import Annotated, Doc, TypedDict
2727

2828
from fluid import settings
29-
from fluid.utils import kernel, log
29+
from fluid.utils import kernel
3030
from fluid.utils.data import compact_dict
3131
from fluid.utils.dates import as_utc, utcnow
3232
from fluid.utils.text import create_uid, trim_docstring
@@ -797,9 +797,10 @@ def create_task(
797797
kwargs.update(defaults)
798798
kwargs.update(compact_dict(self.kwargs))
799799
name = kwargs["name"]
800+
module = kwargs.get("module") or settings.APP_NAME
800801
kwargs.update(
801802
executor=executor,
802-
logger=log.get_logger(f"task.{name}", prefix=True),
803+
logger=logging.getLogger(f"{module}.{name}"),
803804
)
804805
return Task(**kwargs)
805806

fluid/utils/log.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,13 @@
1212
from fluid import settings
1313

1414

15-
def get_logger(name: str = "", prefix: bool = False) -> logging.Logger:
16-
# Only resolve the application base logger (and therefore the settings) on
17-
# the paths that actually need it, so that the common module-level
18-
# ``get_logger(__name__)`` call does not populate the settings cache at
19-
# import time.
20-
if not prefix and name:
21-
return logging.getLogger(name)
22-
base = logging.getLogger(settings.APP_NAME)
23-
return base.getChild(name) if name else base
24-
25-
2615
def get_level_num(level: str | int) -> int:
2716
if isinstance(level, int):
2817
return level
2918
return getattr(logging, level.upper())
3019

3120

32-
def log_config(
21+
def _log_config(
3322
level: str | int | None = None,
3423
other_level: str | int = logging.WARNING,
3524
app_names: Sequence[str] | None = None,
@@ -136,7 +125,7 @@ def config(
136125
] = None,
137126
) -> dict:
138127
"""Configure logging for the application"""
139-
cfg = log_config(
128+
cfg = _log_config(
140129
level=level,
141130
other_level=other_level,
142131
app_names=app_names,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "aio-fluid"
3-
version = "2.3.1"
3+
version = "2.4.0"
44
description = "Tools for backend python services"
55
authors = [
66
{ name = "Luca Sbardella", email = "luca@quantmind.com" },

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)