Skip to content

fix typing issue #155

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

Merged
merged 1 commit into from
May 29, 2025
Merged

fix typing issue #155

merged 1 commit into from
May 29, 2025

Conversation

vishalvvr
Copy link
Contributor

@vishalvvr vishalvvr commented May 29, 2025

Error:

s3_resource: boto3.resource, bucket_name: str, file_paths: str | List
TypeError: unsupported operand type(s) for |: 'type' and '_SpecialGenericAlias'

How to reproduce

Run function delete_files from opl/s3_tools.py script with python3.9

Fix:

Use typing.Union instead of | because | is not supported in python versions < 3.10

ref: https://docs.python.org/3/library/typing.html#typing.Union

Syntax Python 3.9 and below Python 3.10+ Python 3.12+
Union[str, List[str]] ✅ Supported ✅ Supported ✅ Supported
`str list[str]` ❌ Not supported ✅ Supported

@vishalvvr vishalvvr self-assigned this May 29, 2025
@vishalvvr vishalvvr added the bug Something isn't working label May 29, 2025
@vishalvvr vishalvvr requested a review from jhutar May 29, 2025 03:09
@jhutar jhutar merged commit 99793c7 into main May 29, 2025
6 checks passed
@jhutar
Copy link
Contributor

jhutar commented May 29, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants