Skip to content

Commit 08c317d

Browse files
authored
Move structlog imports into a TYPE_CHECKING block to untie version bumps (#57335)
1 parent b011954 commit 08c317d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

airflow-ctl/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dependencies = [
3535
"platformdirs>=4.3.6",
3636
"pydantic>=2.11.0", # https://github.com/apache/airflow/issues/56482
3737
"rich-argparse>=1.0.0",
38-
"structlog>=25.2.0",
38+
"structlog>=25.4.0",
3939
"uuid6>=2024.7.10",
4040
"tabulate>=0.9.0",
4141
]

shared/logging/src/airflow_shared/logging/percent_formatter.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,20 @@
2626
from typing import TYPE_CHECKING, ClassVar
2727

2828
import structlog.dev
29-
from structlog.dev import ConsoleRenderer, Styles
29+
from structlog.dev import ConsoleRenderer
3030
from structlog.processors import CallsiteParameter
3131

3232
if TYPE_CHECKING:
33+
from structlog.dev import ColumnStyles
3334
from structlog.typing import EventDict, WrappedLogger
3435

3536

3637
class _LazyLogRecordDict(collections.abc.Mapping):
3738
__slots__ = ("event", "styles", "level_styles", "method_name", "no_colors")
3839

39-
def __init__(self, event: EventDict, method_name: str, level_styles: dict[str, str], styles: Styles):
40+
def __init__(
41+
self, event: EventDict, method_name: str, level_styles: dict[str, str], styles: ColumnStyles
42+
):
4043
self.event = event
4144
self.method_name = method_name
4245
self.level_styles = level_styles

0 commit comments

Comments
 (0)