Skip to content

Commit b00ff33

Browse files
sh-rpzilto
authored andcommitted
add marimo flag to show command (#2741)
1 parent e4ccab5 commit b00ff33

File tree

3 files changed

+36
-24
lines changed

3 files changed

+36
-24
lines changed

dlt/cli/pipeline_command.py

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -113,30 +113,35 @@ def _display_pending_packages() -> Tuple[Sequence[str], Sequence[str]]:
113113
fmt.echo("Found pipeline %s in %s" % (fmt.bold(p.pipeline_name), fmt.bold(p.pipelines_dir)))
114114

115115
if operation == "show":
116-
from dlt.common.runtime import signals
117-
from dlt.helpers.streamlit_app import index
116+
if command_kwargs.get("marimo"):
117+
from dlt.helpers.studio.runner import run_studio
118118

119-
with signals.delayed_signals():
120-
streamlit_cmd = [
121-
"streamlit",
122-
"run",
123-
index.__file__,
124-
"--client.showSidebarNavigation",
125-
"false",
126-
]
119+
run_studio()
120+
else:
121+
from dlt.common.runtime import signals
122+
from dlt.helpers.streamlit_app import index
123+
124+
with signals.delayed_signals():
125+
streamlit_cmd = [
126+
"streamlit",
127+
"run",
128+
index.__file__,
129+
"--client.showSidebarNavigation",
130+
"false",
131+
]
127132

128-
if hot_reload:
129-
streamlit_cmd.append("--server.runOnSave")
130-
streamlit_cmd.append("true")
133+
if hot_reload:
134+
streamlit_cmd.append("--server.runOnSave")
135+
streamlit_cmd.append("true")
131136

132-
streamlit_cmd.append("--")
133-
streamlit_cmd.append(pipeline_name)
134-
streamlit_cmd.append("--pipelines-dir")
135-
streamlit_cmd.append(p.pipelines_dir)
137+
streamlit_cmd.append("--")
138+
streamlit_cmd.append(pipeline_name)
139+
streamlit_cmd.append("--pipelines-dir")
140+
streamlit_cmd.append(p.pipelines_dir)
136141

137-
venv = Venv.restore_current()
138-
for line in iter_stdout(venv, *streamlit_cmd):
139-
fmt.echo(line)
142+
venv = Venv.restore_current()
143+
for line in iter_stdout(venv, *streamlit_cmd):
144+
fmt.echo(line)
140145

141146
if operation == "info":
142147
state: TSourceState = p.state # type: ignore

dlt/cli/plugins.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def configure_parser(self, pipe_cmd: argparse.ArgumentParser) -> None:
202202
pipeline state set by the resources during the extraction process.
203203
""",
204204
)
205-
pipeline_subparsers.add_parser(
205+
show_cmd = pipeline_subparsers.add_parser(
206206
"show",
207207
help=(
208208
"Generates and launches Streamlit app with the loading status and dataset explorer"
@@ -212,9 +212,15 @@ def configure_parser(self, pipe_cmd: argparse.ArgumentParser) -> None:
212212
213213
This is a simple app that you can use to inspect the schemas and data in the destination as well as your pipeline state and loading status/stats. It should be executed from the same folder from which you ran the pipeline script to access destination credentials.
214214
215-
Requires `streamlit` to be installed in the current environment: `pip install streamlit`.
215+
Requires `streamlit` to be installed in the current environment: `pip install streamlit`. Using --marimo flag to launch marimo app preview instead of streamlit.
216216
""",
217217
)
218+
show_cmd.add_argument(
219+
"--marimo",
220+
default=False,
221+
action="store_true",
222+
help="Launch marimo app preview instead of streamlit",
223+
)
218224
pipeline_subparsers.add_parser(
219225
"failed-jobs",
220226
help=(

docs/website/docs/reference/command-line-interface.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Generates and launches Streamlit app with the loading status and dataset explore
187187

188188
**Usage**
189189
```sh
190-
dlt pipeline [pipeline_name] show [-h]
190+
dlt pipeline [pipeline_name] show [-h] [--marimo]
191191
```
192192

193193
**Description**
@@ -196,7 +196,7 @@ Generates and launches Streamlit (https://streamlit.io/) app with the loading st
196196

197197
This is a simple app that you can use to inspect the schemas and data in the destination as well as your pipeline state and loading status/stats. It should be executed from the same folder from which you ran the pipeline script to access destination credentials.
198198

199-
Requires `streamlit` to be installed in the current environment: `pip install streamlit`.
199+
Requires `streamlit` to be installed in the current environment: `pip install streamlit`. Using --marimo flag to launch marimo app preview instead of streamlit.
200200

201201
<details>
202202

@@ -206,6 +206,7 @@ Inherits arguments from [`dlt pipeline`](#dlt-pipeline).
206206

207207
**Options**
208208
* `-h, --help` - Show this help message and exit
209+
* `--marimo` - Launch marimo app preview instead of streamlit
209210

210211
</details>
211212

0 commit comments

Comments
 (0)