From 80c5a1adaabffd5d393fa7c32a9ba18528efd12b Mon Sep 17 00:00:00 2001 From: Sn3llius Date: Fri, 7 Feb 2025 10:41:28 +0100 Subject: [PATCH] fixed example refactoring --- .../project-template-Crypto Dashboard/pages/dashboard_page.py | 4 +--- .../components/new_todo_item_input.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/rio/snippets/snippet-files/project-template-Crypto Dashboard/pages/dashboard_page.py b/rio/snippets/snippet-files/project-template-Crypto Dashboard/pages/dashboard_page.py index e5885c9f..9b99146f 100644 --- a/rio/snippets/snippet-files/project-template-Crypto Dashboard/pages/dashboard_page.py +++ b/rio/snippets/snippet-files/project-template-Crypto Dashboard/pages/dashboard_page.py @@ -1,5 +1,3 @@ -import dataclasses - # from pathlib import Path @@ -39,7 +37,7 @@ class DashboardPage(rio.Component): """ fetch_data_from_api: bool = False - coin_data: pd.DataFrame = dataclasses.field( + coin_data: pd.DataFrame = field( default=pd.DataFrame( { "date": np.zeros(5), diff --git a/rio/snippets/snippet-files/project-template-Todo App/components/new_todo_item_input.py b/rio/snippets/snippet-files/project-template-Todo App/components/new_todo_item_input.py index 2f3f4a9c..e31417ba 100644 --- a/rio/snippets/snippet-files/project-template-Todo App/components/new_todo_item_input.py +++ b/rio/snippets/snippet-files/project-template-Todo App/components/new_todo_item_input.py @@ -1,7 +1,5 @@ from __future__ import annotations -import dataclasses - # import datetime @@ -26,7 +24,7 @@ class NewTodoItemInput(rio.Component): # This is a private field that we need for an attribute binding. We don't # want to create a constructor parameter for this field, so we set # `init=False`. - _title: str = dataclasses.field(init=False, default="") + _title: str = field(init=False, default="") async def _on_confirm( self, _: rio.TextInputConfirmEvent | None = None