Skip to content

App Config SDK/Provider Pylint Updates#45050

Open
mrm9084 wants to merge 7 commits intoAzure:mainfrom
mrm9084:MyPyUpdates
Open

App Config SDK/Provider Pylint Updates#45050
mrm9084 wants to merge 7 commits intoAzure:mainfrom
mrm9084:MyPyUpdates

Conversation

@mrm9084
Copy link
Member

@mrm9084 mrm9084 commented Feb 5, 2026

Description

Part 1 of updates for #44708, a second PR needs to be created to update the sanitation steps.

Note: Only samples/tests have been modified as part of this change.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings February 5, 2026 23:50
@github-actions github-actions bot added the App Configuration Azure.ApplicationModel.Configuration label Feb 5, 2026
@mrm9084 mrm9084 changed the title App Config SDK Pylint Updates App Config SDK/Provider Pylint Updates Feb 5, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses pylint version 4.0.4 compliance issues for the azure-appconfiguration and azure-appconfiguration-provider packages as part of issue #44708. The changes focus on fixing linting warnings without altering functionality.

Changes:

  • Reordered imports to follow consistent pattern: stdlib, third-party, local modules, azure packages
  • Added pylint disable comments for classes with many public methods
  • Refactored test code to use setup methods instead of inline context managers
  • Converted instance methods to static methods where appropriate
  • Removed unused imports and parameters
  • Fixed missing return statement in sample utility function

Reviewed changes

Copilot reviewed 55 out of 56 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
test_query_param_policy.py Reordered imports, removed unused return statement, attempted to split long lines with multi-line strings (introduces bugs)
test_consistency.py Reordered imports
test_azure_appconfiguration_client_async.py Reordered imports, added pylint disable, refactored context manager usage, attempted error message line splitting (introduces bugs), added staticmethod decorator
test_azure_appconfiguration_client_aad_async.py Reordered imports, added pylint disable, attempted error message line splitting (introduces bugs), split long comment
test_azure_appconfiguration_client_aad.py Reordered imports, added pylint disable, attempted error message line splitting (introduces bugs)
test_azure_appconfiguration_client.py Reordered imports, added pylint disable, removed unused imports, refactored context manager usage, attempted error message line splitting (introduces bugs), fixed SecretReferenceConfigurationSetting test, added staticmethod decorator
test_audience_policy.py Reordered imports
test_audience_error_handling_live_async.py Reordered imports, removed unused imports
test_audience_error_handling_live.py Reordered imports, removed unused imports
preparers.py (azure-appconfiguration) Reordered imports, attempted connection string line splitting (introduces bugs)
perfstress_tests/set.py Removed unused import
perfstress_tests/get.py Removed unused import
asynctestcase.py Reordered imports
snapshot_sample_async.py Reordered imports, split long docstring
snapshot_sample.py Reordered imports, split long docstring
hello_world_sample_entra_id_and_bleu.py Split long docstring, changed environment variable name (introduces documentation inconsistency)
hello_world_entra_id_sample.py Changed environment variable name (introduces documentation inconsistency)
conditional_operation_sample.py Fixed early return pattern
testcase.py (azure-appconfiguration-provider) Reordered imports
test_tag_filters.py Reordered imports, removed unused import
test_snapshots.py Removed unused import
test_request_tracing_context.py Added pylint disable comment (missing space)
test_provider_refresh.py Reordered imports
test_provider_feature_management.py Reordered imports
test_provider_aad.py Reordered imports
test_provider.py Reordered imports, removed unused parameter
test_json.py Minor whitespace fix in test string
test_discovery.py Reordered imports
test_configuration_client_manager_load_balance.py Reordered imports
test_configuration_client_manager.py Reordered imports
key_vault/test_secret_refresh.py Reordered imports
key_vault/test_secret_provider.py Reordered imports
aio/test_configuration_async_client_manager_load_balance.py Reordered imports
aio/test_configuration_async_client_manager.py Reordered imports, split long patch decorator paths
aio/test_async_snapshots.py Removed unused import
aio/test_async_provider_refresh.py Reordered imports
aio/test_async_provider_feature_management.py Reordered imports
aio/test_async_provider_aad.py Reordered imports
aio/test_async_provider.py Reordered imports, split long comment
aio/test_async_discovery.py Reordered imports, removed unused import
aio/key_vault/test_async_secret_refresh.py Reordered imports, removed unused import
aio/key_vault/test_async_secret_provider.py Reordered imports
samples/snapshot_sample.py (provider) Removed unused import
samples/sample_utilities.py Added missing return statement
samples/refresh_sample_feature_flags.py Reordered imports, changed unused parameter to underscore, split long comment
samples/refresh_sample.py Reordered imports, changed unused parameter to underscore, split long comment
samples/key_vault_reference_sample.py Reordered imports
samples/key_vault_reference_customized_clients_sample.py Reordered imports
samples/connection_string_sample.py Reordered imports
samples/async_snapshot_sample.py Reordered imports
samples/async_key_vault_reference_sample.py Reordered imports
samples/async_key_vault_reference_provided_clients_sample.py Reordered imports
samples/async_connection_string_sample.py Reordered imports
samples/async_aad_sample.py Reordered imports
samples/aad_sample.py Reordered imports

