Ask the community or our support engineers for answers to questions.
Dear everyone, why does streamlit not recognize the field name of 2022 in Google Sheet? I would attach the code as well. Thank You!
import streamlit as st
from gsheetsdb import connect
import itertools
import streamlit as st
from vega_datasets import data
import pandas as pd
import numpy as np
# Create a connection object.
conn = connect()
# Perform SQL query on the Google Sheet.
# Uses st.cache to only rerun when the query changes or after 10 min.
@st.cache(ttl=600)
def run_query(query):
rows = conn.execute(query, headers=1)
rows = rows.fetchall()
return rows
sheet_url = st.secrets["public_gsheets_url"]
rows = run_query(f'SELECT * FROM "{sheet_url}"')
st.line_chart(rows, x="Date", y=["2022","Alarm","Flood"])