Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ jobs:
PYTHON_MAJOR_MINOR_VERSION: ${{ matrix.python-version }}
DEFAULT_BRANCH: ${{ inputs.branch }}
DEFAULT_CONSTRAINTS_BRANCH: ${{ inputs.constraints-branch }}
VERSION_SUFFIX_FOR_PYPI: "dev0"
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
Expand Down
41 changes: 20 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -466,26 +466,26 @@ jobs:
debug-resources: ${{ needs.build-info.outputs.debug-resources }}
use-uv: ${{ needs.build-info.outputs.use-uv }}

tests-integration-system:
name: Integration and System Tests
needs: [build-info, build-ci-images]
uses: ./.github/workflows/integration-system-tests.yml
permissions:
contents: read
packages: read
with:
runs-on-as-json-public: ${{ needs.build-info.outputs.runs-on-as-json-public }}
testable-core-integrations: ${{ needs.build-info.outputs.testable-core-integrations }}
testable-providers-integrations: ${{ needs.build-info.outputs.testable-providers-integrations }}
run-system-tests: ${{ needs.build-info.outputs.run-tests }}
default-python-version: ${{ needs.build-info.outputs.default-python-version }}
default-postgres-version: ${{ needs.build-info.outputs.default-postgres-version }}
default-mysql-version: ${{ needs.build-info.outputs.default-mysql-version }}
skip-providers-tests: ${{ needs.build-info.outputs.skip-providers-tests }}
run-coverage: ${{ needs.build-info.outputs.run-coverage }}
debug-resources: ${{ needs.build-info.outputs.debug-resources }}
use-uv: ${{ needs.build-info.outputs.use-uv }}
if: needs.build-info.outputs.run-tests == 'true'
# tests-integration-system:
# name: Integration and System Tests
# needs: [build-info, build-ci-images]
# uses: ./.github/workflows/integration-system-tests.yml
# permissions:
# contents: read
# packages: read
# with:
# runs-on-as-json-public: ${{ needs.build-info.outputs.runs-on-as-json-public }}
# testable-core-integrations: ${{ needs.build-info.outputs.testable-core-integrations }}
# testable-providers-integrations: ${{ needs.build-info.outputs.testable-providers-integrations }}
# run-system-tests: ${{ needs.build-info.outputs.run-tests }}
# default-python-version: ${{ needs.build-info.outputs.default-python-version }}
# default-postgres-version: ${{ needs.build-info.outputs.default-postgres-version }}
# default-mysql-version: ${{ needs.build-info.outputs.default-mysql-version }}
# skip-providers-tests: ${{ needs.build-info.outputs.skip-providers-tests }}
# run-coverage: ${{ needs.build-info.outputs.run-coverage }}
# debug-resources: ${{ needs.build-info.outputs.debug-resources }}
# use-uv: ${{ needs.build-info.outputs.use-uv }}
# if: needs.build-info.outputs.run-tests == 'true'

