Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

typing: update Events and STS typing#13862

Merged
bentsku merged 1 commit into
mainfrom
improve-union-handling
Feb 27, 2026
Merged

typing: update Events and STS typing#13862
bentsku merged 1 commit into
mainfrom
improve-union-handling

Conversation

@bentsku
Copy link
Copy Markdown
Contributor

@bentsku bentsku commented Feb 27, 2026

Motivation

When working on the new serialization framework, some type hints were not supported. Unions of mutable types like sequences (list, set) and other types are not supported.

For such basic types, it is easier to make them as dict[str, Any], even if it makes less readable/usable, the framework can handle that. Sorry!

Changes

  • update type hints to not have mutable container unions

Tests

Related

@bentsku bentsku added this to the 2026.03 milestone Feb 27, 2026
@bentsku bentsku requested a review from giograno February 27, 2026 16:22
@bentsku bentsku self-assigned this Feb 27, 2026
@bentsku bentsku added semver: patch Non-breaking changes which can be included in patch releases docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes labels Feb 27, 2026
@bentsku bentsku changed the title Typing: improve Events and STS typing typing: improve Events and STS typing Feb 27, 2026
@github-actions
Copy link
Copy Markdown

Test Results - Preflight, Unit

23 070 tests  ±0   21 179 ✅ ±0   6m 15s ⏱️ +7s
     1 suites ±0    1 891 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit e45f2f0. ± Comparison against base commit 372c575.

@github-actions
Copy link
Copy Markdown

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 3s ⏱️ ±0s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit e45f2f0. ± Comparison against base commit 372c575.

@github-actions
Copy link
Copy Markdown

Test Results - Alternative Providers

407 tests   274 ✅  3m 21s ⏱️
  1 suites  133 💤
  1 files      0 ❌

Results for commit e45f2f0.

@github-actions
Copy link
Copy Markdown

Test Results (amd64) - Integration, Bootstrap

    5 files      5 suites   2h 3m 14s ⏱️
3 731 tests 3 497 ✅ 234 💤 0 ❌
3 737 runs  3 497 ✅ 240 💤 0 ❌

Results for commit e45f2f0.

@github-actions
Copy link
Copy Markdown

LocalStack Community integration with Pro

    2 files  ±    0      2 suites  ±0   1h 35m 25s ⏱️ - 31m 4s
3 707 tests  - 1 632  3 469 ✅  - 1 499  238 💤  - 133  0 ❌ ±0 
3 709 runs   - 1 632  3 469 ✅  - 1 499  240 💤  - 133  0 ❌ ±0 

Results for commit e45f2f0. ± Comparison against base commit 372c575.

This pull request removes 1632 tests.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…

@bentsku bentsku changed the title typing: improve Events and STS typing typing: update Events and STS typing Feb 27, 2026
@bentsku bentsku marked this pull request as ready for review February 27, 2026 17:52
Copy link
Copy Markdown
Member

@pinzon pinzon left a comment

Choose a reason for hiding this comment

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

Approving since the changes are not critical for the STS service, but it's somewhat disappointing that Avro is going to limit our usage of type hinting.

Copy link
Copy Markdown
Contributor Author

bentsku commented Feb 27, 2026

I agree, but I'd also say that having a field being str | list[str] is not great either, as you'd always need to use isinstance(value, list) before doing any operations on it. I think this comes from AWS, but in this case it'd be better to always have a list, even if there's only one value in it?

But yeah, with this change it's also pretty bad because we have no idea of what's in it 😭 here is a blind fix because I need it, but if you think you can update usages, could be nice too 😅

@bentsku bentsku merged commit e3f4ec2 into main Feb 27, 2026
51 checks passed
@bentsku bentsku deleted the improve-union-handling branch February 27, 2026 19:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes semver: patch Non-breaking changes which can be included in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants