-
Notifications
You must be signed in to change notification settings - Fork 4k
Update error message and docstring in st.map #5792
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
Conversation
sfc-gh-tszerszen
left a comment
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 👍
|
@sfc-gh-kbregula On 0b29d42, I linted with I've also edited your PR description to include all the relevant information and context so there's a historical record of why these changes were made. Could you also include a PR comment saying why this PR does not need new tests? Thanks! See the new Processes doc for more info on why to talk about tests. |
This is a refactoring that doesn't change the behavior. Current tests already cover this case. I also changed the message, which was updated in the tests. I think, we don't need new tests. |
lukasmasuch
left a comment
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.
LGMT 👍 Since it is purely refactoring it does indeed not need a test. Unfortunately, in this specific case there does not seem to be any test that covers the different allowed values "lon", "longitude", "LON", "LONGITUDE". So, it would be awesome to extend the testing in this PR to cover these alternative allowed column names.
7bd89e5 to
b89d6d3
Compare
|
@lukasmasuch Update tests. Now we have better coverage. |
|
The docs state that you should be able to pass in an |
|
@harahu good question. That's likely a bug in the docstring. If a streamlit/lib/streamlit/elements/map.py Line 169 in a5e8141
after which it always fails the check for the streamlit/lib/streamlit/elements/map.py Lines 180 to 184 in a5e8141
@sfc-gh-kbregula we should probably remove I'm assuming |
|
For the following code: arr = np.array([[1, 2], [4, 5]], np.int32)
st.map(arr)I got the following error: It looks a bit like a bug to me, because I can imagine that the user enters data as a two-dimensional array. For now, I will create a ticket to discuss this problem and think about the solution. |
|
Ticket: #5835 |
* develop: Change workers balancing logic for e2e tests to always cover all specs (#5865) Up version to 1.16.0 (#5852) Stop installing pip-tools (#5854) Add eslint no relative import paths plugin to pre commit hooks (#5839) Docs: move note to `experimental_allow_widgets` param description (#5843) Update element docstrings for colored text support (#5831) Add remark-directive plugin (Support for colored text in markdown) (#5774) Teach WebsocketConnection how to wait on an external auth token (#5728) Turn on streamlit theme for altair and plotly (#5796) Fix markdown headers spacing (#5829) Update error message and docstring in st.map (#5792) Remove unnecessarily methods from DeltaGenerator (#5824) Resolve vega-tooltip to later version (#5825) Easter Egg (#5817) Update Exception Layout to avoid overflow (#5700)
📚 Context
The docstring for the
dataparameter ofst.mapcould be better formatted and should include all the possible valid values of column names. Additionally, the st.map code includes many if-else blocks that could use refactoring.What kind of change does this PR introduce?
🧠 Description of Changes
Improves formatting of docstring for the
dataparameter ofst.mapIncludes all the possible valid values of column names for the
dataparameter and also does so in the error messageRefactors st.map code to replace multiple if-else blocks with iterators
Revised:
Current:
🧪 Testing Done
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.