tests-with-lowest-direct-resolution:
name: "Lowest direct dependency providers tests"
Expand Down Expand Up @@ -593,7 +593,6 @@ jobs:
- tests-mysql
- tests-postgres
- tests-non-db
- tests-integration-system
- build-prod-images
uses: ./.github/workflows/finalize-tests.yml
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
- name: "Helm release tarball"
run: >
breeze release-management prepare-helm-chart-tarball --ignore-version-check --override-tag
--skip-tag-signing --version 0.0.0 --version-suffix dev0
--skip-tag-signing --version 0.0.0
- name: Generate GPG key for signing
# Sometimes the key will be already added to the keyring, so we ignore the error
run: gpg --batch --passphrase '' --quick-gen-key dev@airflow.apache.org default default || true
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/prod-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ jobs:
if: inputs.prod-image-build == 'true'
env:
PYTHON_MAJOR_MINOR_VERSION: "${{ inputs.default-python-version }}"
VERSION_SUFFIX_FOR_PYPI: ${{ inputs.branch == 'main' && 'dev0' || '' }}
steps:
- name: "Cleanup repo"
shell: bash
Expand Down Expand Up @@ -197,7 +196,6 @@ jobs:
PYTHON_MAJOR_MINOR_VERSION: "${{ matrix.python-version }}"
DEFAULT_BRANCH: ${{ inputs.branch }}
DEFAULT_CONSTRAINTS_BRANCH: ${{ inputs.constraints-branch }}
VERSION_SUFFIX_FOR_PYPI: ${{ inputs.branch == 'main' && 'dev0' || '' }}
INCLUDE_NOT_READY_PROVIDERS: "true"
# You can override CONSTRAINTS_GITHUB_REPOSITORY by setting secret in your repo but by default the
# Airflow one is going to be used
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/push-image-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ jobs:
PYTHON_MAJOR_MINOR_VERSION: "${{ matrix.python }}"
UPGRADE_TO_NEWER_DEPENDENCIES: "false"
VERBOSE: "true"
VERSION_SUFFIX_FOR_PYPI: "dev0"
steps:
- name: "Cleanup repo"
shell: bash
Expand Down Expand Up @@ -191,7 +190,6 @@ jobs:
PYTHON_MAJOR_MINOR_VERSION: "${{ matrix.python }}"
UPGRADE_TO_NEWER_DEPENDENCIES: "false"
VERBOSE: "true"
VERSION_SUFFIX_FOR_PYPI: "dev0"
if: inputs.include-prod-images == 'true'
steps:
- name: "Cleanup repo"
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/release_dockerhub_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,13 @@ jobs:
- name: "Create airflow_cache builder"
run: docker buildx create --name airflow_cache
- name: "Prepare chicken-eggs provider packages"
# In case of provider packages which use latest dev0 version of providers, we should prepare them
# from the source code, not from the PyPI because they have apache-airflow>=X.Y.Z dependency
# And when we prepare them from sources they will have apache-airflow>=X.Y.Z.dev0
shell: bash
env:
CHICKEN_EGG_PROVIDERS: ${{ needs.build-info.outputs.chicken-egg-providers }}
run: >
breeze release-management prepare-provider-packages
--package-format wheel
--version-suffix-for-pypi dev0 ${CHICKEN_EGG_PROVIDERS}
${CHICKEN_EGG_PROVIDERS}
if: needs.build-info.outputs.chicken-egg-providers != ''
- name: "Copy dist packages to docker-context files"
shell: bash
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/special-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,27 +200,3 @@ jobs:
debug-resources: ${{ inputs.debug-resources }}
use-uv: ${{ inputs.use-uv }}
if: ${{ inputs.default-branch == 'main' }}

