Skip to content

Commit

Permalink
Skip early if there is not resource state
Browse files Browse the repository at this point in the history
  • Loading branch information
sultaniman committed Apr 29, 2024
1 parent 3174f8f commit e574beb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dlt/helpers/streamlit_app/blocks/resource_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +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)
if resource:
with st.expander("Resource state", expanded=False):
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 e574beb

Please sign in to comment.