Skip to content

Commit

Permalink
Brings back mypy-checks (#38597)
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit a2f5307)
  • Loading branch information
potiuk authored and ephraimbuddy committed Mar 31, 2024
1 parent 688b40e commit dcac0e1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/additional-ci-image-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ jobs:
skip-pre-commits: ${{ needs.build-info.outputs.skip-pre-commits }}
docker-cache: ${{ needs.build-info.outputs.cache-directive }}
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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/static-checks-mypy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions airflow/providers/openlineage/plugins/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def before_stopping(self, component):

@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
Expand All @@ -279,7 +279,7 @@ def on_dag_run_running(self, dag_run: DagRun, msg: str):

@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`")
Expand All @@ -288,7 +288,7 @@ def on_dag_run_success(self, dag_run: DagRun, msg: str):

@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`")
Expand Down

0 comments on commit dcac0e1

Please sign in to comment.