-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[SDK Release] (Python) CQA authoring 2025-05-15-preview #43117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ering-authoring package (packaging, samples, tests, migration guide) Summary: Packaging & metadata: Added sdk_packaging.toml (python_min=3.9; deps: azure-core, isodate, conditional typing-extensions) Added setup.py aligned with sdk_packaging.toml Preserved/added pyproject.toml (generator structure) Added initial CHANGELOG.md (1.0.0b1 draft) Rewrote README.md to focus exclusively on authoring features Added migration_guide_authoring.md (split rationale & upgrade steps) Added dev_requirements.txt (devtools_testutils, pytest, pytest-asyncio, aiohttp) Samples: Added sync samples: sample_create_and_deploy_project.py, sample_export_import_project.py, sample_update_knowledge_sources.py Added async counterparts under samples/authoring/async_samples/ Added README.md (authoring-only guidance) Tests: Added trimmed conftest.py (reduced env vars + essential sanitizers) Added testcase.py (QuestionAnsweringAuthoringTestCase with playback polling_interval=0) Added helpers.py (AuthoringTestHelper + AuthoringAsyncTestHelper) Added sync tests: test_create_and_deploy_project.py, test_export_import_project.py, test_update_knowledge_sources.py Added async tests: test_create_and_deploy_project_async.py, test_export_import_project_async.py, test_update_knowledge_sources_async.py Consistency & cleanup: Client renamed to QuestionAnsweringAuthoringClient (+ aio variant) Unified project name spelling to IsaacNewton Removed runtime query samples/tests (authoring-only scope) Simplified helper logic and removed unused parameters Deferred assets.json (not required until live resource orchestration is needed) Future follow-ups (not included in this commit): TypeSpec recompile & regeneration validation Optional AAD TokenCredential test coverage Potential runtime package split / publication Live test infra (assets.json) if/when enabled BREAKING CHANGE: Users of authoring functionality must install the new package and replace AuthoringClient with QuestionAnsweringAuthoringClient (import namespace remains in the authoring subtree).
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
|
/azp run python - cognitivelanguage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this 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 introduces a new Python SDK for Azure AI Language Question Answering Authoring, implementing the 2025-05-15-preview API version. This is a new authoring-only package that splits from the previous combined package to provide focused functionality for project management operations.
Key Changes
- New SDK package:
azure-ai-language-questionanswering-authoring - Complete client implementation with sync/async support for authoring operations
- Comprehensive test coverage for project creation, deployment, export/import, and knowledge source management
Reviewed Changes
Copilot reviewed 57 out of 59 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tsp-location.yaml | API specification reference configuration |
| setup.py | Package setup and dependency configuration |
| _client.py & aio/_client.py | Main client implementations for sync/async operations |
| models/ | Generated model classes and enums for API data structures |
| tests/ | Comprehensive test suite covering all major operations |
| samples/ | Example code demonstrating SDK usage patterns |
| from azure.core import CaseInsensitiveEnumMeta | ||
|
|
||
|
|
||
| class AssestKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The enum name 'AssestKind' should be 'AssetKind' (missing 's').
| class AssestKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): | |
| class AssetKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in the model name. Looks like this needs to be fixed in the spec.
| ) | ||
|
|
||
| from ._enums import ( # type: ignore | ||
| AssestKind, |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import and export of 'AssestKind' should be 'AssetKind' to match the corrected enum name.
| "UpdateSourceFromFileOperationRecord", | ||
| "UpdateSourceRecord", | ||
| "WordAlterations", | ||
| "AssestKind", |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import and export of 'AssestKind' should be 'AssetKind' to match the corrected enum name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good. few small comments
...stionanswering-authoring/azure/ai/language/questionanswering/authoring/_operations/_patch.py
Show resolved
Hide resolved
...cognitivelanguage/azure-ai-language-questionanswering-authoring/migration_guide_authoring.md
Outdated
Show resolved
Hide resolved
...answering-authoring/azure/ai/language/questionanswering/authoring/_operations/_operations.py
Show resolved
Hide resolved
...answering-authoring/azure/ai/language/questionanswering/authoring/_operations/_operations.py
Show resolved
Hide resolved
...answering-authoring/azure/ai/language/questionanswering/authoring/_operations/_operations.py
Show resolved
Hide resolved
sdk/cognitivelanguage/azure-ai-language-questionanswering-authoring/README.md
Outdated
Show resolved
Hide resolved
| from ._patch import patch_sdk as _patch_sdk | ||
|
|
||
| __all__ = [ | ||
| "QuestionAnsweringAuthoringClient", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | Previous (Combined) | New Authoring Package | | ||
| |---------------------|-----------------------| | ||
| | Install: `azure-ai-language-questionanswering` | Install: `azure-ai-language-questionanswering-authoring` | | ||
| | Client: `AuthoringClient` | Client: `QuestionAnsweringAuthoringClient` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make it a point to ask this to the review board
|
|
||
| ```bash | ||
| pip uninstall azure-ai-language-questionanswering -y # if previously installed | ||
| pip install --pre azure-ai-language-questionanswering-authoring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this --pre?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a beta version
...cognitivelanguage/azure-ai-language-questionanswering-authoring/migration_guide_authoring.md
Show resolved
Hide resolved
2. import -> begin_import_assets 3. format -> file_format
sdk/cognitivelanguage/azure-ai-language-questionanswering-authoring/CHANGELOG.md
Outdated
Show resolved
Hide resolved
| """Mixin class for patching methods with backward compatible parameter names.""" | ||
|
|
||
| # create_project overloads with 'options' parameter | ||
| @overload # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An overload should not need a #type: ignore - what was the error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ignore was suppressing a mypy [override] error caused by renaming the parameter from 'body' to 'options'
| JSON = MutableMapping[str, Any] | ||
|
|
||
| class _QuestionAnsweringAuthoringClientOperationsMixin(_QuestionAnsweringAuthoringClientOperationsMixinGenerated): | ||
| """Mixin class for patching methods with backward compatible parameter names.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use code gen to generate the correct names - we do not need to use patching for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@annatisch about "code gen to generate the correct names", do you mean update the parameters' name in typespecs instead of write overload?
I see the .net project can use tag like [CodeGenMember] to rename, but haven't find the same thing in python.
| from azure.core import CaseInsensitiveEnumMeta | ||
|
|
||
|
|
||
| class AssestKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in the model name. Looks like this needs to be fixed in the spec.
...cognitivelanguage/azure-ai-language-questionanswering-authoring/migration_guide_authoring.md
Outdated
Show resolved
Hide resolved
...cognitivelanguage/azure-ai-language-questionanswering-authoring/migration_guide_authoring.md
Outdated
Show resolved
Hide resolved
sdk/cognitivelanguage/azure-ai-language-questionanswering-authoring/pyproject.toml
Show resolved
Hide resolved
sdk/cognitivelanguage/azure-ai-language-questionanswering-authoring/setup.py
Outdated
Show resolved
Hide resolved
| return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore | ||
|
|
||
| @distributed_trace | ||
| def get_delete_status( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This API (and the response model) don't need to be public. We use the LROPoller object to be the way people check the operation status.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hide in patch file, will remove hide this in typespecs in next version
| return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore | ||
|
|
||
| @distributed_trace | ||
| def get_export_status( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above - we should be able to hide the get_[operation]_status APIs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hide in patch file, will remove hide this in typespecs in next version
add dependency on azure-ai-language-questionanswering

Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines