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
Fix chart exception where color-handling code expected DF index to start at 0 #8158
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 We recently had a community contribution to fix the same issue for st.map
here: #8079 The PR used iloc
, but I think iat
is the better choice for this. It might be good to just update the iloc
usage to iat
in st.map
as well.
Yeah, I saw the .iloc there but didn't want to touch it since it's working 😄 Did they contribute a test specifically for that bug in st.map? If so, I'll happily change to .iat right now |
Oh, actually I do see tests. I'll change it to .iat, BRB |
Done. PTAL |
Perfect, looks great 👍 Merging it now (not sure if you have merging permission?) |
Thanks! I was just waiting for a final review 😉 |
…art at 0 (streamlit#8158) ## Describe your changes Fixes an exception in our native st.foo_chart commands, where color-handling code expected DF index to start at 0. So, for example, the code below used to throw an exception: ```python df = pd.DataFrame( { "a": [11, 2, 55], "b": [100, 101, 102], "c": [200, 201, 202], "d": [300, 301, 302], } ) df.set_index("a", inplace=True) st.line_chart(df, x="b", y="c", color="d") ``` ## GitHub Issue Link (if applicable) None. ## Testing Plan - ~~Explanation of why no additional tests are needed~~ - [x] Unit Tests (JS and/or Python) - ~~E2E Tests~~ - Any manual testing needed? - **No** --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
Describe your changes
Fixes an exception in our native st.foo_chart commands, where color-handling code expected DF index to start at 0.
So, for example, the code below used to throw an exception:
GitHub Issue Link (if applicable)
None.
Testing Plan
Explanation of why no additional tests are neededE2E TestsContribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.