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

Fix typehints for start_data #381

Merged
merged 2 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/aiogram_dialog/api/protocols/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def process_close(
async def process_start(
self,
manager: "DialogManager",
start_data: Any,
start_data: Data,
state: Optional[State] = None,
) -> None:
raise NotImplementedError
Expand Down
2 changes: 1 addition & 1 deletion src/aiogram_dialog/api/protocols/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def dialog_data(self) -> Dict:

@property
@abstractmethod
def start_data(self) -> Dict:
def start_data(self) -> Data:
"""Start data for current context."""
raise NotImplementedError

Expand Down
2 changes: 1 addition & 1 deletion src/aiogram_dialog/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def states(self) -> List[State]:
async def process_start(
self,
manager: DialogManager,
start_data: Any,
start_data: Data,
state: Optional[State] = None,
) -> None:
if state is None:
Expand Down
2 changes: 1 addition & 1 deletion src/aiogram_dialog/manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def dialog_data(self) -> Dict:
return self.current_context().dialog_data

@property
def start_data(self) -> Dict:
def start_data(self) -> Data:
"""Start data for current context."""
return self.current_context().start_data

Expand Down
2 changes: 1 addition & 1 deletion src/aiogram_dialog/manager/sub_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def dialog_data(self) -> Dict:
return self.current_context().dialog_data

@property
def start_data(self) -> Dict:
def start_data(self) -> Data:
"""Start data for current context."""
return self.manager.start_data

Expand Down
2 changes: 1 addition & 1 deletion src/aiogram_dialog/tools/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ async def mark_closed(self) -> None:
pass

@property
def start_data(self) -> Dict:
def start_data(self) -> Data:
return {}

@property
Expand Down
Loading