Comment on lines +18 to +29
1) APPCONFIGURATION_CONNECTION_STRING: Connection String used to access the Azure App Configuration.
"""
import os
from azure.appconfiguration import AzureAppConfigurationClient
from azure.identity import DefaultAzureCredential
from azure.appconfiguration import ConfigurationSetting


def main():
# [START create_app_config_client]

ENDPOINT = os.environ["APPCONFIGURATION_ENDPOINT"]
ENDPOINT = os.environ["APPCONFIGURATION_ENDPOINT_STRING"]
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The documentation comment at line 18 states the environment variable should be 'APPCONFIGURATION_CONNECTION_STRING', but this sample actually uses Entra ID authentication (not connection string) and requires 'APPCONFIGURATION_ENDPOINT_STRING' as seen in line 29. The documentation is misleading and should be updated to reflect the actual environment variable requirements.

Copilot uses AI. Check for mistakes.
Comment on lines 159 to 161
expected_url = """
?%24filter=startsWith%28key%2C%27app%27%29&%24select=key%2Cvalue&%24top=10&api-version=2023-10-01&label=prod&maxitems=100
"""
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The multi-line string format used here will include leading and trailing whitespace/newlines in the string value, which will cause the assertion to fail. The expected_url should not include newlines and indentation as these will be part of the actual string value. The original single-line format was correct.

Copilot uses AI. Check for mistakes.
Comment on lines 189 to 196
# cspell:disable-line
original_url = """
?$select=key,value&tags=feature%3Dauth&label=*&api-version=2023-11-01&$filter=startsWith(key,'app')&tags=env%3Dtest
"""

expected_url = """
?%24filter=startsWith%28key%2C%27app%27%29&%24select=key%2Cvalue&api-version=2023-11-01&label=%2A&tags=feature%3Dauth&tags=env%3Dtest
"""
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The multi-line string format used here will include leading and trailing whitespace/newlines in the string values, which will cause the test to fail. The strings should not include newlines and indentation as these will be part of the actual string value when using triple-quoted strings. The original single-line format with inline comments was correct.

Copilot uses AI. Check for mistakes.
Comment on lines 240 to 242
== """
AzureAppConfigurationClient.list_configuration_settings() got multiple values for argument 'label_filter'
"""
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The multi-line string format used here will include leading and trailing whitespace/newlines in the string value, which will cause the assertion to fail. When comparing error messages, the extra whitespace will cause the comparison to fail. The original single-line format was correct.

Copilot uses AI. Check for mistakes.
Comment on lines 254 to 256
== """
AzureAppConfigurationClient.list_configuration_settings() got multiple values for argument 'label_filter'
"""
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The multi-line string format used here will include leading and trailing whitespace/newlines in the string value, which will cause the assertion to fail. When comparing error messages, the extra whitespace will cause the comparison to fail. The original single-line format was correct.

Copilot uses AI. Check for mistakes.
Comment on lines 245 to 247
== """
AzureAppConfigurationClient.list_configuration_settings() got multiple values for argument 'label_filter'
"""
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The multi-line string format used here will include leading and trailing whitespace/newlines in the string value, which will cause the assertion to fail. When comparing error messages, the extra whitespace will cause the comparison to fail. The original single-line format was correct.

Copilot uses AI. Check for mistakes.
Comment on lines 259 to 261
== """
AzureAppConfigurationClient.list_configuration_settings() got multiple values for argument 'label_filter'
"""
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The multi-line string format used here will include leading and trailing whitespace/newlines in the string value, which will cause the assertion to fail. When comparing error messages, the extra whitespace will cause the comparison to fail. The original single-line format was correct.

Copilot uses AI. Check for mistakes.
Comment on lines 253 to 255
== """
AzureAppConfigurationClient.list_configuration_settings() got multiple values for argument 'label_filter'
"""
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The multi-line string format used here will include leading and trailing whitespace/newlines in the string value, which will cause the assertion to fail. When comparing error messages, the extra whitespace will cause the comparison to fail. The original single-line format was correct.

Copilot uses AI. Check for mistakes.
Comment on lines 244 to 246
== """
AzureAppConfigurationClient.list_configuration_settings() got multiple values for argument 'label_filter'
"""
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The multi-line string format used here will include leading and trailing whitespace/newlines in the string value, which will cause the assertion to fail. When comparing error messages, the extra whitespace will cause the comparison to fail. The original single-line format was correct.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +16
appconfiguration_connection_string="""
Endpoint=https://fake_app_config.azconfig-test.io;Id=0-l4-s0:h5htBaY5Z1LwFz50bIQv;Secret=lamefakesecretlamefakesecretlamefakesecrett=
""",
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The multi-line string format used here will include leading and trailing whitespace/newlines in the connection string value. This will cause the preparer to use an incorrect connection string that includes newlines and indentation, leading to test failures. The original single-line format was correct.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

App Configuration Azure.ApplicationModel.Configuration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant