File: run_arrow_wide.py

package info (click to toggle)
textual-fastdatatable 0.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,052 kB
  • sloc: python: 3,461; makefile: 29
file content (33 lines) | stat: -rw-r--r-- 847 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from __future__ import annotations

from pathlib import Path

from textual.app import App, ComposeResult
from textual.driver import Driver
from textual.types import CSSPathType

from textual_fastdatatable import DataTable

BENCHMARK_DATA = Path(__file__).parent.parent / "tests" / "data"


class ArrowBackendApp(App):
    TITLE = "FastDataTable (Arrow)"

    def __init__(
        self,
        data_path: Path,
        driver_class: type[Driver] | None = None,
        css_path: CSSPathType | None = None,
        watch_css: bool = False,
    ):
        super().__init__(driver_class, css_path, watch_css)
        self.data_path = data_path

    def compose(self) -> ComposeResult:
        yield DataTable(data=self.data_path)


if __name__ == "__main__":
    app = ArrowBackendApp(data_path=BENCHMARK_DATA / "wide_100000.parquet")
    app.run()