python < 3.10 need to use Union for multiple return types

This commit is contained in:
brmnjsh 2023-09-03 21:47:13 +00:00
parent 0e05045817
commit fc42f0c5c1

View File

@ -1,6 +1,7 @@
import boto3
import io
from typing import Union
from lib.application_configs import ApplicationConfigs
session = boto3.Session(
@ -30,7 +31,7 @@ def get_object(key: str, bucket: str) -> bytes:
Key=key,
)['Body'].read()
def get_object_tag(key: str, bucket: str, tag_key: str) -> str | None:
def get_object_tag(key: str, bucket: str, tag_key: str) -> Union[str, None]:
tags = get_object_tags(key, bucket)
tag_index = 0