Skip to content

Conversation

@viren-nadkarni
Copy link
Member

@viren-nadkarni viren-nadkarni commented Nov 29, 2023

Motivation

Use of subscriptable types broke CLI tests in for older Python version, specifically the cli-tests (3.8) job.

This PR makes use of backward-compatible type hints.

@viren-nadkarni viren-nadkarni self-assigned this Nov 29, 2023
@viren-nadkarni viren-nadkarni added the semver: patch Non-breaking changes which can be included in patch releases label Nov 29, 2023
@viren-nadkarni viren-nadkarni marked this pull request as ready for review November 29, 2023 08:36

def fix_account_id_in_arns(
response, replacement: str, colon_delimiter: str = ":", existing: str | list[str] = None
response, replacement: str, colon_delimiter: str = ":", existing: str | List[str] = None
Copy link
Member

@alexrashed alexrashed Nov 29, 2023

Choose a reason for hiding this comment

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

The type operator for union types (|) was introduced with 3.10, so this won't fix the issue I'm afraid...

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 CLI Tests / cli-tests (3.8) job seems to be passing but I've gone ahead and changed this in 5f755f2

@github-actions
Copy link

LocalStack Community integration with Pro

       2 files         2 suites   1h 8m 46s ⏱️
2 371 tests 2 057 ✔️ 314 💤 0
2 372 runs  2 057 ✔️ 315 💤 0

Results for commit 5f755f2.

@coveralls
Copy link

Coverage Status

coverage: 84.155% (+0.01%) from 84.141%
when pulling 5f755f2 on use-compatible-types
into e13bb88 on master.

@alexrashed alexrashed changed the title Use compatible types fix type hints incompatible with python < 3.10 in aws_stack Nov 29, 2023
Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

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

Thanks for jumping on this! 🚀 🧹 💚

@alexrashed alexrashed merged commit 4b7482d into master Nov 29, 2023
@alexrashed alexrashed deleted the use-compatible-types branch November 29, 2023 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants