Skip to content
Get Started

Recipes

Each recipe is one pipeline shape, the smallest code that does it, and what barca does when you run it. For longer walkthroughs that change code and rerun to show what the cache does, see Worked Examples.

  • Chain Assets

    Chain assets with inputs=. Each step is cached and runs again only when its code or an upstream changes.

  • Feed an Asset to a Task

    An asset produces a cached value; a task reads it and does something with it. The task runs every time.

  • Run After a Step Without Its Value

    Start an input's name with an underscore when a step must run after another but does not need its value.

  • Run Tasks in Parallel

    Inside a task, parallel() and parallel_map() run other tasks in separate worker processes and return their results in order.

  • Branch or Stop Conditionally

    Barca has no conditional construct. Branch inside the function body, or raise in a gate step to stop what depends on it.

  • Retries, Timeouts and Failures

    Declare retries and a timeout on the decorator. A step that still fails stops the steps that depend on it and the command exits 1.

  • Read Large Inputs Lazily

    A parquet input with no annotation is read whole with pandas. Annotate it as a DuckDB relation or a polars LazyFrame to read only what the step uses.

  • Rerun Only Changed Partitions

    One sensor query returns every key and its version; partitions_from over that dict runs only the keys whose version changed, through a chain of partitioned assets.

  • Anti-Patterns to Avoid

    Things that fail or give stale or wrong results in barca, what happens on current barca (rechecked on 0.42.0), and what to do instead.