Workflow Fixes (#156)

This commit is contained in:
Kerem Yilmaz 2024-04-04 19:09:19 -07:00 committed by GitHub
parent 8117395d73
commit 0800990627
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 350 additions and 108 deletions

View file

@ -132,6 +132,12 @@ class DownloadToS3BlockYAML(BlockYAML):
url: str
class UploadToS3BlockYAML(BlockYAML):
block_type: Literal[BlockType.UPLOAD_TO_S3] = BlockType.UPLOAD_TO_S3 # type: ignore
path: str | None = None
class SendEmailBlockYAML(BlockYAML):
# There is a mypy bug with Literal. Without the type: ignore, mypy will raise an error:
# Parameter 1 of Literal[...] cannot be of type "Any"
@ -160,7 +166,13 @@ PARAMETER_YAML_SUBCLASSES = (
PARAMETER_YAML_TYPES = Annotated[PARAMETER_YAML_SUBCLASSES, Field(discriminator="parameter_type")]
BLOCK_YAML_SUBCLASSES = (
TaskBlockYAML | ForLoopBlockYAML | CodeBlockYAML | TextPromptBlockYAML | DownloadToS3BlockYAML | SendEmailBlockYAML
TaskBlockYAML
| ForLoopBlockYAML
| CodeBlockYAML
| TextPromptBlockYAML
| DownloadToS3BlockYAML
| UploadToS3BlockYAML
| SendEmailBlockYAML
)
BLOCK_YAML_TYPES = Annotated[BLOCK_YAML_SUBCLASSES, Field(discriminator="block_type")]