Skip to content

Commit 0bcdba0

Browse files
committed
Update Release Note for 2.4.0
1 parent a166fb8 commit 0bcdba0

File tree

2 files changed

+280
-13
lines changed

2 files changed

+280
-13
lines changed

RELEASE_NOTES.rst

Lines changed: 279 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,73 @@
2121

2222
.. towncrier release notes start
2323

24-
Airflow 2.4.0beta1 (2022-09-08)
24+
Airflow 2.4.0 (2022-09-19)
2525
-------------------------------
2626

2727
Significant Changes
2828
^^^^^^^^^^^^^^^^^^^
2929

30+
Data-aware Scheduling and ``Dataset`` concept added to Airflow
31+
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
32+
33+
New to this release of Airflow is the concept of Datasets to Airflow, and with it a new way of scheduling dags:
34+
data-aware scheduling.
35+
36+
This allows DAG runs to be automatically created as a result of a task "producing" a dataset. In some ways
37+
this can be thought of as the inverse of ``TriggerDagRunOperator``, where instead of the producing DAG
38+
controlling which DAGs get created, the consuming DAGs can "listen" for changes.
39+
40+
A dataset is identified by a URI:
41+
42+
.. code-block:: python
43+
44+
from airflow import Dataset
45+
46+
# The URI doesn't have to be absolute
47+
dataset = Dataset(uri='my-dataset')
48+
# Or you can use a scheme to show where it lives.
49+
dataset2 = Dataset(uri='s3://bucket/prefix')
50+
51+
To create a DAG that runs whenever a Dataset is updated use the new ``scheduler`` parameter (see below) and
52+
pass a list of 1 or more Datasets:
53+
54+
.. code-block:: python
55+
56+
with DAG(dag_id='dataset-consmer', schedule=[dataset]):
57+
...
58+
59+
And to mark a task as producing a dataset pass the dataset(s) to the ``outlets`` attribute:
60+
61+
.. code-block:: python
62+
63+
@task(outlets=[dataset])
64+
def my_task():
65+
...
66+
67+
68+
# Or for classic operators
69+
BashOperator(task_id="update-ds", bash_command=..., outlets=[dataset])
70+
71+
If you have the producer and consumer in different files you do not need to use the same Dataset object, two
72+
``Dataset()``\s created with the same URI are equal.
73+
74+
Datasets represent the abstract concept of a dataset, and (for now) do not have any direct read or write
75+
capability - in this release we are adding the foundational feature that we will build upon.
76+
77+
For more info on Datasets please see :doc:`/concepts/datasets`.
78+
79+
Expanded dynamic task mapping support
80+
"""""""""""""""""""""""""""""""""""""
81+
82+
Dynamic task mapping now includes support for ``expand_kwargs``, ``zip`` and ``map``.
83+
84+
For more info on dynamic task mapping please see :doc:`/concepts/dynamic-task-mapping`.
85+
3086
DAGS used in a context manager no longer need to be assigned to a module variable (#23592)
3187
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3288

33-
Previously you had do assign a DAG to a module-level variable in order for Airflow to pick it up. For example this
89+
Previously you had to assign a DAG to a module-level variable in order for Airflow to pick it up. For example this
90+
3491

3592
.. code-block:: python
3693

@@ -126,12 +183,12 @@ Smart Sensors were added in 2.0 and deprecated in favor of Deferrable operators
126183
``airflow.contrib`` packages and deprecated modules are dynamically generated (#26153, #26179, #26167)
127184
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
128185

129-
The ``airflow.contrib`` packages and deprecated modules from Airflow 1.10 in ``airflow.hooks``, ``airflow.operators``, ``airflow.sensors`` packages, have now dynamically generated modules and while users can continue using the deprecated contrib classes, they are no longer visible for static code check tools and will be reported as missing. It is recommended for the users to move to non-deprecated classes.
186+
The ``airflow.contrib`` packages and deprecated modules from Airflow 1.10 in ``airflow.hooks``, ``airflow.operators``, ``airflow.sensors`` packages are now dynamically generated modules and while users can continue using the deprecated contrib classes, they are no longer visible for static code check tools and will be reported as missing. It is recommended for the users to move to the non-deprecated classes.
130187

131188
``DBApiHook`` and ``SQLSensor`` have moved (#24836)
132189
"""""""""""""""""""""""""""""""""""""""""""""""""""
133190

134-
``DBApiHook``, ``SQLSensor`` have been moved to the ``apache-airflow-providers-common-sql`` provider.
191+
``DBApiHook`` and ``SQLSensor`` have been moved to the ``apache-airflow-providers-common-sql`` provider.
135192

136193
DAG runs sorting logic changed in grid view (#25090)
137194
""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -141,22 +198,232 @@ The new logic generally orders by data interval, but a custom ordering can be
141198
applied by setting the DAG to use a custom timetable.
142199

143200

144-
Features
145-
^^^^^^^^
146-
147-
- DbApiHook accepts log_sql to turn off logging SQL queries. (#24570)
148-
201+
New Features
202+
^^^^^^^^^^^^
203+
- Add Data-aware Scheduling (`AIP-48 <https://github.com/apache/airflow/pulls?q=is%3Apr+is%3Amerged+label%3AAIP-48+milestone%3A%22Airflow+2.4.0%22>`_)
204+
- Add ``@task.short_circuit`` TaskFlow decorator (#25752)
205+
- Make ``execution_date_or_run_id`` optional in ``tasks test`` command (#26114)
206+
- Automatically register DAGs that are used in a context manager (#23592, #26398)
207+
- Add option of sending DAG parser logs to stdout. (#25754)
208+
- Support multiple ``DagProcessors`` parsing files from different locations. (#25935)
209+
- Implement ``ExternalPythonOperator`` (#25780)
210+
- Make execution_date optional for command ``dags test`` (#26111)
211+
- Implement ``expand_kwargs()`` against a literal list (#25925)
212+
- Add trigger rule tooltip (#26043)
213+
- Add conf parameter to CLI for airflow dags test (#25900)
214+
- Include scheduled slots in pools view (#26006)
215+
- Add ``output`` property to ``MappedOperator`` (#25604)
216+
- Add roles delete command to cli (#25854)
217+
- Add Airflow specific warning classes (#25799)
218+
- Add support for ``TaskGroup`` in ``ExternalTaskSensor`` (#24902)
219+
- Add ``@task.kubernetes`` taskflow decorator (#25663)
220+
- Add a way to import Airflow without side-effects (#25832)
221+
- Let timetables control generated run_ids. (#25795)
222+
- Allow per-timetable ordering override in grid view (#25633)
223+
- Grid logs for mapped instances (#25610, #25621, #25611)
224+
- Consolidate to one ``schedule`` param (#25410)
225+
- DAG regex flag in backfill command (#23870)
226+
- Adding support for owner links in the Dags view UI (#25280)
227+
- Ability to clear a specific DAG Run's task instances via REST API (#23516)
228+
- Possibility to document DAG with a separate markdown file (#25509)
229+
- Add parsing context to DAG Parsing (#25161)
230+
- Implement ``CronTriggerTimetable`` (#23662)
231+
- Add option to mask sensitive data in UI configuration page (#25346)
232+
- Create new databases from the ORM (#24156)
233+
- Implement ``XComArg.zip(*xcom_args)`` (#25176)
234+
- Introduce ``sla_miss`` metric (#23402)
235+
- Implement ``map()`` semantic (#25085)
236+
- Add override method to TaskGroupDecorator (#25160)
237+
- Implement ``expand_kwargs()`` (#24989)
238+
- Add parameter to turn off SQL query logging (#24570)
239+
- Add ``DagWarning`` model, and a check for missing pools (#23317)
240+
- Add Task Logs to Grid details panel (#24249)
241+
- Added small health check server and endpoint in scheduler(#23905)
242+
- Add built-in External Link for ``ExternalTaskMarker`` operator (#23964)
243+
- Add default task retry delay config (#23861)
244+
- Add clear DagRun endpoint. (#23451)
245+
- Add support for timezone as string in cron interval timetable (#23279)
246+
- Add auto-refresh to dags home page (#22900, #24770)
149247

150248
Improvements
151249
^^^^^^^^^^^^
152250

153-
- Default value for [core] hostname_callable is ``airflow.utils.net.getfqdn`` which should provide more stable canonical host name. You can still use ``socket.getfqdn``or any other ``hostname_callable`` you had configured.. (#24981)
154-
251+
- Add more weekday operator and sensor examples #26071 (#26098)
252+
- Add subdir parameter to dags reserialize command (#26170)
253+
- Update zombie message to be more descriptive (#26141)
254+
- Only send an ``SlaCallbackRequest`` if the DAG is scheduled (#26089)
255+
- Promote ``Operator.output`` more (#25617)
256+
- Upgrade API files to typescript (#25098)
257+
- Less ``hacky`` double-rendering prevention in mapped task (#25924)
258+
- Improve Audit log (#25856)
259+
- Remove mapped operator validation code (#25870)
260+
- More ``DAG(schedule=...)`` improvements (#25648)
261+
- Reduce ``operator_name`` dupe in serialized JSON (#25819)
262+
- Make grid view group/mapped summary UI more consistent (#25723)
263+
- Remove useless statement in ``task_group_to_grid`` (#25654)
264+
- Add optional data interval to ``CronTriggerTimetable`` (#25503)
265+
- Remove unused code in ``/grid`` endpoint (#25481)
266+
- Add and document description fields (#25370)
267+
- Improve Airflow logging for operator Jinja template processing (#25452)
268+
- Update core example DAGs to use ``@task.branch`` decorator (#25242)
269+
- Update DAG ``audit_log`` route (#25415)
270+
- Change stdout and stderr access mode to append in commands (#25253)
271+
- Remove ``getTasks`` from Grid view (#25359)
272+
- Improve taskflow type hints with ParamSpec (#25173)
273+
- Use tables in grid details panes (#25258)
274+
- Explicitly list ``@dag`` arguments (#25044)
275+
- More typing in ``SchedulerJob`` and ``TaskInstance`` (#24912)
276+
- Patch ``getfqdn`` with more resilient version (#24981)
277+
- Replace all ``NBSP`` characters by ``whitespaces`` (#24797)
278+
- Re-serialize all DAGs on ``airflow db upgrade`` (#24518)
279+
- Rework contract of try_adopt_task_instances method (#23188)
280+
- Make ``expand()`` error vague so it's not misleading (#24018)
281+
- Add enum validation for ``[webserver]analytics_tool`` (#24032)
282+
- Add ``dttm`` searchable field in audit log (#23794)
283+
- Allow more parameters to be piped through via ``execute_in_subprocess`` (#23286)
284+
- Use ``func.count`` to count rows (#23657)
285+
- Remove stale serialized dags (#22917)
286+
- AIP45 Remove dag parsing in airflow run local (#21877)
287+
- Add support for queued state in DagRun update endpoint. (#23481)
288+
- Add fields to dagrun endpoint (#23440)
289+
- Use ``sql_alchemy_conn`` for celery result backend when ``result_backend`` is not set (#24496)
155290

156291
Bug Fixes
157292
^^^^^^^^^
158293

159-
- ``ExternalTaskSensor`` now supports the ``soft_fail`` flag to skip if external task or DAG enters a failed state. (#23647)
294+
- Have consistent types between the ORM and the migration files (#24044, #25869)
295+
- Disallow any dag tags longer than 100 char (#25196)
296+
- Add the dag_id to ``AirflowDagCycleException`` message (#26204)
297+
- Properly build URL to retrieve logs independently from system (#26337)
298+
- For worker log servers only bind to IPV6 when dual stack is available (#26222)
299+
- Fix ``TaskInstance.task`` not defined before ``handle_failure`` (#26040)
300+
- Undo secrets backend config caching (#26223)
301+
- Fix faulty executor config serialization logic (#26191)
302+
- Show ``DAGs`` and ``Datasets`` menu links based on role permission (#26183)
303+
- Allow setting ``TaskGroup`` tooltip via function docstring (#26028)
304+
- Fix RecursionError on graph view of a DAG with many tasks (#26175)
305+
- Fix backfill occasional deadlocking (#26161)
306+
- Fix ``DagRun.start_date`` not set during backfill with ``--reset-dagruns`` True (#26135)
307+
- Use label instead of id for dynamic task labels in graph (#26108)
308+
- Don't fail DagRun when leaf ``mapped_task`` is SKIPPED (#25995)
309+
- Add group prefix to decorated mapped task (#26081)
310+
- Fix UI flash when triggering with dup logical date (#26094)
311+
- Fix Make items nullable for ``TaskInstance`` related endpoints to avoid API errors (#26076)
312+
- Fix ``BranchDateTimeOperator`` to be ``timezone-awreness-insensitive`` (#25944)
313+
- Fix legacy timetable schedule interval params (#25999)
314+
- Fix response schema for ``list-mapped-task-instance`` (#25965)
315+
- Properly check the existence of missing mapped TIs (#25788)
316+
- Fix broken auto-refresh on grid view (#25950)
317+
- Use per-timetable ordering in grid UI (#25880)
318+
- Rewrite recursion when parsing DAG into iteration (#25898)
319+
- Find cross-group tasks in ``iter_mapped_dependants`` (#25793)
320+
- Fail task if mapping upstream fails (#25757)
321+
- Support ``/`` in variable get endpoint (#25774)
322+
- Use cfg default_wrap value for grid logs (#25731)
323+
- Add origin request args when triggering a run (#25729)
324+
- Operator name separate from class (#22834)
325+
- Fix incorrect data interval alignment due to assumption on input time alignment (#22658)
326+
- Return None if an ``XComArg`` fails to resolve (#25661)
327+
- Correct ``json`` arg help in ``airflow variables set`` command (#25726)
328+
- Added MySQL index hint to use ``ti_state`` on ``find_zombies`` query (#25725)
329+
- Only excluded actually expanded fields from render (#25599)
330+
- Grid, fix toast for ``axios`` errors (#25703)
331+
- Fix UI redirect (#26409)
332+
- Require dag_id arg for dags list-runs (#26357)
333+
- Check for queued states for dags auto-refresh (#25695)
334+
- Fix upgrade code for the ``dag_owner_attributes`` table (#25579)
335+
- Add map index to task logs api (#25568)
336+
- Ensure that zombie tasks for dags with errors get cleaned up (#25550)
337+
- Make extra link work in UI (#25500)
338+
- Sync up plugin API schema and definition (#25524)
339+
- First/last names can be empty (#25476)
340+
- Refactor DAG pages to be consistent (#25402)
341+
- Check ``expand_kwargs()`` input type before unmapping (#25355)
342+
- Filter XCOM by key when calculating map lengths (#24530)
343+
- Fix ``ExternalTaskSensor`` not working with dynamic task (#25215)
344+
- Added exception catching to send default email if template file raises any exception (#24943)
345+
- Bring ``MappedOperator`` members in sync with ``BaseOperator`` (#24034)
346+
347+
348+
Misc/Internal
349+
^^^^^^^^^^^^^
350+
351+
- Add automatically generated ``ERD`` schema for the ``MetaData`` DB (#26217)
352+
- Mark serialization functions as internal (#26193)
353+
- Remove remaining deprecated classes and replace them with ``PEP562`` (#26167)
354+
- Move ``dag_edges`` and ``task_group_to_dict`` to corresponding util modules (#26212)
355+
- Lazily import many modules to improve import speed (#24486, #26239)
356+
- FIX Incorrect typing information (#26077)
357+
- Add missing contrib classes to deprecated dictionaries (#26179)
358+
- Re-configure/connect the ``ORM`` after forking to run a DAG processor (#26216)
359+
- Remove cattrs from lineage processing. (#26134)
360+
- Removed deprecated contrib files and replace them with ``PEP-562`` getattr (#26153)
361+
- Make ``BaseSerialization.serialize`` "public" to other classes. (#26142)
362+
- Change the template to use human readable task_instance description (#25960)
363+
- Bump ``moment-timezone`` from ``0.5.34`` to ``0.5.35`` in ``/airflow/www`` (#26080)
364+
- Fix Flask deprecation warning (#25753)
365+
- Add ``CamelCase`` to generated operations types (#25887)
366+
- Fix migration issues and tighten the CI upgrade/downgrade test (#25869)
367+
- Fix type annotations in ``SkipMixin`` (#25864)
368+
- Workaround setuptools editable packages path issue (#25848)
369+
- Bump ``undici`` from ``5.8.0 to 5.9.1`` in /airflow/www (#25801)
370+
- Add custom_operator_name attr to ``_BranchPythonDecoratedOperator`` (#25783)
371+
- Clarify ``filename_template`` deprecation message (#25749)
372+
- Use ``ParamSpec`` to replace ``...`` in Callable (#25658)
373+
- Remove deprecated modules (#25543)
374+
- Documentation on task mapping additions (#24489)
375+
- Remove Smart Sensors (#25507)
376+
- Fix ``elasticsearch`` test config to avoid warning on deprecated template (#25520)
377+
- Bump ``terser`` from ``4.8.0 to 4.8.1`` in /airflow/ui (#25178)
378+
- Generate ``typescript`` types from rest ``API`` docs (#25123)
379+
- Upgrade utils files to ``typescript`` (#25089)
380+
- Upgrade remaining context file to ``typescript``. (#25096)
381+
- Migrate files to ``ts`` (#25267)
382+
- Upgrade grid Table component to ``ts.`` (#25074)
383+
- Skip mapping against mapped ``ti`` if it returns None (#25047)
384+
- Refactor ``js`` file structure (#25003)
385+
- Move mapped kwargs introspection to separate type (#24971)
386+
- Only assert stuff for mypy when type checking (#24937)
387+
- Bump ``moment`` from ``2.29.3 to 2.29.4`` in ``/airflow/www`` (#24885)
388+
- Remove "bad characters" from our codebase (#24841)
389+
- Remove ``xcom_push`` flag from ``BashOperator`` (#24824)
390+
- Move Flask hook registration to end of file (#24776)
391+
- Upgrade more javascript files to ``typescript`` (#24715)
392+
- Clean up task decorator type hints and docstrings (#24667)
393+
- Preserve original order of providers' connection extra fields in UI (#24425)
394+
- Rename ``charts.css`` to ``chart.css`` (#24531)
395+
- Rename ``grid.css`` to ``chart.css`` (#24529)
396+
- Misc: create new process group by ``set_new_process_group`` utility (#24371)
397+
- Airflow UI fix Prototype Pollution (#24201)
398+
- Bump ``moto`` version (#24222)
399+
- Remove unused ``[github_enterprise]`` from ref docs (#24033)
400+
- Clean up ``f-strings`` in logging calls (#23597)
401+
- Add limit for ``JPype1`` (#23847)
402+
- Simply json responses (#25518)
403+
- Add min attrs version (#26408)
404+
405+
Doc only changes
406+
^^^^^^^^^^^^^^^^
407+
- Add url prefix setting for ``Celery`` Flower (#25986)
408+
- Updating deprecated configuration in examples (#26037)
409+
- Fix wrong link for taskflow tutorial (#26007)
410+
- Reorganize tutorials into a section (#25890)
411+
- Fix concept doc for dynamic task map (#26002)
412+
- Update code examples from "classic" operators to taskflow (#25845, #25657)
413+
- Add instructions on manually fixing ``MySQL`` Charset problems (#25938)
414+
- Prefer the local Quick Start in docs (#25888)
415+
- Fix broken link to ``Trigger Rules`` (#25840)
416+
- Improve docker documentation (#25735)
417+
- Correctly link to Dag parsing context in docs (#25722)
418+
- Add note on ``task_instance_mutation_hook`` usage (#25607)
419+
- Note that TaskFlow API automatically passes data between tasks (#25577)
420+
- Update DAG run to clarify when a DAG actually runs (#25290)
421+
- Update tutorial docs to include a definition of operators (#25012)
422+
- Rewrite the Airflow documentation home page (#24795)
423+
- Fix ``task-generated mapping`` example (#23424)
424+
- Add note on subtle logical date change in ``2.2.0`` (#24413)
425+
- Add missing import in best-practices code example (#25391)
426+
160427

161428

162429
Airflow 2.3.4 (2022-08-23)

scripts/ci/pre_commit/pre_commit_version_heads_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def read_current_airflow_version():
6060
if airflow_version.is_devrelease or 'b' in (airflow_version.pre or ()):
6161
exit(0)
6262
versions = read_revision_heads_map()
63-
if airflow_version not in versions:
63+
if airflow_version.base_version not in versions:
6464
print("Current airflow version is not in the REVISION_HEADS_MAP")
6565
print("Current airflow version:", airflow_version)
6666
print("Please add the version to the REVISION_HEADS_MAP at:", DB_FILE)

0 commit comments

Comments
 (0)