Skip to content

Commit

Permalink
moves load info around
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfix committed Mar 20, 2024
1 parent ee1c0e4 commit 4b7e052
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 32 deletions.
5 changes: 4 additions & 1 deletion dlt/cli/_dlt.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,10 @@ def main() -> int:
"--list-pipelines", "-l", default=False, action="store_true", help="List local pipelines"
)
pipe_cmd.add_argument(
"--hot-reload", default=False, action="store_true", help="Reload streamlit app (for core development)"
"--hot-reload",
default=False,
action="store_true",
help="Reload streamlit app (for core development)",
)
pipe_cmd.add_argument("pipeline_name", nargs="?", help="Pipeline name")
pipe_cmd.add_argument("--pipelines-dir", help="Pipelines working directory", default=None)
Expand Down
1 change: 0 additions & 1 deletion dlt/helpers/streamlit_app/blocks/load_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def last_load_info(pipeline: dlt.Pipeline) -> None:
rel_time = "---"
last_load_id = "---"

st.subheader("Last load info", divider="rainbow")
stat("Last load time", rel_time, border_left_width=4)
stat("Last load id", last_load_id)
stat("Total number of loads", loads_no)
2 changes: 0 additions & 2 deletions dlt/helpers/streamlit_app/blocks/menu.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import dlt
import streamlit as st

from dlt.helpers.streamlit_app.blocks.pipeline_state import pipeline_state_info
from dlt.helpers.streamlit_app.utils import HERE
from dlt.helpers.streamlit_app.widgets import logo, mode_selector
from dlt.helpers.streamlit_app.widgets import pipeline_summary
Expand All @@ -12,5 +11,4 @@ def menu(pipeline: dlt.Pipeline) -> None:
logo()
st.page_link(f"{HERE}/pages/dashboard.py", label="Explore data", icon="🕹️")
st.page_link(f"{HERE}/pages/load_info.py", label="Load info", icon="💾")
pipeline_state_info(pipeline)
pipeline_summary(pipeline)
26 changes: 0 additions & 26 deletions dlt/helpers/streamlit_app/blocks/pipeline_state.py

This file was deleted.

11 changes: 9 additions & 2 deletions dlt/helpers/streamlit_app/pages/load_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


def write_load_status_page(pipeline: Pipeline) -> None:
"""Display pipeline loading information. Will be moved to dlt package once tested"""
"""Display pipeline loading information."""

try:
loads_df = query_data_live(
Expand Down Expand Up @@ -108,11 +108,18 @@ def show_state_versions(pipeline: dlt.Pipeline) -> None:
border_left_width=4,
)

if remote_state_version != str(local_state["_state_version"]):
st.text("")
st.warning(
"Looks like that local state is not yet synchronized or synchronization is disabled",
icon="⚠️",
)


def show(pipeline: dlt.Pipeline) -> None:
st.subheader("Load info", divider="rainbow")
write_load_status_page(pipeline)
last_load_info(pipeline)
write_load_status_page(pipeline)
show_state_versions(pipeline)

with st.sidebar:
Expand Down

0 comments on commit 4b7e052

Please sign in to comment.