Skip to content

Commit

Permalink
Do not show a notice if there is no resource state for schema (#1300)
Browse files Browse the repository at this point in the history
* Do not show a notice if there is no resource state for schema

* Skip early if there is not resource state
  • Loading branch information
sultaniman committed Apr 30, 2024
1 parent 8af5df1 commit 8fc9361
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dlt/helpers/streamlit_app/blocks/resource_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def resource_state_info(
sources_state = pipeline.state.get("sources") or {}
schema = sources_state.get(schema_name, {})
resource = schema.get("resources", {}).get(resource_name)
with st.expander("Resource state", expanded=(resource is None)):
if not resource:
st.info(f"{resource_name} is missing resource state")
else:
spec = yaml.safe_dump(resource)
st.code(spec, language="yaml")
if not resource:
return

with st.expander("Resource state", expanded=False):
spec = yaml.safe_dump(resource)
st.code(spec, language="yaml")

0 comments on commit 8fc9361

Please sign in to comment.