You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by je...@apache.org on 2021/10/26 14:33:17 UTC
[airflow] branch v2-2-test updated (e230429 -> 360474f)
This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a change to branch v2-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git.
from e230429 Add Airflow 2.2.1 to UDPATING
new 77140e9 Add DagRun.logical_date as a property (#19198)
new fdb0aef Fix Unexpected commit error in schedulerjob (#19213)
new 360474f Update changelog for 2.2.1rc2
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
CHANGELOG.txt | 4 +++-
airflow/jobs/scheduler_job.py | 11 ++++++++---
airflow/models/dagrun.py | 4 ++++
3 files changed, 15 insertions(+), 4 deletions(-)
[airflow] 01/03: Add DagRun.logical_date as a property (#19198)
Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch v2-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 77140e981405ab5d732f9b0b82f666d4c26e5886
Author: Tzu-ping Chung <tp...@astronomer.io>
AuthorDate: Mon Oct 25 18:44:54 2021 +0800
Add DagRun.logical_date as a property (#19198)
(cherry picked from commit 5616dcb1dfeceda6f0749fb3d650f612ea0c1ce7)
---
airflow/models/dagrun.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/airflow/models/dagrun.py b/airflow/models/dagrun.py
index e8eb685..800720c 100644
--- a/airflow/models/dagrun.py
+++ b/airflow/models/dagrun.py
@@ -181,6 +181,10 @@ class DagRun(Base, LoggingMixin):
external_trigger=self.external_trigger,
)
+ @property
+ def logical_date(self) -> datetime:
+ return self.execution_date
+
def get_state(self):
return self._state
[airflow] 03/03: Update changelog for 2.2.1rc2
Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch v2-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 360474fff3738f70e95580a91e778250afa7ce82
Author: Jed Cunningham <66...@users.noreply.github.com>
AuthorDate: Tue Oct 26 08:32:02 2021 -0600
Update changelog for 2.2.1rc2
---
CHANGELOG.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 060ea20..a4d0754 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,9 +1,11 @@
-Airflow 2.2.1, 2021-10-25
+Airflow 2.2.1, 2021-10-29
-------------------------
Bug Fixes
"""""""""
+- Fix Unexpected commit error in schedulerjob (#19213)
+- Add DagRun.logical_date as a property (#19198)
- Clear ti.next_method and ti.next_kwargs on task finish (#19183)
- Faster PostgreSQL db migration to Airflow 2.2 (#19166)
- Remove incorrect type comment in ``Swagger2Specification._set_defaults`` classmethod (#19065)
[airflow] 02/03: Fix Unexpected commit error in schedulerjob
(#19213)
Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch v2-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit fdb0aefcffd0e2a966c33ee6641987aa8f8fa33b
Author: Ephraim Anierobi <sp...@gmail.com>
AuthorDate: Tue Oct 26 07:55:24 2021 +0100
Fix Unexpected commit error in schedulerjob (#19213)
(cherry picked from commit cdbb481338f8a93290e9ca308bf111c3a30fa6ce)
---
airflow/jobs/scheduler_job.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/airflow/jobs/scheduler_job.py b/airflow/jobs/scheduler_job.py
index 87dc158..2c7378d 100644
--- a/airflow/jobs/scheduler_job.py
+++ b/airflow/jobs/scheduler_job.py
@@ -422,18 +422,23 @@ class SchedulerJob(BaseJob):
make_transient(ti)
return executable_tis
- def _enqueue_task_instances_with_queued_state(self, task_instances: List[TI]) -> None:
+ @provide_session
+ def _enqueue_task_instances_with_queued_state(
+ self, task_instances: List[TI], session: Session = None
+ ) -> None:
"""
Takes task_instances, which should have been set to queued, and enqueues them
with the executor.
:param task_instances: TaskInstances to enqueue
:type task_instances: list[TaskInstance]
+ :param session: The session object
+ :type session: Session
"""
# actually enqueue them
for ti in task_instances:
if ti.dag_run.state in State.finished:
- ti.set_state(State.NONE)
+ ti.set_state(State.NONE, session=session)
continue
command = ti.command_as_list(
local=True,
@@ -477,7 +482,7 @@ class SchedulerJob(BaseJob):
max_tis = min(self.max_tis_per_query, self.executor.slots_available)
queued_tis = self._executable_task_instances_to_queued(max_tis, session=session)
- self._enqueue_task_instances_with_queued_state(queued_tis)
+ self._enqueue_task_instances_with_queued_state(queued_tis, session=session)
return len(queued_tis)
@provide_session