Prism
v0.3.0
v0.3.0
  • 👋Welcome to Prism!
  • Getting Started
    • Installation
    • Creating your first project
    • Why Prism?
  • Fundamentals
    • PrismProject API
      • PrismProject().run
      • PrismProject().graph
    • Tasks
    • Targets
      • Multiple targets
    • CurrentRun API
      • CurrentRun.ref()
      • CurrentRun.conn()
      • CurrentRun.ctx()
  • Connectors
    • Overview
    • BigQueryConnector
    • PostgresConnector
    • RedshiftConnector
    • SnowflakeConnector
    • TrinoConnector
    • PrestoConnector
  • CLI
    • Command Line Interface
    • graph
    • init
    • run
  • Advanced features
    • Concurrency
    • Logging
    • Callbacks
    • Retries
    • Skipping tasks
  • API Reference
    • prism.task.PrismTask
    • @task(...)
    • @target(...)
    • @target_iterator(...)
    • prism.target.PrismTarget
  • Use Cases
    • Analytics on top of dbt
    • Machine Learning
  • Wiki
    • DAGs
Powered by GitBook
On this page
  1. API Reference

@task(...)

Decorator used to turn a function into a Prism task.

Previousprism.task.PrismTaskNext@target(...)

Last updated 1 year ago

prism.decorators.task(*, retries: int = 0, retry_delay_seconds: int = 0, targets: List[Callable] = [])

  • Parameters

    • *: indicates that the task decorator only accepts keyword arguments.

    • retries: total number of times to retry the task upon failure. Default is 0.

    • retry_delay_seconds: number of seconds to wait in between task retries. Default is 0.

    • targets: list of decorator calls. Default is an empty list.

Example:

from prism.decorators import task, target
from prism.target import Txt

@task(
    retries=1,
    retry_delay_second=60,
)
def example_task_function():
    # do some stuff here
    return ...

target