Beta columns waring showing even after I've replaced it with st.columns

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.

1 Like

Hi @Josip_Tolusic, and welcome to the Streamlit community! :balloon::raised_hands:

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 :slight_smile:

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.

1 Like

Thanks for your answer @Josip_Tolusic!

Would it be possible to share the code?

Thanks
Charly

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

1 Like

Great to hear that!

Happy Streamlitin’! :balloon::raised_hands:

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))