Repository navigation
Generate synchronous client APIs - #122
Conversation
f89e6f9 to
a6ac6ad
Compare
a6ac6ad to
8fbc9c5
Compare
AlexDaines
left a comment
There was a problem hiding this comment.
aws-credentials-imds and aws-credentials-http still pin smithy-aws-core~=0.12.0 and use the old entry-point group, so they can't be installed with the new sts or any of the 25 clients (all ~=0.13.0). They also import IdentityResolver and HTTPClient, which 0.10 / 0.7 dropped. Is their migration planned, here or before the next release?
Also, the README, docs/index.md and the polly / transcribe-streaming examples still import Async* from <pkg>.client. Those moved to <pkg>.aio.
jonathan343
left a comment
There was a problem hiding this comment.
Looks good to me overall. We will need a follow up to get docs working and sync credential chain working
| original_message: str | None = None | ||
| """Original error message from the model.""" | ||
| return globals().setdefault(name, operation) | ||
| return _registry.build(name) |
There was a problem hiding this comment.
This is an AI comment. Posting so I don't forget and can look into it sometime in the future
This registry pattern is shared across the generated clients. Resolving a union name through the new registry returns an unrelated marker class, while models.pyi still describes a union of the variant classes. For example:
from aws_sdk_bedrock_runtime.models import ContentBlock, ContentBlockText
isinstance(ContentBlockText(value="hi"), ContentBlock)This returns True on the base and False on the PR. Likewise, typing.get_args(ContentBlock) now returns an empty tuple. Existing dispatch/validation code can silently change behavior even though it still type-checks. Could the public name resolve lazily to the actual union of the generated variants rather than the registry's marker class?
| from .user_agent import aws_user_agent_plugin | ||
|
|
||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class AsyncSageMakerRuntimeHTTP2Client(AsyncClient): | ||
| class SageMakerRuntimeHTTP2Client(Client[SageMakerRuntimeHTTP2Config]): |
There was a problem hiding this comment.
We should either not generate this or throw an error in __init__ saying this client is only available in the async version
| client_module = package.modules["client"] | ||
| config_module = package.modules["config"] | ||
| models_module = package.modules["models"] | ||
| client_module = package["aio.client"] |
There was a problem hiding this comment.
Doesn't need to be in this PR, but our team will need to follow up w/ a PR for documenting the sync clients as well. Just noting so we don't forget
Bumps the version of smithy-python being targeted to latest, including BDD endpoints and sync client APIs.
adds changelog fragmentsLook at individual commits to filter out the large codegen diff.