sis-patterns

Provide standardized coding patterns for Streamlit-in-Snowflake session management, reruns, and widget safety.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/moniburnejko/coco-quiz-app --skill sis-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sis-patterns
Source: https://github.com/moniburnejko/coco-quiz-app/tree/main/.snowflake/cortex/skills/sis/patterns
Command: npx skills add https://github.com/moniburnejko/coco-quiz-app --skill sis-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides proven coding patterns for building Streamlit in Snowflake (SiS) apps, ensuring robust session management, controlled reruns, safe API usage, and reliable widget behavior.

Core Features & Use Cases

  • Session Management: guidance on obtaining active sessions inside cached and non-cached contexts to avoid stale connections.
  • Rerun Budget and Widget Safety: rules for limiting st.rerun usage, stabilizing UI state, and safeguarding interactive elements.
  • API Compatibility and Validation: practices to avoid unsupported APIs and enforce explicit keys and bind parameters.
  • Programmatic Navigation and State Reliability: patterns for programmatic redirects, session_state durability, and dedup logic.

Quick Start

Use these patterns to implement robust SiS apps by managing sessions, reruns, widget state, and safe API usage.

Frequently Asked Questions about sis-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage session state in Streamlit in Snowflake to avoid stale connections?

To manage Streamlit in Snowflake session state safely, use get_active_session inside cached functions. This pattern prevents stale Snowflake connections and ensures reliable session management across your application.

What is the best way to control st.rerun usage in SiS applications?

The best way to control st.rerun in Streamlit in Snowflake is to limit rerun locations and enforce deterministic rerun budgets. This stabilizes UI state and safeguards interactive elements from unnecessary refreshes.

How do I safely execute SQL queries with parameter binding in Streamlit in Snowflake?

To safely execute SQL in Streamlit in Snowflake, apply parameter binding practices. This approach enforces safe API usage and prevents vulnerabilities by separating SQL logic from data inputs.

Why do my Streamlit widgets lose their state during reruns in Snowflake?

Widgets lose state during Streamlit in Snowflake reruns due to missing explicit keys. Assigning explicit widget keys and following programmatic navigation patterns ensures session_state durability and interaction safety.

Does this approach help with programmatic navigation and redirects in SiS?

Yes, these Streamlit in Snowflake patterns support programmatic navigation and redirects. They provide session_state durability and dedup logic to ensure robust UI state management during programmatic redirects.