airflow.models.renderedtifields
¶
Save Rendered Template Fields
Module Contents¶
-
class
airflow.models.renderedtifields.
RenderedTaskInstanceFields
(ti: TaskInstance, render_templates=True)[source]¶ Bases:
airflow.models.base.Base
Save Rendered Template Fields
-
classmethod
get_templated_fields
(cls, ti: TaskInstance, session: 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
-
classmethod
get_k8s_pod_yaml
(cls, ti: TaskInstance, session: Session = None)[source]¶ Get rendered Kubernetes Pod Yaml for a TaskInstance from the RenderedTaskInstanceFields table.
- Parameters
ti -- Task Instance
session -- SqlAlchemy Session
- Returns
Kubernetes Pod Yaml
-
write
(self, session: Session = None)[source]¶ Write instance to database
- Parameters
session -- SqlAlchemy Session
-
classmethod
delete_old_records
(cls, task_id: str, dag_id: str, num_to_keep=conf.getint('core', 'max_num_rendered_ti_fields_per_task', fallback=0), session: 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
-
classmethod