Skip to content

Commit

Permalink
fix typing issue in python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayka committed Oct 12, 2023
1 parent 359cd88 commit 9d352bc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
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

0 comments on commit 9d352bc

Please sign in to comment.