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