Skip to content

Conversation

@Amichelangelo
Copy link
Member

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:

  • 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.

…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).
@github-actions
Copy link

github-actions bot commented Sep 24, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-ai-language-questionanswering-authoring

@Amichelangelo
Copy link
Member Author

/azp run python - cognitivelanguage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Amichelangelo Amichelangelo marked this pull request as ready for review September 28, 2025 09:54
Copilot AI review requested due to automatic review settings September 28, 2025 09:54
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 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):
Copy link

Copilot AI Sep 28, 2025

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').

Suggested change
class AssestKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
class AssetKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):

Copilot uses AI. Check for mistakes.
Copy link
Member

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,
Copy link

Copilot AI Sep 28, 2025

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.

Copilot uses AI. Check for mistakes.
"UpdateSourceFromFileOperationRecord",
"UpdateSourceRecord",
"WordAlterations",
"AssestKind",
Copy link

Copilot AI Sep 28, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Member

@sarkar-rajarshi sarkar-rajarshi left a 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

from ._patch import patch_sdk as _patch_sdk

__all__ = [
"QuestionAnsweringAuthoringClient",
Copy link
Member

Choose a reason for hiding this comment

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

Could we mention to the review board that previously this was called as AuthoringClient
image

And we want to release this as QuestionAnsweringAuthoringClient. Is that okay?

| Previous (Combined) | New Authoring Package |
|---------------------|-----------------------|
| Install: `azure-ai-language-questionanswering` | Install: `azure-ai-language-questionanswering-authoring` |
| Client: `AuthoringClient` | Client: `QuestionAnsweringAuthoringClient` |
Copy link
Member

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
Copy link
Member

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?

Copy link
Member Author

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

"""Mixin class for patching methods with backward compatible parameter names."""

# create_project overloads with 'options' parameter
@overload # type: ignore
Copy link
Member

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?

Copy link
Member Author

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."""
Copy link
Member

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.

Copy link
Member Author

@Amichelangelo Amichelangelo Oct 31, 2025

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):
Copy link
Member

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.

return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore

@distributed_trace
def get_delete_status(
Copy link
Member

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.

Copy link
Member Author

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(
Copy link
Member

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

Copy link
Member Author

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
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