Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st.dataframe is creating a pair of invisible quotes since 1.23.0 for data entries with commas in the text #7032

Closed
4 tasks done
anirudhkaushik008 opened this issue Jul 18, 2023 · 7 comments · Fixed by #7779
Labels
feature:st.data_editor feature:st.dataframe priority:P3 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working

Comments

@anirudhkaushik008
Copy link

anirudhkaushik008 commented Jul 18, 2023

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

I did not have this problem with streamlit 1.22.0
When you have a dataframe that has a column with strings and has a commas within the string, the dataframe is created and displayed normally. However when you select the dataframe and copy it over to say, excel, the entries that had a comma within the string appears with quotes around them. And it is only for those strings that have a comma in them.
This started with whatever amount of sweeping updates that happened with st.dataframe or st.data_editor in 1.23.0. I tried downgrading to 1.22.0 and the issue resolved itself

Reproducible Code Example

Open in Streamlit Cloud

import streamlit as st
import pandas as pd


df = pd.DataFrame({
    'col1': [1,2],
    'col2': ['asdf,jklh','qwerrtyu']
})

st.dataframe(df)

Steps To Reproduce

  1. Have streamlit version 1.23.0 or higher.
  2. Run the .py script
  3. Look at the dataframe and notice that there are no quotes
  4. Select and copy the dataframe over to excel
  5. Notice that only the one entry with a comma in it has quotes around it

Expected Behavior

With an older version, the dataframe is printed as it should be

Current Behavior

The entry asdf,jklh has a comma in the string and therefore appears as "asdf,jklh" when copying it to any text editor or spreadsheet

Is this a regression?

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

Debug info

  • Streamlit version: 1.23.1
  • Python version: 3.10.9
  • Operating System: Windows 10
  • Browser: Google Chrome

Additional Information

No response

@anirudhkaushik008 anirudhkaushik008 added status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working labels Jul 18, 2023
@carolinedlu
Copy link
Collaborator

Thanks for sharing this, @anirudhkaushik008! I was able to reproduce this with Excel and Streamlit version 1.25.0 – asdf,jklh is wrapped in double quotes but qwerrtyu is not.

Screenshot 2023-07-25 at 6 07 11 PM

@anirudhkaushik008
Copy link
Author

Yes, now to see if someone can figure out where the bug is coming from. There is no reason this should exist

@LukasMasuch LukasMasuch added status:confirmed Bug has been confirmed by the Streamlit team priority:P3 and removed status:needs-triage Has not been triaged by the Streamlit team labels Oct 4, 2023
@LukasMasuch
Copy link
Collaborator

The issue itself comes from the underlying datagrid library. But it might be fixed soon.

@benasse
Copy link

benasse commented Dec 6, 2023

From what I've seen, a new stable version of glide-data-grid that resolves the bug has been released.
Do you plan to update it soon or will you wait until version 6.0.0 is released?

@LukasMasuch
Copy link
Collaborator

@benasse We are already working on the latest glide-data-grid update here. But we probably wait for 6.0.0 for release.

LukasMasuch added a commit that referenced this issue Mar 1, 2024
## Describe your changes

Glide-data-grid had a [major update](glideapps/glide-data-grid#810).
This PR updates to this version and adapts the implementation for all the
breaking/updated features. This update fixes a variety of issues (see list below).
 
## GitHub Issue Link (if applicable)

Closes #6900
Closes #7032
Closes #7727
Closes #6810
Closes #7930
Closes #7949
Closes #7831
Closes #8168

## Testing Plan

- Updated tests

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
@LukasMasuch
Copy link
Collaborator

We merged the update of the underlying grid library. I believe this fixes the issue described here. This will be released in 1.32.

@sfc-gh-jesmith
Copy link

sfc-gh-jesmith commented Mar 25, 2024

Just wanted to follow up that the updates are live as of the latest release 1.32.2. 🥳

Thanks everyone for your valuable input and feedback!

zyxue pushed a commit to zyxue/streamlit that referenced this issue Apr 16, 2024
## Describe your changes

Glide-data-grid had a [major update](glideapps/glide-data-grid#810).
This PR updates to this version and adapts the implementation for all the
breaking/updated features. This update fixes a variety of issues (see list below).
 
## GitHub Issue Link (if applicable)

Closes streamlit#6900
Closes streamlit#7032
Closes streamlit#7727
Closes streamlit#6810
Closes streamlit#7930
Closes streamlit#7949
Closes streamlit#7831
Closes streamlit#8168

## Testing Plan

- Updated tests

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.data_editor feature:st.dataframe priority:P3 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants