Skip to content

column_config.ProgressColumn clips raw data values in "Download as CSV" export #14244

@dmhpx

Description

@dmhpx

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

When using st.column_config.ProgressColumn, setting a max_value that is lower than the actual data value (e.g., data is 11 but max_value is 10) causes the built-in "Download as CSV" feature to export the clipped max_value instead of the original raw data. This leads to data integrity loss in exports.

Reproducible Code Example

import streamlit as st
import pandas as pd

df = pd.DataFrame({"Real Data": [7, 11, 3, 2]})

st.dataframe(
    df,
    column_config={
        "Real Data": st.column_config.ProgressColumn(
            "Displayed Data",
            min_value=0,
            max_value=10,
            format="%d",
        ),
    },
)

Steps To Reproduce

  1. Run the app.
  2. Observe that the second row shows a "Full" progress bar of 11/10 (visually correct).
  3. Click the built-in "Download as CSV" button in the dataframe toolbar.
  4. Open the CSV. Attached an example here.

Expected Behavior

The "Actual Data" column in the CSV should show

7
11
3
2

Current Behavior

Right now the CSV shows

7
10
3
2

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.55.0
  • Python version: 3.12.10
  • Operating System: Windows 11 Pro
  • Browser: Edge

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:st.column_configRelated to column configuration functionalityfeature:st.dataframeRelated to the `st.dataframe` elementpriority:P4Low prioritystatus:confirmedBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions