airflow.models.renderedtifields

Save Rendered Template Fields

Module Contents

class airflow.models.renderedtifields.RenderedTaskInstanceFields(ti, render_templates=True)[source]

Bases: airflow.models.base.Base

Save Rendered Template Fields

__tablename__ = rendered_task_instance_fields[source]
dag_id[source]
task_id[source]
execution_date[source]
rendered_fields[source]
__repr__(self)[source]
classmethod get_templated_fields(cls, ti, session=None)[source]

Get templated field for a TaskInstance from the RenderedTaskInstanceFields table.

Parameters
  • ti – Task Instance

  • session – SqlAlchemy Session

Returns

Rendered Templated TI field

write(self, session=None)[source]

Write instance to database

Parameters

session – SqlAlchemy Session

classmethod delete_old_records(cls, task_id, dag_id, num_to_keep=conf.getint('core', 'max_num_rendered_ti_fields_per_task', fallback=0), session=None)[source]

Keep only Last X (num_to_keep) number of records for a task by deleting others

Parameters
  • task_id – Task ID

  • dag_id – Dag ID

  • num_to_keep – Number of Records to keep

  • session – SqlAlchemy Session

Was this entry helpful?