Skip to content

Commit

Permalink
Resolve type-check errrors with respect to update method signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajkoti committed Jan 24, 2025
1 parent 94eada9 commit 92314e8
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
8 changes: 7 additions & 1 deletion cosmos/operators/azure_container_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ def __init__(
**kwargs,
)

def build_and_run_cmd(self, context: Context, cmd_flags: list[str] | None = None) -> None:
def build_and_run_cmd(
self,
context: Context,
cmd_flags: list[str] | None = None,
run_as_async: bool = False,
async_context: dict[str, Any] | None = None,
) -> Any:
self.build_command(context, cmd_flags)
self.log.info(f"Running command: {self.command}")
result = AzureContainerInstancesOperator.execute(self, context)
Expand Down
8 changes: 7 additions & 1 deletion cosmos/operators/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ def __init__(

super().__init__(image=image, **kwargs)

def build_and_run_cmd(self, context: Context, cmd_flags: list[str] | None = None) -> Any:
def build_and_run_cmd(
self,
context: Context,
cmd_flags: list[str] | None = None,
run_as_async: bool = False,
async_context: dict[str, Any] | None = None,
) -> Any:
self.build_command(context, cmd_flags)
self.log.info(f"Running command: {self.command}")
result = DockerOperator.execute(self, context)
Expand Down
8 changes: 7 additions & 1 deletion cosmos/operators/gcp_cloud_run_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ def __init__(
self.environment_variables = environment_variables or DEFAULT_ENVIRONMENT_VARIABLES
super().__init__(project_id=project_id, region=region, job_name=job_name, **kwargs)

def build_and_run_cmd(self, context: Context, cmd_flags: list[str] | None = None) -> Any:
def build_and_run_cmd(
self,
context: Context,
cmd_flags: list[str] | None = None,
run_as_async: bool = False,
async_context: dict[str, Any] | None = None,
) -> Any:
self.build_command(context, cmd_flags)
self.log.info(f"Running command: {self.command}")
result = CloudRunExecuteJobOperator.execute(self, context)
Expand Down
8 changes: 7 additions & 1 deletion cosmos/operators/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ def build_env_args(self, env: dict[str, str | bytes | PathLike[Any]]) -> None:

self.env_vars: list[Any] = convert_env_vars(env_vars_dict)

def build_and_run_cmd(self, context: Context, cmd_flags: list[str] | None = None) -> Any:
def build_and_run_cmd(
self,
context: Context,
cmd_flags: list[str] | None = None,
run_as_async: bool = False,
async_context: dict[str, Any] | None = None,
) -> Any:
self.build_kube_args(context, cmd_flags)
self.log.info(f"Running command: {self.arguments}")
result = KubernetesPodOperator.execute(self, context)
Expand Down
2 changes: 2 additions & 0 deletions cosmos/operators/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def run_command(
cmd: list[str],
env: dict[str, str | bytes | os.PathLike[Any]],
context: Context,
run_as_async: bool = False,
async_context: dict[str, Any] | None = None,
) -> FullOutputSubprocessResult | dbtRunnerResult:
# No virtualenv_dir set, so create a temporary virtualenv
if self.virtualenv_dir is None or self.is_virtualenv_dir_temporary:
Expand Down

0 comments on commit 92314e8

Please sign in to comment.