Skip to content

[Core] Fix Pylint Errors - Import related issues - #48392

Open
kashifkhan wants to merge 9 commits into
Azure:mainfrom
kashifkhan:azcore_pylint_fix
Open

[Core] Fix Pylint Errors - Import related issues#48392
kashifkhan wants to merge 9 commits into
Azure:mainfrom
kashifkhan:azcore_pylint_fix

Conversation

@kashifkhan

Copy link
Copy Markdown
Member

These are largely import related errors

Copilot AI review requested due to automatic review settings July 31, 2026 20:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Cleans up Pylint import and line-length violations across Azure Core tests, test infrastructure, performance tests, and samples without changing runtime behavior.

Changes:

  • Reorders imports and removes unused or duplicate imports.
  • Replaces wildcard imports with explicit symbols.
  • Wraps long lines and adds targeted Pylint suppressions.

Reviewed changes

Copilot reviewed 78 out of 78 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/utils.py Organizes shared test utility imports.
tests/tracing_common.py Reorders tracing imports.
tests/testserver_tests/coretestserver/coretestserver/test_routes/helpers.py Organizes standard, Flask, and local imports.
tests/testserver_tests/coretestserver/coretestserver/test_routes/headers.py Removes an unused Flask import.
tests/testserver_tests/coretestserver/coretestserver/test_routes/errors.py Adds targeted Pylint suppressions.
tests/testserver_tests/coretestserver/coretestserver/__init__.py Reorders standard and Flask imports.
tests/test_utils.py Adds targeted Pylint suppressions.
tests/test_user_agent_policy.py Organizes test and SDK imports.
tests/test_universal_pipeline.py Removes an unused import and reorders utilities.
tests/test_tracing_policy.py Groups third-party and local imports.
tests/test_tracing_live.py Reorders tracing dependencies.
tests/test_tracing_decorator.py Organizes tracing test imports.
tests/test_tracer_otel.py Separates OpenTelemetry and Azure imports.
tests/test_testserver.py Organizes testserver imports.
tests/test_streaming.py Reorders utility imports and removes a duplicate.
tests/test_stream_generator.py Organizes standard, third-party, and SDK imports.
tests/test_settings.py Removes an unused import and reorders pytest.
tests/test_serialization.py Removes unused imports and organizes dependencies.
tests/test_retry_policy.py Consolidates and reorders retry-test imports.
tests/test_rest_response_backcompat.py Removes an unused import.
tests/test_rest_request_backcompat.py Removes an unused import and reorganizes imports.
tests/test_rest_http_response.py Removes an unused import and groups dependencies.
tests/test_rest_http_request.py Removes unused imports and adds Pylint suppressions.
tests/test_rest_headers.py Removes unused response imports.
tests/test_requests_universal.py Groups standard, third-party, and SDK imports.
tests/test_request_id_policy.py Reorders policy test imports.
tests/test_polling.py Replaces a wildcard polling import with explicit symbols.
tests/test_pipeline.py Removes unused and duplicate imports.
tests/test_paging.py Moves pytest into the third-party import group.
tests/test_messaging_cloud_event.py Reorders pytest and adds Pylint suppressions.
tests/test_http_logging_policy.py Removes unused imports and reorganizes dependencies.
tests/test_exceptions.py Reorders imports and wraps long assertions.
tests/test_error_map.py Reorders local test utilities.
tests/test_custom_hook_policy.py Organizes pytest and utility imports.
tests/test_content_length_checking.py Removes unused pipeline and transport imports.
tests/test_connection_string_parsing.py Wraps long connection-string literals.
tests/test_basic_transport.py Removes unused imports and adds Pylint suppressions.
tests/test_base_polling.py Promotes repeated local imports to module scope.
tests/test_authentication.py Organizes standard, third-party, and local imports.
tests/specs_sdk/modeltypes/modeltypes/models/_patch.py Removes an unused datetime type import.
tests/rest_client.py Moves the standard-library import before SDK imports.
tests/perf_tests/update_entity_json.py Wraps a long URL expression.
tests/perf_tests/download_binary.py Removes an unused performance-test import.
tests/perf_tests/_test_base.py Normalizes policy import syntax and wraps long text.
tests/async_tests/test_universal_http_async.py Removes an unused response import and reorders dependencies.
tests/async_tests/test_tracing_policy_async.py Reorders local tracing utilities.
tests/async_tests/test_tracing_live_async.py Removes an unused type import and reorganizes imports.
tests/async_tests/test_tracing_decorator_async.py Organizes tracing test imports.
tests/async_tests/test_testserver_async.py Reorders transport imports.
tests/async_tests/test_streaming_async.py Removes an unused import and organizes dependencies.
tests/async_tests/test_stream_generator_async.py Reorders standard, third-party, and local imports.
tests/async_tests/test_retry_policy_async.py Removes unused imports and consolidates dependencies.
tests/async_tests/test_rest_trio_transport.py Reorders Trio transport test imports.
tests/async_tests/test_rest_stream_responses_async.py Groups pytest separately from SDK imports.
tests/async_tests/test_rest_response_backcompat_async.py Removes an unused import and reorders local dependencies.
tests/async_tests/test_rest_http_response_async.py Removes an unused import and organizes utilities.
tests/async_tests/test_rest_http_request_async.py Reorders standard, third-party, and SDK imports.
tests/async_tests/test_rest_headers_async.py Removes unused platform and transport imports.
tests/async_tests/test_rest_context_manager_async.py Removes an unused test-client import.
tests/async_tests/test_rest_asyncio_transport.py Organizes asyncio transport test imports.
tests/async_tests/test_request_trio.py Reorders pytest and SDK imports.
tests/async_tests/test_request_asyncio.py Reorders pytest and SDK imports.
tests/async_tests/test_polling_async.py Replaces a wildcard polling import with explicit symbols.
tests/async_tests/test_pipeline_async.py Removes a duplicate policy import and groups dependencies.
tests/async_tests/test_paging_async.py Moves pytest into the third-party import group.
tests/async_tests/test_http_logging_policy_async.py Organizes logging test imports.
tests/async_tests/test_content_length_checking_async.py Removes an unused pipeline import.
tests/async_tests/test_basic_transport_async.py Promotes imports and adds Pylint suppressions.
tests/async_tests/test_base_polling_async.py Consolidates local and Azure Core imports.
tests/async_tests/test_authentication_async.py Organizes authentication test dependencies.
samples/test_example_sync.py Adds sample-specific Pylint suppressions.
samples/test_example_sansio.py Removes unused imports and suppresses intentional reimports.
samples/test_example_policies.py Removes unused policy imports and scopes a suppression.
samples/test_example_async.py Organizes imports and adds sample-specific suppressions.
samples/example_truststore_ssl_context.py Suppresses intentional transport and networking imports.
samples/example_truststore_injection.py Documents and suppresses intentional late SDK imports.
samples/example_shared_transport.py Adds transport suppressions and wraps a long comment.
samples/example_shared_transport_async.py Adds transport suppressions and wraps a long comment.

