From d8bb6d091b17f3c4d4f54e15d1eaacee064c8ab2 Mon Sep 17 00:00:00 2001 From: Pascal Tomecek <40371786+ptomecek@users.noreply.github.com> Date: Tue, 27 Oct 2026 18:54:06 -0400 Subject: [PATCH] [bug] Import yaml lazily in the YAML publishers pyyaml was only installed transitively through hydra-core, which is now optional, so a bare install could not import ccflow. Import it inside YAMLPublisher and PrintYAMLPublisher instead of at module level. Signed-off-by: Pascal Tomecek <40371786+ptomecek@users.noreply.github.com> --- ccflow/publishers/file.py | 3 ++- ccflow/publishers/print.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ccflow/publishers/file.py b/ccflow/publishers/file.py index a0ba489b..58083ee5 100644 --- a/ccflow/publishers/file.py +++ b/ccflow/publishers/file.py @@ -4,7 +4,6 @@ import narwhals.stable.v1 as nw import pandas as pd -import yaml from cloudpathlib import AnyPath from pydantic import Field, field_validator from typing_extensions import override @@ -91,6 +90,8 @@ class YAMLPublisher(BasePublisher): @override def __call__(self) -> AnyPath: + import yaml + return GenericFilePublisher( name=self.name, name_params=self.name_params, diff --git a/ccflow/publishers/print.py b/ccflow/publishers/print.py index 8b08c957..1eff49ef 100644 --- a/ccflow/publishers/print.py +++ b/ccflow/publishers/print.py @@ -1,7 +1,6 @@ import logging from typing import Any, Generic, Literal -import yaml from pydantic import Field, field_validator from typing_extensions import override @@ -77,6 +76,8 @@ class PrintYAMLPublisher(BasePublisher): @override def __call__(self) -> Any: + import yaml + print(yaml.dump(self.data, **self.kwargs)) return self.data