ccflow_celery

Submodules

Attributes

Classes

CeleryConfig

Configuration for a Celery application.

CeleryApp

Wrapper around a Celery application instance.

CeleryEvaluator

Evaluator that dispatches model execution to Celery workers.

CeleryGraphEvaluator

Evaluator that parallelizes DAG execution via Celery.

Package Contents

class ccflow_celery.CeleryConfig(/, **data: Any)[source]

Bases: ccflow.BaseModel

Configuration for a Celery application.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

broker_url: str = None
result_backend: str | None = None
task_serializer: str = 'json'
result_serializer: str = 'json'
accept_content: list = None
task_track_started: bool = True
task_default_queue: str = 'default'
task_routes: Dict[str, str] | None = None
worker_concurrency: int | None = None
task_always_eager: bool = None
task_eager_propagates: bool = None
class ccflow_celery.CeleryApp(/, **data: Any)[source]

Bases: ccflow.BaseModel

Wrapper around a Celery application instance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

name: str = None
config: CeleryConfig = None
_app: Any = None
get_app()[source]
class ccflow_celery.CeleryEvaluator(/, **data: Any)[source]

Bases: ccflow.EvaluatorBase

Evaluator that dispatches model execution to Celery workers.

Serializes the model and context, submits as a Celery task, and waits for the result. The model must be reconstructable from its Pydantic config dump.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

app: ccflow_celery.app.CeleryApp = None
timeout: float | None = None
task_name: str = None
_celery_app: Any = None
_get_celery_app()[source]
__call__(context: ccflow.callable.ModelEvaluationContext) Any[source]

This method produces the result for the given context.

Instead of passing the context, one can pass an object that pydantic will try to validate as the context. Additionally, if kwargs are passed instead of the context, it will use these to construct the context.

class ccflow_celery.CeleryGraphEvaluator(/, **data: Any)[source]

Bases: ccflow.EvaluatorBase

Evaluator that parallelizes DAG execution via Celery.

Builds the dependency graph (like GraphEvaluator), then submits independent nodes as parallel Celery tasks using Celery groups. Nodes that depend on other nodes wait for their dependencies first.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

app: ccflow_celery.app.CeleryApp = None
timeout: float | None = None
task_name: str = None
_celery_app: Any = None
_is_evaluating: bool = None
_get_celery_app()[source]
__call__(context: ccflow.callable.ModelEvaluationContext) Any[source]

This method produces the result for the given context.

Instead of passing the context, one can pass an object that pydantic will try to validate as the context. Additionally, if kwargs are passed instead of the context, it will use these to construct the context.

ccflow_celery.__version__ = '0.1.0'