I have a problem running my app, I get the warining that beta_columns are outdated but I have already replaced all instances of beta_columns from my code.
Hi @Josip_Tolusic, and welcome to the Streamlit community!
A few things you can check:
- Have you cleared your cache?
- Have you downloaded the latest version of Streamlit?
- Are you sure you’ve replaced every single instances of
beta_columns
?
Let me know how it goes
Thanks,
Charly
Hi @Charly_Wargnier, sorry for late response.
- I’ve cleared my cache multiple times
- I’ve deployed to heroku, from the console I see that the version downloaded is streamlit-0.86.0
- I’ve replaced all instances with replace all and I cant see any instace of beta_columns
I dont have any idea anymore what can be the reason.
Hi, thanks for your help and fast responses. But I’ve figured it out, I’ve been using streamlit_metrics package, and this package uses beta_columns in code.
Thnaks for your help,
Josip
Great to hear that!
Happy Streamlitin’!
Best,
Charly
Hi,
Getting same warning on beta_columns when using streamlit_meterics.
Do we know if streamlit_metrics will be updated? Or how to suppress the warning?
Thanks!
Hi, you can use this in your code, and replace beta_columns with columns:
def _build_metric(label, value):
html_text = """
<style>
.metric {
font-family: "IBM Plex Sans", sans-serif;
text-align: center;
}
.metric .value {
font-size: 48px;
line-height: 1.6;
}
.metric .label {
letter-spacing: 2px;
font-size: 14px;
text-transform: uppercase;
}
</style>
<div class="metric">
<div class="value">
{{ value }}
</div>
<div class="label">
{{ label }}
</div>
</div>
"""
html = Template(html_text)
return html.render(label=label, value=value)
def metric_row(data):
columns = st.beta_columns(len(data))
for i, (label, value) in enumerate(data.items()):
with columns[i]:
components.html(_build_metric(label, value))
def metric(label, value):
components.html(_build_metric(label, value))
The way I managed to solve it was by changing the code directly in the library streamlit_metrics in the def metric_row function:
def metric_row(data):
columns = st.columns(len(data))
for i, (label, value) in enumerate(data.items()):
with columns[i]:
components.html(_build_metric(label, value))