You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2022/10/18 20:04:28 UTC
[airflow] branch v2-4-test updated (6479853fb0 -> 9765fde834)
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a change to branch v2-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
from 6479853fb0 Update message with new breeze subcommand (#26817)
new b8e4fa40c8 Add missing AUTOINC/SERIAL for FAB tables (#26885)
new 185c6ac3ad Fix migration issue in upgrade using `type_` instead of `server_default` (#27009)
new 2d92daa818 Make tracebacks opt-in (#27059)
new dcf70d8c91 Update version to 2.4.2
new 9765fde834 Update Release Note
The 5 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:
README.md | 14 ++--
RELEASE_NOTES.rst | 59 ++++++++++++++++
airflow/config_templates/config.yml | 2 +-
airflow/config_templates/default_airflow.cfg | 2 +-
airflow/migrations/env.py | 8 ++-
.../versions/0118_2_4_2_add_missing_autoinc_fab.py | 78 ++++++++++++++++++++++
airflow/settings.py | 15 +++--
airflow/utils/db.py | 18 ++++-
docs/apache-airflow/img/airflow_erd.sha256 | 2 +-
.../installation/supported-versions.rst | 2 +-
docs/apache-airflow/migrations-ref.rst | 4 +-
docs/docker-stack/README.md | 10 +--
.../extending/add-apt-packages/Dockerfile | 2 +-
.../add-build-essential-extend/Dockerfile | 2 +-
.../extending/add-providers/Dockerfile | 2 +-
.../extending/add-pypi-packages/Dockerfile | 2 +-
.../extending/add-requirement-packages/Dockerfile | 2 +-
.../extending/custom-providers/Dockerfile | 2 +-
.../extending/embedding-dags/Dockerfile | 2 +-
.../extending/writable-directory/Dockerfile | 2 +-
docs/docker-stack/entrypoint.rst | 14 ++--
.../ci/pre_commit/pre_commit_supported_versions.py | 2 +-
setup.py | 2 +-
23 files changed, 205 insertions(+), 43 deletions(-)
create mode 100644 airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py
[airflow] 04/05: Update version to 2.4.2
Posted by ep...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit dcf70d8c9190e2bb8f84b4a1139672a3d3c51668
Author: Ephraim Anierobi <sp...@gmail.com>
AuthorDate: Tue Oct 18 20:18:54 2022 +0100
Update version to 2.4.2
---
README.md | 14 +++++++-------
airflow/utils/db.py | 1 +
docs/apache-airflow/installation/supported-versions.rst | 2 +-
docs/docker-stack/README.md | 10 +++++-----
.../docker-examples/extending/add-apt-packages/Dockerfile | 2 +-
.../extending/add-build-essential-extend/Dockerfile | 2 +-
.../docker-examples/extending/add-providers/Dockerfile | 2 +-
.../docker-examples/extending/add-pypi-packages/Dockerfile | 2 +-
.../extending/add-requirement-packages/Dockerfile | 2 +-
.../docker-examples/extending/custom-providers/Dockerfile | 2 +-
.../docker-examples/extending/embedding-dags/Dockerfile | 2 +-
.../extending/writable-directory/Dockerfile | 2 +-
docs/docker-stack/entrypoint.rst | 14 +++++++-------
scripts/ci/pre_commit/pre_commit_supported_versions.py | 2 +-
setup.py | 2 +-
15 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/README.md b/README.md
index 6aae88f55f..a2bfe6bd00 100644
--- a/README.md
+++ b/README.md
@@ -85,7 +85,7 @@ Airflow is not a streaming solution, but it is often used to process real-time d
Apache Airflow is tested with:
-| | Main version (dev) | Stable version (2.4.1) |
+| | Main version (dev) | Stable version (2.4.2) |
|---------------------|------------------------------|------------------------------|
| Python | 3.7, 3.8, 3.9, 3.10 | 3.7, 3.8, 3.9, 3.10 |
| Platform | AMD64/ARM64(\*) | AMD64/ARM64(\*) |
@@ -158,15 +158,15 @@ them to the appropriate format and workflow that your tool requires.
```bash
-pip install 'apache-airflow==2.4.1' \
- --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.4.1/constraints-3.7.txt"
+pip install 'apache-airflow==2.4.2' \
+ --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.4.2/constraints-3.7.txt"
```
2. Installing with extras (i.e., postgres, google)
```bash
-pip install 'apache-airflow[postgres,google]==2.4.1' \
- --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.4.1/constraints-3.7.txt"
+pip install 'apache-airflow[postgres,google]==2.4.2' \
+ --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.4.2/constraints-3.7.txt"
```
For information on installing provider packages, check
@@ -271,7 +271,7 @@ Apache Airflow version life cycle:
| Version | Current Patch/Minor | State | First Release | Limited Support | EOL/Terminated |
|-----------|-----------------------|-----------|-----------------|-------------------|------------------|
-| 2 | 2.4.1 | Supported | Dec 17, 2020 | TBD | TBD |
+| 2 | 2.4.2 | Supported | Dec 17, 2020 | TBD | TBD |
| 1.10 | 1.10.15 | EOL | Aug 27, 2018 | Dec 17, 2020 | June 17, 2021 |
| 1.9 | 1.9.0 | EOL | Jan 03, 2018 | Aug 27, 2018 | Aug 27, 2018 |
| 1.8 | 1.8.2 | EOL | Mar 19, 2017 | Jan 03, 2018 | Jan 03, 2018 |
@@ -301,7 +301,7 @@ They are based on the official release schedule of Python and Kubernetes, nicely
2. The "oldest" supported version of Python/Kubernetes is the default one until we decide to switch to
later version. "Default" is only meaningful in terms of "smoke tests" in CI PRs, which are run using this
default version and the default reference image available. Currently `apache/airflow:latest`
- and `apache/airflow:2.4.1` images are Python 3.7 images. This means that default reference image will
+ and `apache/airflow:2.4.2` images are Python 3.7 images. This means that default reference image will
become the default at the time when we start preparing for dropping 3.7 support which is few months
before the end of life for Python 3.7.
diff --git a/airflow/utils/db.py b/airflow/utils/db.py
index e9a5c8f0bb..08066a59f7 100644
--- a/airflow/utils/db.py
+++ b/airflow/utils/db.py
@@ -73,6 +73,7 @@ REVISION_HEADS_MAP = {
"2.3.4": "f5fcbda3e651",
"2.4.0": "ecb43d2a1842",
"2.4.1": "ecb43d2a1842",
+ "2.4.2": "b0d31815b5a6",
}
diff --git a/docs/apache-airflow/installation/supported-versions.rst b/docs/apache-airflow/installation/supported-versions.rst
index 85054643e0..98da679914 100644
--- a/docs/apache-airflow/installation/supported-versions.rst
+++ b/docs/apache-airflow/installation/supported-versions.rst
@@ -29,7 +29,7 @@ Apache Airflow version life cycle:
========= ===================== ========= =============== ================= ================
Version Current Patch/Minor State First Release Limited Support EOL/Terminated
========= ===================== ========= =============== ================= ================
-2 2.4.1 Supported Dec 17, 2020 TBD TBD
+2 2.4.2 Supported Dec 17, 2020 TBD TBD
1.10 1.10.15 EOL Aug 27, 2018 Dec 17, 2020 June 17, 2021
1.9 1.9.0 EOL Jan 03, 2018 Aug 27, 2018 Aug 27, 2018
1.8 1.8.2 EOL Mar 19, 2017 Jan 03, 2018 Jan 03, 2018
diff --git a/docs/docker-stack/README.md b/docs/docker-stack/README.md
index 18375adc2d..02118bd63b 100644
--- a/docs/docker-stack/README.md
+++ b/docs/docker-stack/README.md
@@ -31,12 +31,12 @@ Every time a new version of Airflow is released, the images are prepared in the
[apache/airflow DockerHub](https://hub.docker.com/r/apache/airflow)
for all the supported Python versions.
-You can find the following images there (Assuming Airflow version `2.4.1`):
+You can find the following images there (Assuming Airflow version `2.4.2`):
* `apache/airflow:latest` - the latest released Airflow image with default Python version (3.7 currently)
* `apache/airflow:latest-pythonX.Y` - the latest released Airflow image with specific Python version
-* `apache/airflow:2.4.1` - the versioned Airflow image with default Python version (3.7 currently)
-* `apache/airflow:2.4.1-pythonX.Y` - the versioned Airflow image with specific Python version
+* `apache/airflow:2.4.2` - the versioned Airflow image with default Python version (3.7 currently)
+* `apache/airflow:2.4.2-pythonX.Y` - the versioned Airflow image with specific Python version
Those are "reference" regular images. They contain the most common set of extras, dependencies and providers that are
often used by the users and they are good to "try-things-out" when you want to just take Airflow for a spin,
@@ -47,8 +47,8 @@ via [Building the image](https://airflow.apache.org/docs/docker-stack/build.html
* `apache/airflow:slim-latest` - the latest released Airflow image with default Python version (3.7 currently)
* `apache/airflow:slim-latest-pythonX.Y` - the latest released Airflow image with specific Python version
-* `apache/airflow:slim-2.4.1` - the versioned Airflow image with default Python version (3.7 currently)
-* `apache/airflow:slim-2.4.1-pythonX.Y` - the versioned Airflow image with specific Python version
+* `apache/airflow:slim-2.4.2` - the versioned Airflow image with default Python version (3.7 currently)
+* `apache/airflow:slim-2.4.2-pythonX.Y` - the versioned Airflow image with specific Python version
The Apache Airflow image provided as convenience package is optimized for size, and
it provides just a bare minimal set of the extras and dependencies installed and in most cases
diff --git a/docs/docker-stack/docker-examples/extending/add-apt-packages/Dockerfile b/docs/docker-stack/docker-examples/extending/add-apt-packages/Dockerfile
index 356933da00..f7e4fa667e 100644
--- a/docs/docker-stack/docker-examples/extending/add-apt-packages/Dockerfile
+++ b/docs/docker-stack/docker-examples/extending/add-apt-packages/Dockerfile
@@ -15,7 +15,7 @@
# This is an example Dockerfile. It is not intended for PRODUCTION use
# [START Dockerfile]
-FROM apache/airflow:2.4.1
+FROM apache/airflow:2.4.2
USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
diff --git a/docs/docker-stack/docker-examples/extending/add-build-essential-extend/Dockerfile b/docs/docker-stack/docker-examples/extending/add-build-essential-extend/Dockerfile
index 86bbd4e51e..86d6a14def 100644
--- a/docs/docker-stack/docker-examples/extending/add-build-essential-extend/Dockerfile
+++ b/docs/docker-stack/docker-examples/extending/add-build-essential-extend/Dockerfile
@@ -15,7 +15,7 @@
# This is an example Dockerfile. It is not intended for PRODUCTION use
# [START Dockerfile]
-FROM apache/airflow:2.4.1
+FROM apache/airflow:2.4.2
USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
diff --git a/docs/docker-stack/docker-examples/extending/add-providers/Dockerfile b/docs/docker-stack/docker-examples/extending/add-providers/Dockerfile
index 2036c6d560..0fc059cfb6 100644
--- a/docs/docker-stack/docker-examples/extending/add-providers/Dockerfile
+++ b/docs/docker-stack/docker-examples/extending/add-providers/Dockerfile
@@ -15,7 +15,7 @@
# This is an example Dockerfile. It is not intended for PRODUCTION use
# [START Dockerfile]
-FROM apache/airflow:2.4.1
+FROM apache/airflow:2.4.2
USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
diff --git a/docs/docker-stack/docker-examples/extending/add-pypi-packages/Dockerfile b/docs/docker-stack/docker-examples/extending/add-pypi-packages/Dockerfile
index 95479f1f58..f6b2f7c220 100644
--- a/docs/docker-stack/docker-examples/extending/add-pypi-packages/Dockerfile
+++ b/docs/docker-stack/docker-examples/extending/add-pypi-packages/Dockerfile
@@ -15,6 +15,6 @@
# This is an example Dockerfile. It is not intended for PRODUCTION use
# [START Dockerfile]
-FROM apache/airflow:2.4.1
+FROM apache/airflow:2.4.2
RUN pip install --no-cache-dir lxml
# [END Dockerfile]
diff --git a/docs/docker-stack/docker-examples/extending/add-requirement-packages/Dockerfile b/docs/docker-stack/docker-examples/extending/add-requirement-packages/Dockerfile
index b01ea353fb..bac10687b0 100644
--- a/docs/docker-stack/docker-examples/extending/add-requirement-packages/Dockerfile
+++ b/docs/docker-stack/docker-examples/extending/add-requirement-packages/Dockerfile
@@ -15,7 +15,7 @@
# This is an example Dockerfile. It is not intended for PRODUCTION use
# [START Dockerfile]
-FROM apache/airflow:2.4.1
+FROM apache/airflow:2.4.2
COPY requirements.txt /
RUN pip install --no-cache-dir -r /requirements.txt
# [END Dockerfile]
diff --git a/docs/docker-stack/docker-examples/extending/custom-providers/Dockerfile b/docs/docker-stack/docker-examples/extending/custom-providers/Dockerfile
index c96a19dcfb..1e32be7b9d 100644
--- a/docs/docker-stack/docker-examples/extending/custom-providers/Dockerfile
+++ b/docs/docker-stack/docker-examples/extending/custom-providers/Dockerfile
@@ -15,6 +15,6 @@
# This is an example Dockerfile. It is not intended for PRODUCTION use
# [START Dockerfile]
-FROM apache/airflow:2.4.1
+FROM apache/airflow:2.4.2
RUN pip install --no-cache-dir apache-airflow-providers-docker==2.5.1
# [END Dockerfile]
diff --git a/docs/docker-stack/docker-examples/extending/embedding-dags/Dockerfile b/docs/docker-stack/docker-examples/extending/embedding-dags/Dockerfile
index d07447c8be..b073eee633 100644
--- a/docs/docker-stack/docker-examples/extending/embedding-dags/Dockerfile
+++ b/docs/docker-stack/docker-examples/extending/embedding-dags/Dockerfile
@@ -15,7 +15,7 @@
# This is an example Dockerfile. It is not intended for PRODUCTION use
# [START Dockerfile]
-FROM apache/airflow:2.4.1
+FROM apache/airflow:2.4.2
COPY --chown=airflow:root test_dag.py /opt/airflow/dags
diff --git a/docs/docker-stack/docker-examples/extending/writable-directory/Dockerfile b/docs/docker-stack/docker-examples/extending/writable-directory/Dockerfile
index 4ddbc8049a..571041d39c 100644
--- a/docs/docker-stack/docker-examples/extending/writable-directory/Dockerfile
+++ b/docs/docker-stack/docker-examples/extending/writable-directory/Dockerfile
@@ -15,7 +15,7 @@
# This is an example Dockerfile. It is not intended for PRODUCTION use
# [START Dockerfile]
-FROM apache/airflow:2.4.1
+FROM apache/airflow:2.4.2
RUN umask 0002; \
mkdir -p ~/writeable-directory
# [END Dockerfile]
diff --git a/docs/docker-stack/entrypoint.rst b/docs/docker-stack/entrypoint.rst
index d01dbdcebd..9c21b72702 100644
--- a/docs/docker-stack/entrypoint.rst
+++ b/docs/docker-stack/entrypoint.rst
@@ -132,7 +132,7 @@ if you specify extra arguments. For example:
.. code-block:: bash
- docker run -it apache/airflow:2.4.1-python3.6 bash -c "ls -la"
+ docker run -it apache/airflow:2.4.2-python3.6 bash -c "ls -la"
total 16
drwxr-xr-x 4 airflow root 4096 Jun 5 18:12 .
drwxr-xr-x 1 root root 4096 Jun 5 18:12 ..
@@ -144,7 +144,7 @@ you pass extra parameters. For example:
.. code-block:: bash
- > docker run -it apache/airflow:2.4.1-python3.6 python -c "print('test')"
+ > docker run -it apache/airflow:2.4.2-python3.6 python -c "print('test')"
test
If first argument equals to "airflow" - the rest of the arguments is treated as an airflow command
@@ -152,13 +152,13 @@ to execute. Example:
.. code-block:: bash
- docker run -it apache/airflow:2.4.1-python3.6 airflow webserver
+ docker run -it apache/airflow:2.4.2-python3.6 airflow webserver
If there are any other arguments - they are simply passed to the "airflow" command
.. code-block:: bash
- > docker run -it apache/airflow:2.4.1-python3.6 help
+ > docker run -it apache/airflow:2.4.2-python3.6 help
usage: airflow [-h] GROUP_OR_COMMAND ...
positional arguments:
@@ -363,7 +363,7 @@ database and creating an ``admin/admin`` Admin user with the following command:
--env "_AIRFLOW_DB_UPGRADE=true" \
--env "_AIRFLOW_WWW_USER_CREATE=true" \
--env "_AIRFLOW_WWW_USER_PASSWORD=admin" \
- apache/airflow:2.4.1-python3.8 webserver
+ apache/airflow:2.4.2-python3.8 webserver
.. code-block:: bash
@@ -372,7 +372,7 @@ database and creating an ``admin/admin`` Admin user with the following command:
--env "_AIRFLOW_DB_UPGRADE=true" \
--env "_AIRFLOW_WWW_USER_CREATE=true" \
--env "_AIRFLOW_WWW_USER_PASSWORD_CMD=echo admin" \
- apache/airflow:2.4.1-python3.8 webserver
+ apache/airflow:2.4.2-python3.8 webserver
The commands above perform initialization of the SQLite database, create admin user with admin password
and Admin role. They also forward local port ``8080`` to the webserver port and finally start the webserver.
@@ -412,6 +412,6 @@ Example:
--env "_AIRFLOW_DB_UPGRADE=true" \
--env "_AIRFLOW_WWW_USER_CREATE=true" \
--env "_AIRFLOW_WWW_USER_PASSWORD_CMD=echo admin" \
- apache/airflow:2.4.1-python3.8 webserver
+ apache/airflow:2.4.2-python3.8 webserver
This method is only available starting from Docker image of Airflow 2.1.1 and above.
diff --git a/scripts/ci/pre_commit/pre_commit_supported_versions.py b/scripts/ci/pre_commit/pre_commit_supported_versions.py
index df47dcbc1e..cfaef5dcb6 100755
--- a/scripts/ci/pre_commit/pre_commit_supported_versions.py
+++ b/scripts/ci/pre_commit/pre_commit_supported_versions.py
@@ -27,7 +27,7 @@ AIRFLOW_SOURCES = Path(__file__).resolve().parent.parent.parent.parent
HEADERS = ("Version", "Current Patch/Minor", "State", "First Release", "Limited Support", "EOL/Terminated")
SUPPORTED_VERSIONS = (
- ("2", "2.4.1", "Supported", "Dec 17, 2020", "TBD", "TBD"),
+ ("2", "2.4.2", "Supported", "Dec 17, 2020", "TBD", "TBD"),
("1.10", "1.10.15", "EOL", "Aug 27, 2018", "Dec 17, 2020", "June 17, 2021"),
("1.9", "1.9.0", "EOL", "Jan 03, 2018", "Aug 27, 2018", "Aug 27, 2018"),
("1.8", "1.8.2", "EOL", "Mar 19, 2017", "Jan 03, 2018", "Jan 03, 2018"),
diff --git a/setup.py b/setup.py
index 71db6f7796..d1eea7e550 100644
--- a/setup.py
+++ b/setup.py
@@ -49,7 +49,7 @@ PY39 = sys.version_info >= (3, 9)
logger = logging.getLogger(__name__)
-version = '2.4.1'
+version = '2.4.2'
AIRFLOW_SOURCES_ROOT = Path(__file__).parent.resolve()
PROVIDERS_ROOT = AIRFLOW_SOURCES_ROOT / "airflow" / "providers"
[airflow] 05/05: Update Release Note
Posted by ep...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 9765fde834ebc5db43eab8ebac52594b24b57617
Author: Ephraim Anierobi <sp...@gmail.com>
AuthorDate: Tue Oct 18 21:00:19 2022 +0100
Update Release Note
---
RELEASE_NOTES.rst | 59 +++++++++++++++++++++++++++++++++++++++
newsfragments/000.significant.rst | 3 --
2 files changed, 59 insertions(+), 3 deletions(-)
diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst
index 366b2edeea..b04cb5517c 100644
--- a/RELEASE_NOTES.rst
+++ b/RELEASE_NOTES.rst
@@ -21,6 +21,65 @@
.. towncrier release notes start
+Airflow 2.4.2 (2022-10-22)
+--------------------------
+
+Significant Changes
+^^^^^^^^^^^^^^^^^^^
+
+Default for ``[webserver] expose_stacktrace`` changed to ``False`` (#27059)
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+ The default for ``[webserver] expose_stacktrace`` has been set to ``False``, instead of ``True``. This means administrators must opt-in to expose tracebacks to end users.
+
+Bug Fixes
+^^^^^^^^^
+- Make tracebacks opt-in (#27059)
+- Add missing AUTOINC/SERIAL for FAB tables (#26885)
+- Add separate error handler for 405(Method not allowed) errors (#26880)
+- Don't re-patch pods that are already controlled by current worker (#26778)
+- Fix broken URL for ``docker-compose.yaml`` (#26726)
+- Handle mapped tasks in task duration chart (#26722)
+- Fix task duration cumulative chart (#26717)
+- Avoid 500 on dag redirect (#27064)
+- Filter dataset dependency data on webserver (#27046)
+- Remove double collection of dags in ``airflow dags reserialize`` (#27030)
+- Fix auto refresh for graph view (#26926)
+- fix next run dataset modal links (#26897)
+- Change dag audit log sort by date from asc to desc (#26895)
+- Bump min version of jinja2 (#26866)
+- Add missing colors to ``state_color_mapping`` jinja global (#26822)
+- Fix running debuggers inside ``airflow tasks test`` (#26806)
+- Fix warning when using xcomarg dependencies (#26801)
+- demote Removed state in priority for displaying task summaries (#26789)
+- Ensure the log messages from operators during parsing go somewhere (#26779)
+- Add restarting state to TaskState Enum in REST API (#26776)
+- Allow retrieving error message from data.detail (#26762)
+- Remove DAG parsing from StandardTaskRunner (#26750)
+- Fix non-hidden cumulative chart on duration view (#26716)
+- Remove TaskFail duplicates check (#26714)
+- Fix airflow tasks run --local when dags_folder differs from that of processor (#26509)
+- Fix version for a couple configurations (#26491)
+- Revert "No grid auto-refresh for backfill dag runs (#25042)" (#26463)
+- Retry on Airflow Schedule DAG Run DB Deadlock (#26347)
+
+Misc/Internal
+^^^^^^^^^^^^^
+- Clean-ups around task-mapping code (#26879)
+- Move user-facing string to template (#26815)
+- add icon legend to datasets graph (#26781)
+- Bump sphinx and sphinx-autoapi (#26743)
+- Simplify RTIF.delete_old_records() (#26667)
+- Bump FAB to ``4.1.4`` (#26393)
+
+Doc only changes
+^^^^^^^^^^^^^^^^
+- Fixed triple quotes in task group example (#26829)
+- Documentation fixes (#26819)
+- make consistency on markup title string level (#26696)
+- Add a note against use of top level code in timetable (#26649)
+
+
Airflow 2.4.1 (2022-09-30)
--------------------------
diff --git a/newsfragments/000.significant.rst b/newsfragments/000.significant.rst
deleted file mode 100644
index 2464344284..0000000000
--- a/newsfragments/000.significant.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Default for ``[webserver] expose_stacktrace`` changed to ``False``
-
-The default for ``[webserver] expose_stacktrace`` has been set to ``False``, instead of ``True``. This means administrators must opt-in to expose tracebacks to end users.
[airflow] 02/05: Fix migration issue in upgrade using `type_` instead of `server_default` (#27009)
Posted by ep...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 185c6ac3ad2e8d4841d561a9eb5b62c1294f83fb
Author: Ephraim Anierobi <sp...@gmail.com>
AuthorDate: Wed Oct 12 14:11:51 2022 +0100
Fix migration issue in upgrade using `type_` instead of `server_default` (#27009)
This was failing but was not noticed due to an issue with breeze.
We should use `server_default` instead of `type_` since `sequence` is the default when table is described.
The `type_` remains an integer with the added sequence
(cherry picked from commit 1d132d50ddf6025a37ab7c136b5ce430fad60660)
---
airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py | 2 +-
docs/apache-airflow/img/airflow_erd.sha256 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py b/airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py
index f6becd9dfe..69b0e231d1 100644
--- a/airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py
+++ b/airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py
@@ -67,7 +67,7 @@ def upgrade():
with op.batch_alter_table(table) as batch:
kwargs = {}
if conn.dialect.name == 'postgresql':
- kwargs['type_'] = sa.Sequence(f'{table}_id_seq').next_value()
+ kwargs['server_default'] = sa.Sequence(f'{table}_id_seq').next_value()
else:
kwargs['autoincrement'] = True
batch.alter_column("id", existing_type=sa.Integer(), existing_nullable=False, **kwargs)
diff --git a/docs/apache-airflow/img/airflow_erd.sha256 b/docs/apache-airflow/img/airflow_erd.sha256
index 1c82ebf2bf..da12a349e2 100644
--- a/docs/apache-airflow/img/airflow_erd.sha256
+++ b/docs/apache-airflow/img/airflow_erd.sha256
@@ -1 +1 @@
-030fee7fdf6b154b107a12331400a26843f4ebb4abaab84566aeca7c26d79450
\ No newline at end of file
+a522ff773bc6403318e4a15be19f25d48323208de3acc8a970f7f40ad4782563
\ No newline at end of file
[airflow] 01/05: Add missing AUTOINC/SERIAL for FAB tables (#26885)
Posted by ep...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit b8e4fa40c8d826d329902d18d7e26a91acb43ee8
Author: Ash Berlin-Taylor <as...@apache.org>
AuthorDate: Fri Oct 7 17:37:55 2022 +0100
Add missing AUTOINC/SERIAL for FAB tables (#26885)
* Add missing AUTOINC/SERIAL for FAB tables
In 1.10.13 we introduced a migration that creates the tables with the
server_default but that migration only did anything if the tables didn't
already exist. But the tables created by the FAB model have a default
(but not a server_default).
Oh, and the final bit of the puzzle, in 2.4 we finally "took control" of
the FAB security models in to airflow and those do not have the default
set.
* Update airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py
* Fix static checks
* Run migrations with with a pool of a connection.
Without this `create_session()` will open a new connection, and that causes mysql
to hang waiting to get a "metadata lock on table".
Using the "stock" pool with size=1 and max_overflow=0 doesn't work, that
instead times out if you try to get a new connection from the pool.
SingletonThreadPool instead returns the existing active connection which
is what we want.
Co-authored-by: Tzu-ping Chung <ur...@gmail.com>
(cherry picked from commit 7efdeed5eccbf5cb709af40c8c66757e59c957ed)
---
airflow/migrations/env.py | 8 ++-
.../versions/0118_2_4_2_add_missing_autoinc_fab.py | 78 ++++++++++++++++++++++
airflow/settings.py | 15 +++--
airflow/utils/db.py | 17 ++++-
docs/apache-airflow/img/airflow_erd.sha256 | 2 +-
docs/apache-airflow/migrations-ref.rst | 4 +-
6 files changed, 113 insertions(+), 11 deletions(-)
diff --git a/airflow/migrations/env.py b/airflow/migrations/env.py
index 6474f0799c..9dcd29e9ca 100644
--- a/airflow/migrations/env.py
+++ b/airflow/migrations/env.py
@@ -17,6 +17,7 @@
# under the License.
from __future__ import annotations
+import contextlib
from logging.config import fileConfig
from alembic import context
@@ -89,9 +90,12 @@ def run_migrations_online():
and associate a connection with the context.
"""
- connectable = settings.engine
+ with contextlib.ExitStack() as stack:
+ connection = config.attributes.get('connection', None)
+
+ if not connection:
+ connection = stack.push(settings.engine.connect())
- with connectable.connect() as connection:
context.configure(
connection=connection,
transaction_per_migration=True,
diff --git a/airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py b/airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py
new file mode 100644
index 0000000000..f6becd9dfe
--- /dev/null
+++ b/airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py
@@ -0,0 +1,78 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Add missing auto-increment to columns on FAB tables
+
+Revision ID: b0d31815b5a6
+Revises: ecb43d2a1842
+Create Date: 2022-10-05 13:16:45.638490
+
+"""
+
+from __future__ import annotations
+
+import sqlalchemy as sa
+from alembic import op
+
+# revision identifiers, used by Alembic.
+revision = 'b0d31815b5a6'
+down_revision = 'ecb43d2a1842'
+branch_labels = None
+depends_on = None
+airflow_version = '2.4.2'
+
+
+def upgrade():
+ """Apply migration.
+
+ If these columns are already of the right type (i.e. created by our
+ migration in 1.10.13 rather than FAB itself in an earlier version), this
+ migration will issue an alter statement to change them to what they already
+ are -- i.e. its a no-op.
+
+ These tables are small (100 to low 1k rows at most), so it's not too costly
+ to change them.
+ """
+ conn = op.get_bind()
+ if conn.dialect.name in ['mssql', 'sqlite']:
+ # 1.10.12 didn't support SQL Server, so it couldn't have gotten this wrong --> nothing to correct
+ # SQLite autoinc was "implicit" for an INTEGER NOT NULL PRIMARY KEY
+ return
+
+ for table in (
+ 'ab_permission',
+ 'ab_view_menu',
+ 'ab_role',
+ 'ab_permission_view',
+ 'ab_permission_view_role',
+ 'ab_user',
+ 'ab_user_role',
+ 'ab_register_user',
+ ):
+ with op.batch_alter_table(table) as batch:
+ kwargs = {}
+ if conn.dialect.name == 'postgresql':
+ kwargs['type_'] = sa.Sequence(f'{table}_id_seq').next_value()
+ else:
+ kwargs['autoincrement'] = True
+ batch.alter_column("id", existing_type=sa.Integer(), existing_nullable=False, **kwargs)
+
+
+def downgrade():
+ """Unapply add_missing_autoinc_fab"""
+ # No downgrade needed, these _should_ have applied from 1.10.13 but didn't due to a previous bug!
diff --git a/airflow/settings.py b/airflow/settings.py
index 10e963d5f7..696b4b652a 100644
--- a/airflow/settings.py
+++ b/airflow/settings.py
@@ -259,14 +259,14 @@ def configure_vars():
DONOT_MODIFY_HANDLERS = conf.getboolean('logging', 'donot_modify_handlers', fallback=False)
-def configure_orm(disable_connection_pool=False):
+def configure_orm(disable_connection_pool=False, pool_class=None):
"""Configure ORM using SQLAlchemy"""
from airflow.utils.log.secrets_masker import mask_secret
log.debug("Setting up DB connection pool (PID %s)", os.getpid())
global engine
global Session
- engine_args = prepare_engine_args(disable_connection_pool)
+ engine_args = prepare_engine_args(disable_connection_pool, pool_class)
if conf.has_option('database', 'sql_alchemy_connect_args'):
connect_args = conf.getimport('database', 'sql_alchemy_connect_args')
@@ -319,7 +319,7 @@ DEFAULT_ENGINE_ARGS = {
}
-def prepare_engine_args(disable_connection_pool=False):
+def prepare_engine_args(disable_connection_pool=False, pool_class=None):
"""Prepare SQLAlchemy engine args"""
default_args = {}
for dialect, default in DEFAULT_ENGINE_ARGS.items():
@@ -331,7 +331,10 @@ def prepare_engine_args(disable_connection_pool=False):
'database', 'sql_alchemy_engine_args', fallback=default_args
) # type: ignore
- if disable_connection_pool or not conf.getboolean('database', 'SQL_ALCHEMY_POOL_ENABLED'):
+ if pool_class:
+ # Don't use separate settings for size etc, only those from sql_alchemy_engine_args
+ engine_args['poolclass'] = pool_class
+ elif disable_connection_pool or not conf.getboolean('database', 'SQL_ALCHEMY_POOL_ENABLED'):
engine_args['poolclass'] = NullPool
log.debug("settings.prepare_engine_args(): Using NullPool")
elif not SQL_ALCHEMY_CONN.startswith('sqlite'):
@@ -413,10 +416,10 @@ def dispose_orm():
engine = None
-def reconfigure_orm(disable_connection_pool=False):
+def reconfigure_orm(disable_connection_pool=False, pool_class=None):
"""Properly close database connections and re-configure ORM"""
dispose_orm()
- configure_orm(disable_connection_pool=disable_connection_pool)
+ configure_orm(disable_connection_pool=disable_connection_pool, pool_class=pool_class)
def configure_adapters():
diff --git a/airflow/utils/db.py b/airflow/utils/db.py
index b2ff28f68a..e9a5c8f0bb 100644
--- a/airflow/utils/db.py
+++ b/airflow/utils/db.py
@@ -1527,8 +1527,23 @@ def upgradedb(
initdb(session=session, load_connections=False)
return
with create_global_lock(session=session, lock=DBLocks.MIGRATIONS):
+ import sqlalchemy.pool
+
log.info("Creating tables")
- command.upgrade(config, revision=to_revision or 'heads')
+ val = os.environ.get('AIRFLOW__DATABASE__SQL_ALCHEMY_MAX_SIZE')
+ try:
+ # Reconfigure the ORM ot use _EXACTLY_ one connection, otherwise some db engines hang forever
+ # trying to ALTER TABLEs
+ os.environ['AIRFLOW__DATABASE__SQL_ALCHEMY_MAX_SIZE'] = '1'
+ settings.reconfigure_orm(pool_class=sqlalchemy.pool.SingletonThreadPool)
+ command.upgrade(config, revision=to_revision or 'heads')
+ finally:
+ if val is None:
+ os.environ.pop('AIRFLOW__DATABASE__SQL_ALCHEMY_MAX_SIZE')
+ else:
+ os.environ['AIRFLOW__DATABASE__SQL_ALCHEMY_MAX_SIZE'] = val
+ settings.reconfigure_orm()
+
reserialize_dags(session=session)
add_default_pool_if_not_exists(session=session)
synchronize_log_template(session=session)
diff --git a/docs/apache-airflow/img/airflow_erd.sha256 b/docs/apache-airflow/img/airflow_erd.sha256
index d8d6035893..1c82ebf2bf 100644
--- a/docs/apache-airflow/img/airflow_erd.sha256
+++ b/docs/apache-airflow/img/airflow_erd.sha256
@@ -1 +1 @@
-543fe0db520047b59d9d036b17d54b07f1031a2b6ef1f46dcd2ae970f14ab0e6
\ No newline at end of file
+030fee7fdf6b154b107a12331400a26843f4ebb4abaab84566aeca7c26d79450
\ No newline at end of file
diff --git a/docs/apache-airflow/migrations-ref.rst b/docs/apache-airflow/migrations-ref.rst
index fa1606946f..0a42c7e5d3 100644
--- a/docs/apache-airflow/migrations-ref.rst
+++ b/docs/apache-airflow/migrations-ref.rst
@@ -39,7 +39,9 @@ Here's the list of all the Database Migrations that are executed via when you ru
+---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
| Revision ID | Revises ID | Airflow Version | Description |
+=================================+===================+===================+==============================================================+
-| ``ecb43d2a1842`` (head) | ``1486deb605b4`` | ``2.4.0`` | Add processor_subdir column to DagModel, SerializedDagModel |
+| ``b0d31815b5a6`` (head) | ``ecb43d2a1842`` | ``2.4.2`` | Add missing auto-increment to columns on FAB tables |
++---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
+| ``ecb43d2a1842`` | ``1486deb605b4`` | ``2.4.0`` | Add processor_subdir column to DagModel, SerializedDagModel |
| | | | and CallbackRequest tables. |
+---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
| ``1486deb605b4`` | ``f4ff391becb5`` | ``2.4.0`` | add dag_owner_attributes table |
[airflow] 03/05: Make tracebacks opt-in (#27059)
Posted by ep...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 2d92daa818d5eef8af94cf416ac4e924ed162ae0
Author: Jed Cunningham <66...@users.noreply.github.com>
AuthorDate: Fri Oct 14 12:34:31 2022 -0700
Make tracebacks opt-in (#27059)
Instead of showing tracebacks by default, make the end user opt-in instead.
(cherry picked from commit 4b113efef1b52e2e66bae08c29fa57ca2c171996)
---
airflow/config_templates/config.yml | 2 +-
airflow/config_templates/default_airflow.cfg | 2 +-
newsfragments/000.significant.rst | 3 +++
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/airflow/config_templates/config.yml b/airflow/config_templates/config.yml
index b20fea7ff2..9682a7f6d7 100644
--- a/airflow/config_templates/config.yml
+++ b/airflow/config_templates/config.yml
@@ -1232,7 +1232,7 @@
version_added: 1.10.8
type: string
example: ~
- default: "True"
+ default: "False"
- name: dag_default_view
description: |
Default DAG view. Valid values are: ``grid``, ``graph``, ``duration``, ``gantt``, ``landing_times``
diff --git a/airflow/config_templates/default_airflow.cfg b/airflow/config_templates/default_airflow.cfg
index 174f33dbc8..38771381f2 100644
--- a/airflow/config_templates/default_airflow.cfg
+++ b/airflow/config_templates/default_airflow.cfg
@@ -631,7 +631,7 @@ expose_config = False
expose_hostname = True
# Expose stacktrace in the web server
-expose_stacktrace = True
+expose_stacktrace = False
# Default DAG view. Valid values are: ``grid``, ``graph``, ``duration``, ``gantt``, ``landing_times``
dag_default_view = grid
diff --git a/newsfragments/000.significant.rst b/newsfragments/000.significant.rst
new file mode 100644
index 0000000000..2464344284
--- /dev/null
+++ b/newsfragments/000.significant.rst
@@ -0,0 +1,3 @@
+Default for ``[webserver] expose_stacktrace`` changed to ``False``
+
+The default for ``[webserver] expose_stacktrace`` has been set to ``False``, instead of ``True``. This means administrators must opt-in to expose tracebacks to end users.