Skip to content

Typo in parameter for create_subscription #54127

@Codolophier

Description

@Codolophier

Apache Airflow Provider(s)

microsoft-azure

Versions of Apache Airflow Providers

12.0+

Apache Airflow version

3.03

Operating System

Ubuntu 22.04.3 LTS

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

What happened

When using airflow.providers.microsoft.azure.hooks.asb.AdminClientHook.create_subscription as follows:

from airflow.providers.microsoft.azure.hooks.asb import AdminClientHook
...
with DAG(
    dag_id='azure_service_bus',
    start_date=datetime(2025, 8, 4),
    catchup=False,
) as dag:
    admin_hook = AdminClientHook(azure_service_bus_conn_id='azure_service_bus_default_connection')
    subscription_name = "mytest"
    topic_name="testmessage_topic"
    admin_hook.create_subscription(topic_name,subscription_name)

the following error is raised:

TypeError: Session.request() got an unexpected keyword argument 'dead_lettering_on_ßmessage_expiration'

Looking at the code in providers/microsoft/azure/src/airflow/providers/microsoft/azure/hooks/asb.py, on line 356, there is a typo in the parameter name:

...
dead_lettering_on_ßmessage_expiration=dead_lettering_on_message_expiration
...

What you think should happen instead

The parameter should not contain ß, and instead should read as :

...
dead_lettering_on_message_expiration=dead_lettering_on_message_expiration
...

How to reproduce

Create a DAG that creates a subscription using the AdminClientHook:

from airflow import DAG
from airflow.operators.python import PythonOperator
from airflow.providers.microsoft.azure.hooks.asb import AdminClientHook
from datetime import datetime

with DAG(
    dag_id='azure_service_bus',
    start_date=datetime(2025, 8, 4),
    catchup=False,
) as dag:
    admin_hook = AdminClientHook(azure_service_bus_conn_id='azure_service_bus_default_connection')
    subscription_name = "mytest"
    topic_name="testmessage_topic"
    admin_hook.create_subscription(topic_name,subscription_name)

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions