Skip to content
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

Add missing type hints to items property of Column #36

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions adaptive_cards/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

from dataclasses import dataclass, field
from typing import Optional, Union

from dataclasses_json import LetterCase, dataclass_json

from adaptive_cards import elements
from adaptive_cards import inputs
from adaptive_cards import utils
import adaptive_cards.actions as action
import adaptive_cards.card_types as ct
from adaptive_cards import elements, inputs, utils

ContainerTypes = Union[
"ActionSet", "Container", "ColumnSet", "FactSet", "ImageSet", "Table"
Expand All @@ -33,9 +32,9 @@ class ContainerBase:
height: The height style to be applied to the container.
"""

fallback: Optional[
elements.Element | action.ActionTypes | inputs.InputTypes
] = field(default=None, metadata=utils.get_metadata("1.2"))
fallback: Optional[elements.Element | action.ActionTypes | inputs.InputTypes] = (
field(default=None, metadata=utils.get_metadata("1.2"))
)
separator: Optional[bool] = field(default=None, metadata=utils.get_metadata("1.2"))
spacing: Optional[ct.Spacing] = field(
default=None, metadata=utils.get_metadata("1.2")
Expand Down Expand Up @@ -166,7 +165,7 @@ class Column(ContainerBase):
"""

type: str = field(default="Column", metadata=utils.get_metadata("1.0"))
items: Optional[list[elements.Element]] = field(
items: Optional[list[elements.Element | ContainerTypes | inputs.Input]] = field(
default=None, metadata=utils.get_metadata("1.0")
)
background_image: Optional[ct.BackgroundImage | str] = field(
Expand Down
Loading