Skip to content

Commit

Permalink
style(mypy): fix mypy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed May 23, 2023
1 parent 34bc6d5 commit be32277
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions astronomer/providers/amazon/aws/operators/sagemaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def execute(self, context: Context) -> dict[str, Any] | None: # type: ignore[ov
# for bypassing mypy missing return error
return None # pragma: no cover

def execute_complete(self, context: Context, event: dict[str, Any]) -> dict[str, Any]:
def execute_complete(self, context: Context, event: dict[str, Any]) -> dict[str, Any]: # type: ignore[override]
"""
Callback for when the trigger fires - returns immediately.
Relies on trigger to throw an exception, otherwise it assumes execution was
Expand Down Expand Up @@ -367,7 +367,7 @@ def execute(self, context: Context) -> dict[str, Any] | None: # type: ignore[ov
# for bypassing mypy missing return error
return None # pragma: no cover

def execute_complete(self, context: Context, event: dict[str, Any]) -> dict[str, Any]:
def execute_complete(self, context: Context, event: dict[str, Any]) -> dict[str, Any]: # type: ignore[override]
"""
Callback for when the trigger fires - returns immediately.
Relies on trigger to throw an exception, otherwise it assumes execution was
Expand Down
2 changes: 1 addition & 1 deletion astronomer/providers/databricks/operators/databricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def execute(self, context: Context) -> None:
else:
_handle_non_successful_terminal_states(run_state, run_info, hook, self.task_id)

def execute_complete(self, context: Context, event: Any = None) -> None:
def execute_complete(self, context: Context, event: Any = None) -> None: # type: ignore[override]
"""
Callback for when the trigger fires - returns immediately.
Relies on trigger to throw an exception, otherwise it assumes execution was
Expand Down
3 changes: 2 additions & 1 deletion astronomer/providers/google/cloud/operators/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
BigQueryValueCheckOperator,
)
from google.api_core.exceptions import Conflict
from google.cloud.bigquery import CopyJob, ExtractJob, LoadJob, QueryJob

from astronomer.providers.google.cloud.triggers.bigquery import (
BigQueryCheckTrigger,
Expand Down Expand Up @@ -105,7 +106,7 @@ def execute(self, context: Context) -> Any: # noqa: D102
self._handle_job_error(job)
except Conflict:
# If the job already exists retrieve it
job = hook.get_job(
job: CopyJob | QueryJob | LoadJob | ExtractJob = hook.get_job( # type: ignore [no-redef]
project_id=self.project_id,
location=self.location,
job_id=job_id,
Expand Down
2 changes: 1 addition & 1 deletion astronomer/providers/google/cloud/sensors/gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def __init__(
)
super().__init__(**kwargs)

def execute(self, context: Context) -> None: # type: ignore[override]
def execute(self, context: Context) -> None:
"""Airflow runs this method on the worker and defers using the trigger."""
hook_params = {"impersonation_chain": self.impersonation_chain}
if hasattr(self, "delegate_to"):
Expand Down

0 comments on commit be32277

Please sign in to comment.