# matrix.test-group comes from run-unit-tests.yml
tests-system:
name: "System test: ${{ matrix.test-group }}"
uses: ./.github/workflows/run-unit-tests.yml
permissions:
contents: read
packages: read
with:
runs-on-as-json-default: ${{ inputs.runs-on-as-json-default }}
test-name: "SystemTest"
test-scope: "System"
test-groups: ${{ inputs.test-groups }}
backend: "postgres"
python-versions: "['${{ inputs.default-python-version }}']"
backend-versions: "['${{ inputs.default-postgres-version }}']"
excluded-providers-as-string: ${{ inputs.excluded-providers-as-string }}
excludes: "[]"
core-test-types-list-as-string: ${{ inputs.core-test-types-list-as-string }}
providers-test-types-list-as-string: ${{ inputs.providers-test-types-list-as-string }}
include-success-outputs: ${{ inputs.include-success-outputs }}
run-coverage: ${{ inputs.run-coverage }}
debug-resources: ${{ inputs.debug-resources }}
use-uv: ${{ inputs.use-uv }}
7 changes: 3 additions & 4 deletions .github/workflows/test-provider-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ jobs:
- name: "Prepare provider documentation"
run: >
breeze release-management prepare-provider-documentation --include-not-ready-providers
--non-interactive
--non-interactive fab
if: matrix.package-format == 'wheel'
- name: "Prepare provider packages: ${{ matrix.package-format }}"
run: >
breeze release-management prepare-provider-packages --include-not-ready-providers
--version-suffix-for-pypi dev0 --package-format ${{ matrix.package-format }}
--package-format ${{ matrix.package-format }} fab common.compat
- name: "Prepare airflow package: ${{ matrix.package-format }}"
run: >
breeze release-management prepare-airflow-package --version-suffix-for-pypi dev0
breeze release-management prepare-airflow-package
--package-format ${{ matrix.package-format }}
- name: "Verify ${{ matrix.package-format }} packages with twine"
run: |
Expand Down Expand Up @@ -167,7 +167,6 @@ jobs:
GITHUB_USERNAME: ${{ github.actor }}
INCLUDE_NOT_READY_PROVIDERS: "true"
PYTHON_MAJOR_MINOR_VERSION: "${{ matrix.python-version }}"
VERSION_SUFFIX_FOR_PYPI: "dev0"
VERBOSE: "true"
CLEAN_AIRFLOW_INSTALLATION: "${{ inputs.canary-run }}"
if: inputs.skip-providers-tests != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ repos:
stages: ['manual']
name: Run mypy for providers (manual)
language: python
entry: ./scripts/ci/pre_commit/mypy_folder.py providers/src/airflow/providers
entry: ./scripts/ci/pre_commit/mypy_folder.py airflow/providers/fab
pass_filenames: false
files: ^.*\.py$
require_serial: true
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ function check_force_lowest_dependencies() {
EXTRA="[devel]"
if [[ ${TEST_TYPE=} =~ Providers\[.*\] ]]; then
# shellcheck disable=SC2001
EXTRA=$(echo "[${TEST_TYPE},devel]" | sed 's/Providers\[\(.*\)\]/\1/')
EXTRA=$(echo "[${TEST_TYPE}]" | sed 's/Providers\[\([^]]*\)\]/\1,devel/')
echo
echo "${COLOR_BLUE}Forcing dependencies to lowest versions for provider: ${EXTRA}${COLOR_RESET}"
echo
Expand Down
5 changes: 3 additions & 2 deletions airflow/api_connexion/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@

def check_authentication() -> None:
"""Check that the request has valid authorization information."""
for auth in get_airflow_app().api_auth:
airflow_app = get_airflow_app()
for auth in airflow_app.api_auth:
response = auth.requires_authentication(Response)()
if response.status_code == 200:
return

# Even if the current_user is anonymous, the AUTH_ROLE_PUBLIC might still have permission.
appbuilder = get_airflow_app().appbuilder
appbuilder = airflow_app.appbuilder
if appbuilder.get_app.config.get("AUTH_ROLE_PUBLIC", None):
return

Expand Down
50 changes: 29 additions & 21 deletions airflow/providers/common/compat/openlineage/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,32 @@
from functools import wraps
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from airflow.providers.openlineage.utils.utils import translate_airflow_asset
else:
try:
from airflow.providers.openlineage.utils.utils import translate_airflow_asset
except ImportError:
from airflow.providers.openlineage.utils.utils import translate_airflow_dataset

def rename_asset_as_dataset(function):
@wraps(function)
def wrapper(*args, **kwargs):
if "asset" in kwargs:
kwargs["dataset"] = kwargs.pop("asset")
return function(*args, **kwargs)

return wrapper

translate_airflow_asset = rename_asset_as_dataset(translate_airflow_dataset)


__all__ = ["translate_airflow_asset"]
from airflow.exceptions import AirflowOptionalProviderFeatureException

try:
if TYPE_CHECKING:
try:
from airflow.providers.openlineage.utils.utils import ( # type:ignore [attr-defined]
translate_airflow_asset,
)
except ImportError:
raise AirflowOptionalProviderFeatureException()
else:
try:
from airflow.providers.openlineage.utils.utils import translate_airflow_asset
except ImportError:
from airflow.providers.openlineage.utils.utils import translate_airflow_dataset

def rename_asset_as_dataset(function):
@wraps(function)
def wrapper(*args, **kwargs):
if "asset" in kwargs:
kwargs["dataset"] = kwargs.pop("asset")
return function(*args, **kwargs)

return wrapper

translate_airflow_asset = rename_asset_as_dataset(translate_airflow_dataset)
__all__ = ["translate_airflow_asset"]
except ImportError:
raise AirflowOptionalProviderFeatureException()
87 changes: 87 additions & 0 deletions airflow/providers/fab/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@

.. 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.

.. NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN!

.. IF YOU WANT TO MODIFY TEMPLATE FOR THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
`PROVIDER_README_TEMPLATE.rst.jinja2` IN the `dev/breeze/src/airflow_breeze/templates` DIRECTORY


Package ``apache-airflow-providers-fab``

Release: ``1.5.4``


`Flask App Builder <https://flask-appbuilder.readthedocs.io/>`__


Provider package
----------------

This is a provider package for ``fab`` provider. All classes for this provider package
are in ``airflow.providers.fab`` python package.

You can find package information and changelog for the provider
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-fab/1.5.4/>`_.

Installation
------------

You can install this package on top of an existing Airflow 2 installation (see ``Requirements`` below
for the minimum Airflow version supported) via
``pip install apache-airflow-providers-fab``

The package supports the following python versions: 3.10,3.11,3.12

Requirements
------------

========================================== ==================
PIP package Version required
========================================== ==================
``apache-airflow`` ``>=2.9.0``
``apache-airflow-providers-common-compat`` ``>=1.2.1``
``flask-login`` ``>=0.6.3``
``flask-session`` ``>=0.8.0``
``flask`` ``>=2.2,<3``
``flask-appbuilder`` ``==4.5.4``
``google-re2`` ``>=1.0``
``jmespath`` ``>=0.7.0``
========================================== ==================

Cross provider package dependencies
-----------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified provider packages in order to use them.

You can install such cross-provider dependencies when installing from PyPI. For example:

.. code-block:: bash

pip install apache-airflow-providers-fab[common.compat]


================================================================================================================== =================
Dependent package Extra
================================================================================================================== =================
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
================================================================================================================== =================

The changelog for the provider package can be found in the
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-fab/1.5.4/changelog.html>`_.
17 changes: 13 additions & 4 deletions airflow/providers/fab/auth_manager/cli_commands/db_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@
from __future__ import annotations

from airflow import settings
from airflow.cli.commands.db_command import run_db_downgrade_command, run_db_migrate_command
from airflow.providers.fab.auth_manager.models.db import _REVISION_HEADS_MAP, FABDBManager
from airflow.utils import cli as cli_utils
from airflow.utils.providers_configuration_loader import providers_configuration_loaded

try:
from airflow.cli.commands.db_command import ( # type:ignore [attr-defined]
run_db_downgrade_command,
run_db_migrate_command,
)
from airflow.providers.fab.auth_manager.models.db import _REVISION_HEADS_MAP, FABDBManager
from airflow.utils import cli as cli_utils
from airflow.utils.providers_configuration_loader import providers_configuration_loaded
except ImportError:
from airflow.exceptions import AirflowOptionalProviderFeatureException

raise AirflowOptionalProviderFeatureException()


@providers_configuration_loaded
Expand Down
2 changes: 1 addition & 1 deletion airflow/providers/fab/auth_manager/cli_commands/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _return_appbuilder(app: Flask) -> AirflowAppBuilder:
"""Return an appbuilder instance for the given app."""
init_appbuilder(app)
init_plugins(app)
init_airflow_session_interface(app)
init_airflow_session_interface(app, None)
return app.appbuilder # type: ignore[attr-defined]


Expand Down
Loading
Loading