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: typing issue in python 3.8 #201

Merged
merged 1 commit into from
Oct 12, 2023
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
3 changes: 2 additions & 1 deletion marimo/_server/api/set_cell_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

from dataclasses import dataclass
from typing import Dict

import tornado.web

Expand All @@ -14,7 +15,7 @@
@dataclass
class SetCellConfig:
# Map from Cell ID to (possibily partial) CellConfig
configs: dict[CellId_t, dict[str, object]]
configs: Dict[CellId_t, Dict[str, object]]


class SetCellConfigHandler(tornado.web.RequestHandler):
Expand Down
12 changes: 12 additions & 0 deletions marimo/_server/api/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
from dataclasses import asdict, dataclass
from typing import Any, Dict, List, Tuple

from marimo._server import api
from marimo._server.api.model import parse_raw
from marimo._server.api.set_cell_config import SetCellConfig


@dataclass
Expand Down Expand Up @@ -114,3 +116,13 @@ class Nested:

parsed = parse_raw(serialize(nested), Nested)
assert parsed == nested

def test_set_cell_config(self) -> None:
config = SetCellConfig(
{"0": {"disabled": True}, "1": {"disabled": False}}
)
parsed = parse_raw(
serialize(config), api.set_cell_config.SetCellConfig
)
print(parsed)
assert parsed == config
1 change: 1 addition & 0 deletions marimo/_smoke_tests/altair_charts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2023 Marimo. All rights reserved.
import marimo

__generated_with = "0.1.24"
Expand Down
Loading