This is an automated email from the ASF dual-hosted git repository. potiuk pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push: new a2f5307fd0 Brings back mypy-checks (#38597) a2f5307fd0 is described below commit a2f5307fd0ec54b34b8c753a53024a2629a56fd8 Author: Jarek Potiuk <ja...@potiuk.com> AuthorDate: Fri Mar 29 00:08:56 2024 +0100 Brings back mypy-checks (#38597) During the last week refactor input on mypy checks was moved to another workflow and mypy checks were not running for a day. This change brings it back. --- .github/workflows/additional-ci-image-checks.yml | 8 -------- .github/workflows/ci.yml | 4 ++-- .github/workflows/static-checks-mypy-docs.yml | 11 +++++++++-- airflow/providers/openlineage/plugins/listener.py | 6 +++--- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/additional-ci-image-checks.yml b/.github/workflows/additional-ci-image-checks.yml index fa7ff3d5fe..f9800b0f4e 100644 --- a/.github/workflows/additional-ci-image-checks.yml +++ b/.github/workflows/additional-ci-image-checks.yml @@ -61,14 +61,6 @@ on: # yamllint disable-line rule:truthy description: "Whether this is a canary run (true/false)" required: true type: string - mypy-folders: - description: "The list of folders to run mypy on" - required: true - type: string - needs-mypy: - description: "Whether to run mypy checks (true) or not (false)" - required: true - type: string latest-versions-only: description: "Whether to run only latest versions (true/false)" required: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4dbc86eb2..e990c14eb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -247,8 +247,6 @@ jobs: skip-pre-commits: ${{ needs.build-info.outputs.skip-pre-commits }} docker-cache: ${{ needs.build-info.outputs.docker-cache }} canary-run: ${{ needs.build-info.outputs.canary-run }} - mypy-folders: ${{ needs.build-info.outputs.mypy-folders }} - needs-mypy: ${{ needs.build-info.outputs.needs-mypy }} latest-versions-only: ${{ needs.build-info.outputs.latest-versions-only }} include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }} debug-resources: ${{ needs.build-info.outputs.debug-resources }} @@ -276,6 +274,8 @@ jobs: with: runs-on: ${{ needs.build-info.outputs.runs-on }} image-tag: ${{ needs.build-info.outputs.image-tag }} + needs-mypy: ${{ needs.build-info.outputs.needs-mypy }} + mypy-folders: ${{ needs.build-info.outputs.mypy-folders }} python-versions-list-as-string: ${{ needs.build-info.outputs.python-versions-list-as-string }} branch: ${{ needs.build-info.outputs.default-branch }} canary-run: ${{ needs.build-info.outputs.canary-run }} diff --git a/.github/workflows/static-checks-mypy-docs.yml b/.github/workflows/static-checks-mypy-docs.yml index 60cc4b4b1c..2dcc64c9c3 100644 --- a/.github/workflows/static-checks-mypy-docs.yml +++ b/.github/workflows/static-checks-mypy-docs.yml @@ -29,6 +29,14 @@ on: # yamllint disable-line rule:truthy description: "Tag to set for the image" required: true type: string + needs-mypy: + description: "Whether to run mypy checks (true/false)" + required: true + type: string + mypy-folders: + description: "List of folders to run mypy checks on" + required: false + type: string python-versions-list-as-string: description: "The list of python versions as string separated by spaces" required: true @@ -131,7 +139,7 @@ jobs: mypy: timeout-minutes: 45 - name: MyPy checks + name: "MyPy checks" runs-on: ${{ fromJSON(inputs.runs-on) }} if: inputs.needs-mypy == 'true' strategy: @@ -152,7 +160,6 @@ jobs: persist-credentials: false - name: Cleanup docker uses: ./.github/actions/cleanup-docker - if: inputs.needs-mypy == 'true' - name: "Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }}" uses: ./.github/actions/prepare_breeze_and_image id: breeze diff --git a/airflow/providers/openlineage/plugins/listener.py b/airflow/providers/openlineage/plugins/listener.py index ba1e5a7906..25ded6d7f4 100644 --- a/airflow/providers/openlineage/plugins/listener.py +++ b/airflow/providers/openlineage/plugins/listener.py @@ -265,7 +265,7 @@ class OpenLineageListener: @hookimpl def on_dag_run_running(self, dag_run: DagRun, msg: str): - if not is_selective_lineage_enabled(dag_run.dag): + if dag_run.dag and not is_selective_lineage_enabled(dag_run.dag): return data_interval_start = dag_run.data_interval_start.isoformat() if dag_run.data_interval_start else None data_interval_end = dag_run.data_interval_end.isoformat() if dag_run.data_interval_end else None @@ -279,7 +279,7 @@ class OpenLineageListener: @hookimpl def on_dag_run_success(self, dag_run: DagRun, msg: str): - if not is_selective_lineage_enabled(dag_run.dag): + if dag_run.dag and not is_selective_lineage_enabled(dag_run.dag): return if not self.executor: self.log.debug("Executor have not started before `on_dag_run_success`") @@ -288,7 +288,7 @@ class OpenLineageListener: @hookimpl def on_dag_run_failed(self, dag_run: DagRun, msg: str): - if not is_selective_lineage_enabled(dag_run.dag): + if dag_run.dag and not is_selective_lineage_enabled(dag_run.dag): return if not self.executor: self.log.debug("Executor have not started before `on_dag_run_failed`")