Skip to content

AzureContainerInstancesOperator is not working due to argument error #18074

Description

@binhnefits

Apache Airflow Provider(s)

microsoft-azure

Versions of Apache Airflow Providers

3.1.0

Apache Airflow version

2.1.3 (latest released)

Operating System

Ubuntu

Deployment

Docker-Compose

Deployment details

No response

What happened

I'm getting this error when trying to run AzureContainerInstancesOperator. I believe its due to AzureContainerInstanceHook initialization when passing self.ci_conn_id as a positional argument.

self._ci_hook = AzureContainerInstanceHook(self.ci_conn_id)

Should this be?

        self._ci_hook = AzureContainerInstanceHook(conn_id=self.ci_conn_id)

Error:

Traceback (most recent call last):
  File "/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 1164, in _run_raw_task
    self._prepare_and_execute_task_with_callbacks(context, task)
  File "/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 1282, in _prepare_and_execute_task_with_callbacks
    result = self._execute_task(context, task_copy)
  File "/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 1312, in _execute_task
    result = task_copy.execute(context=context)
  File "/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/microsoft/azure/operators/azure_container_instances.py", line 202, in execute
    self._ci_hook = AzureContainerInstanceHook(self.ci_conn_id)
  File "/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/microsoft/azure/hooks/azure_container_instance.py", line 45, in __init__
    super().__init__(sdk_client=ContainerInstanceManagementClient, *args, **kwargs)
TypeError: __init__() got multiple values for argument 'sdk_client'

What you expected to happen

No response

How to reproduce

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions