| :py:mod:`airflow.models.renderedtifields` |
| ========================================= |
| |
| .. py:module:: airflow.models.renderedtifields |
| |
| .. autoapi-nested-parse:: |
| |
| Save Rendered Template Fields |
| |
| |
| |
| Module Contents |
| --------------- |
| |
| Classes |
| ~~~~~~~ |
| |
| .. autoapisummary:: |
| |
| airflow.models.renderedtifields.RenderedTaskInstanceFields |
| |
| |
| |
| |
| .. py:class:: RenderedTaskInstanceFields(ti, render_templates=True) |
| |
| Bases: :py:obj:`airflow.models.base.Base` |
| |
| Save Rendered Template Fields |
| |
| .. py:attribute:: __tablename__ |
| :annotation: = rendered_task_instance_fields |
| |
| |
| |
| .. py:attribute:: dag_id |
| |
| |
| |
| |
| .. py:attribute:: task_id |
| |
| |
| |
| |
| .. py:attribute:: run_id |
| |
| |
| |
| |
| .. py:attribute:: map_index |
| |
| |
| |
| |
| .. py:attribute:: rendered_fields |
| |
| |
| |
| |
| .. py:attribute:: k8s_pod_yaml |
| |
| |
| |
| |
| .. py:attribute:: __table_args__ |
| |
| |
| |
| |
| .. py:attribute:: task_instance |
| |
| |
| |
| |
| .. py:attribute:: dag_run |
| |
| |
| |
| |
| .. py:attribute:: execution_date |
| |
| |
| |
| |
| .. py:method:: __repr__(self) |
| |
| |
| .. py:method:: get_templated_fields(cls, ti, session = NEW_SESSION) |
| :classmethod: |
| |
| Get templated field for a TaskInstance from the RenderedTaskInstanceFields |
| table. |
| |
| :param ti: Task Instance |
| :param session: SqlAlchemy Session |
| :return: Rendered Templated TI field |
| |
| |
| .. py:method:: get_k8s_pod_yaml(cls, ti, session = NEW_SESSION) |
| :classmethod: |
| |
| Get rendered Kubernetes Pod Yaml for a TaskInstance from the RenderedTaskInstanceFields |
| table. |
| |
| :param ti: Task Instance |
| :param session: SqlAlchemy Session |
| :return: Kubernetes Pod Yaml |
| |
| |
| .. py:method:: write(self, session = None) |
| |
| Write instance to database |
| |
| :param session: SqlAlchemy Session |
| |
| |
| .. py:method:: 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) |
| :classmethod: |
| |
| Keep only Last X (num_to_keep) number of records for a task by deleting others. |
| |
| In the case of data for a mapped task either all of the rows or none of the rows will be deleted, so |
| we don't end up with partial data for a set of mapped Task Instances left in the database. |
| |
| :param task_id: Task ID |
| :param dag_id: Dag ID |
| :param num_to_keep: Number of Records to keep |
| :param session: SqlAlchemy Session |
| |
| |
| |