Copilot AI review requested due to automatic review settings July 31, 2026 20:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 78 out of 78 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 31, 2026 21:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 78 out of 78 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 31, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 79 out of 79 changed files in this pull request and generated no new comments.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor
[Pilot] PR Pipeline Failure Analysis

A CI pipeline failed on this pull request. Here is an automated analysis of what went wrong and how to get the build green.

What failed

Two distinct failure groups were detected:

  1. Build/Infrastructure failure — The pipeline at build #6646956 failed with ERR_PNPM_BAD_CONFIG_DEP: pnpm@9.5.0 could not be resolved as a package manager dependency because it has no integrity. This is likely a tooling/environment issue rather than a code change in this PR.

  2. Test failures (azure-ai-textanalytics) — Across macOS, Ubuntu, and Windows agents (Python 3.10–3.12), all 14 azure-ai-textanalytics tests failed consistently across sdist, whl, and mindependency configurations. The identical failure pattern across all platforms suggests a shared root cause (e.g., a recording mismatch, a transport/retry behavior change, or a dependency incompatibility introduced by this PR's core changes).

  3. Test failure (azure-cosmos)tests.test_service_retry_policies.TestServiceRetryPolicies.test_service_response_retry_policy failed on Windows (emulator, Python 3.10 sdist).

Recommended next steps

  • For the pnpm/build failure: Re-run the failed pipeline stage — this looks like a transient tooling issue (ERR_PNPM_BAD_CONFIG_DEP / missing integrity). If it persists, check whether a recent change to package.json or pnpm-lock.yaml in the autorest.python dependency chain is the cause.
  • For the azure-ai-textanalytics test failures: All 14 tests fail identically on all 3 OS/Python matrix entries. Review whether the core transport/retry changes in this PR affect test playback recordings or live service behavior. Check if test recordings need to be regenerated.
  • For the azure-cosmos retry test: Investigate whether the retry policy behavior changed due to the core changes in this PR.
  • See the CI troubleshooting guide: https://aka.ms/ci-fix
  • Push new commits to address the failures; this comment updates automatically on the next failing run.
Raw pipeline analysis (azsdk ci analyze)
Analyzing pipeline https://github.com/Azure/azure-sdk-for-python/pull/48392...
--------------------------------------------------------------------------------
Failed Tests
--------------------------------------------------------------------------------
cosmos: tests.test_service_retry_policies.TestServiceRetryPolicies.test_service_response_retry_policy
  (windows2022 EmulatorTestsPython310Standard - sdist)

azure-ai-textanalytics (14 tests, all platforms: macos311, ubuntu2404_310, windows2022_312):
  test_abstract_summary, test_extract_key_phrases, test_extract_summary,
  test_health_care_lro, test_language_detection, test_multi_label_classify,
  test_recognize_entities, test_recognize_entities_ner, test_recognize_linked_entities,
  test_recognize_pii, test_recognize_pii_confidence_score, test_recognize_pii_redaction_policies,
  test_single_label_classify, test_text_sentiment
  (all across sdist, whl, mindependency)

--------------------------------------------------------------------------------
Failed Tasks
--------------------------------------------------------------------------------
Pipeline: https://dev.azure.com/azure-sdk/public/_build/results?buildId=6646956

Error: ERR_PNPM_BAD_CONFIG_DEP
  × resolve package manager dependencies
  ╰─▶ Cannot resolve pnpm@9.5.0 as a package manager dependency because it has no integrity
##[error]Bash exited with code '1'.

Copilot detected the failing pipeline and generated the analysis above. To have it attempt a fix automatically, reply with `@copilot please fix the failing pipeline on this PR`.

Generated by Pipeline Analysis - Next Steps · 23.1 AIC · ⌖ 6.25 AIC · ⊞ 6.6K ·

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants