Skip to content

Fix Azure Batch provider import error by capping azure-batch<15#66452

Merged
Lee-W merged 3 commits intoapache:mainfrom
wjddn279:fix-azure-batch-dep-ci-error
May 6, 2026
Merged

Fix Azure Batch provider import error by capping azure-batch<15#66452
Lee-W merged 3 commits intoapache:mainfrom
wjddn279:fix-azure-batch-dep-ci-error

Conversation

@wjddn279
Copy link
Copy Markdown
Contributor

@wjddn279 wjddn279 commented May 6, 2026

fix ci error (https://github.com/apache/airflow/actions/runs/25411966126/job/74536991640?pr=66141)

ImportError while importing test module '/opt/airflow/providers/microsoft/azure/tests/unit/microsoft/azure/operators/test_batch.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/python/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
providers/microsoft/azure/tests/unit/microsoft/azure/operators/test_batch.py:27: in <module>
    from airflow.providers.microsoft.azure.hooks.batch import AzureBatchHook
/usr/python/lib/python3.10/site-packages/airflow/providers/microsoft/azure/hooks/batch.py:25: in <module>
    from azure.batch import BatchServiceClient, batch_auth, models as batch_models
E   ImportError: cannot import name 'BatchServiceClient' from 'azure.batch' (/usr/python/lib/python3.10/site-packages/azure/batch/__init__.py)
------------------------------------------------------------ generated xml file: /files/test_result-providers_-amazon_celery_googl-sqlite.xml ------------------------------------------------------------
======================================================================================== short test summary info =========================================================================================
ERROR providers/microsoft/azure/tests/unit/microsoft/azure/hooks/test_batch.py
ERROR providers/microsoft/azure/tests/unit/microsoft/azure/operators/test_batch.py

The azure-batch SDK 15.x line (15.1.0 GA released on PyPI on 2026-05-01) is a complete rewrite that removes BatchServiceClient in favor of the new BatchClient, along with renamed models, methods, and parameters. Therefore, this pins the dependency to <15.0.0

ref https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/batch/azure-batch/CHANGELOG.md


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Copy link
Copy Markdown
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with comment

Comment thread providers/microsoft/azure/pyproject.toml Outdated
@wjddn279 wjddn279 force-pushed the fix-azure-batch-dep-ci-error branch from aefad7a to 7d20be1 Compare May 6, 2026 07:05
Copy link
Copy Markdown
Contributor

@parkhojeong parkhojeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

is there a reason uv.lock is not updated here? Since this changes the azure-batch dependency specifier, I would expect the lockfile metadata to reflect the new <15.0.0 cap as well. I also ran uv lock --check locally, and it reported that uv.lock needs to be updated.

@Lee-W
Copy link
Copy Markdown
Member

Lee-W commented May 6, 2026

I think it was never actually updated to 15. We're at the latest version of 14 and thus no update is required

@Lee-W Lee-W merged commit d7e7cd5 into apache:main May 6, 2026
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants