"""
    Test that clearing a task and moving from non-mapped to mapped clears existing
    references in XCom, TaskFail, TaskInstanceNote, TaskReschedule and
    RenderedTaskInstanceFields. To be able to test this, RenderedTaskInstanceFields
    was not used in the test since it would require that the task is expanded first.
    """
    from airflow.models.taskfail import TaskFail
    from airflow.models.xcom import XCom
    @task
    def printx(x):