# Operator Tasks


The tasks in this module can be used to represent builtin operations, including math, indexing, and logical comparisons.

In general, users will not instantiate these tasks by hand; they will automatically be applied when users apply inline Python operators to a task and another value.

# GetItem

class

prefect.tasks.core.operators.GetItem

(default=<no default>, *args, **kwargs)[source]

Helper task that retrieves a specific index of an upstream task's result.

Args:

  • default (Any): the object to use as the default
  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.GetItem.run

(task_result, key, default=<no default>)[source]

Args:

  • task_result (Any): a value
  • key (Any): the index to retrieve as task_result[key]
  • default (Any): the object to use as the default



# GetAttr

class

prefect.tasks.core.operators.GetAttr

(default=<no default>, *args, **kwargs)[source]

Helper task that retrieves a specific attribute of an upstream task's result.

Args:

  • default (Any): the object to use as the default
  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.GetAttr.run

(task_result, attr, default=<no default>)[source]

Args:

  • task_result (Any): a value
  • attr (Any): the (possibly nested) attribute to retrieve as task_result.attr. Nested attributes should be accessed via .-delimited strings.
  • default (Any): the object to use as the default



# Add

class

prefect.tasks.core.operators.Add

(*args, **kwargs)[source]

Evaluates x + y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.Add.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# Sub

class

prefect.tasks.core.operators.Sub

(*args, **kwargs)[source]

Evaluates x - y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.Sub.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# Mul

class

prefect.tasks.core.operators.Mul

(*args, **kwargs)[source]

Evaluates x * y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.Mul.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# Div

class

prefect.tasks.core.operators.Div

(*args, **kwargs)[source]

Evaluates x / y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.Div.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# FloorDiv

class

prefect.tasks.core.operators.FloorDiv

(*args, **kwargs)[source]

Evaluates x // y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.FloorDiv.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# Pow

class

prefect.tasks.core.operators.Pow

(*args, **kwargs)[source]

Evaluates x ** y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.Pow.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# Mod

class

prefect.tasks.core.operators.Mod

(*args, **kwargs)[source]

Evaluates x % y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.Mod.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# And

class

prefect.tasks.core.operators.And

(*args, **kwargs)[source]

Evaluates x and y.

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.And.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# Or

class

prefect.tasks.core.operators.Or

(*args, **kwargs)[source]

Evaluates x or y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.Or.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# Not

class

prefect.tasks.core.operators.Not

(*args, **kwargs)[source]

Evaluates not x

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.Not.run

(x)[source]

Args:

  • x (Any): a value
Returns:
  • bool



# Equal

class

prefect.tasks.core.operators.Equal

(*args, **kwargs)[source]

Evaluates x == y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.Equal.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# NotEqual

class

prefect.tasks.core.operators.NotEqual

(*args, **kwargs)[source]

Evaluates x != y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.NotEqual.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# GreaterThanOrEqual

class

prefect.tasks.core.operators.GreaterThanOrEqual

(*args, **kwargs)[source]

Evaluates x ≥ y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.GreaterThanOrEqual.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# GreaterThan

class

prefect.tasks.core.operators.GreaterThan

(*args, **kwargs)[source]

Evaluates x > y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.GreaterThan.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# LessThanOrEqual

class

prefect.tasks.core.operators.LessThanOrEqual

(*args, **kwargs)[source]

Evaluates x ≤ y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.LessThanOrEqual.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



# LessThan

class

prefect.tasks.core.operators.LessThan

(*args, **kwargs)[source]

Evaluates x < y

Args:

  • *args (Any): positional arguments for the Task class
  • **kwargs (Any): keyword arguments for the Task class

methods:                                                                                                                                                       

prefect.tasks.core.operators.LessThan.run

(x, y)[source]

Args:

  • x (Any): a value
  • y (Any): a value
Returns:
  • Any



This documentation was auto-generated from commit n/a
on July 1, 2021 at 18:35 UTC