Showing an error when it's not localhost and has no mapbox token#1295
Conversation
… showingTokenErrorWhenNotLocalhost
… runs, so I moved it to init config
| <a href="https://mapbox.com">https://mapbox.com</a>. It's free! (for moderate usage levels) See | ||
| <a href="https://docs.streamlit.io/cli.html#view-all-config-options">our documentation</a> for more | ||
| info on how to set config options. | ||
| ` |
There was a problem hiding this comment.
Hey, I was going to comment on this error message, but I need to see it in action to really understand what it should say. Can you give me an example of how to see it?
There was a problem hiding this comment.
you could run for example /e2e/scripts/st_map.py without setting any mapbox token within your config.toml
There was a problem hiding this comment.
I see the following snippet when I run streamlit config view:
[mapbox]
# Configure Streamlit to use a custom Mapbox token for elements like st.deck_gl_chart and st.map. If you don't do this you'll be using Streamlit's own token, which has limitations and is not guaranteed to always work. To get a token for yourself, create an account at https://mapbox.com. It's free! (for moderate usage levels)
# Default: ""
token = ""
I wonder if we need to change the comment in the config, because with these change the user will no longer be using Streamlit's own token unless they are running streamlit hello locally.
EDIT: I believe the config comments are at
streamlit/lib/streamlit/config.py
Line 538 in 908827b
|
I just realized, before we release this change we should sync with @randyzwitch on how to inform the community, and what changes we need to add for our docs. (Randy, if you're reading this and are confused about what's going on, PTAL at #1136 for more info) |
Amey-D
left a comment
There was a problem hiding this comment.
Overall looks great! Added a couple of suggestion primarily to minimize user confusion around this change. PTAL.
| <a href="https://mapbox.com">https://mapbox.com</a>. It's free! (for moderate usage levels) See | ||
| <a href="https://docs.streamlit.io/cli.html#view-all-config-options">our documentation</a> for more | ||
| info on how to set config options. | ||
| ` |
There was a problem hiding this comment.
I see the following snippet when I run streamlit config view:
[mapbox]
# Configure Streamlit to use a custom Mapbox token for elements like st.deck_gl_chart and st.map. If you don't do this you'll be using Streamlit's own token, which has limitations and is not guaranteed to always work. To get a token for yourself, create an account at https://mapbox.com. It's free! (for moderate usage levels)
# Default: ""
token = ""
I wonder if we need to change the comment in the config, because with these change the user will no longer be using Streamlit's own token unless they are running streamlit hello locally.
EDIT: I believe the config comments are at
streamlit/lib/streamlit/config.py
Line 538 in 908827b
Co-authored-by: Amey Deshpande <[email protected]>
…t' into showingTokenErrorWhenNotLocalhost
Co-authored-by: Amey Deshpande <[email protected]>
Got it, ran into this same problem at my previous company, so familiar with the general idea. I think we could make a forum post right away in Announcements to highlight our intentions; regardless of what implementation or deprecation decisions are being made, we've already decided that users in production must use their own key. Once we think through the actual policy, then we can both update the Announcement forum page, as well as call it out in the changelog. I don't think we should necessarily worry about breaking old code after a 60-90 grace period; so throw a deprecation warning starting with the next release with a firm date in the message (July 31, 2020?), and then turn it off on the date we say in the deprecation warning. |
|
If we want to be even more conservative, we could publish a blog post 30 days before we turn it off, to try and reach as many people as possible. |
tvst
left a comment
There was a problem hiding this comment.
Let's wait for at least one release before merging. Marking as "request changes" to block this in the meantime.
|
Given that this PR (and this issue) went through a thousand different specs/rewrites, I'd love to get it in "as is" rather than do more work on it. With that in mind, how about we do the release like this:
From the eng side, it's best if N_MERGE is 2 weeks. As for N_FINAL_ANNOUNCE and N_DELETE, those don't matter to eng. @randyzwitch would you be comfortable with this? |
|
I found another problem. Try this:
Expected: the charts should not show up. You should see 2 error messages instead. What's happening: the Mapbox token that was fetched with |
… showingTokenErrorWhenNotLocalhost
… showingTokenErrorWhenNotLocalhost
tvst
left a comment
There was a problem hiding this comment.
Left some comments, check below
| mkdir ~/.streamlit | ||
| MAPBOX_TOKEN=$(curl -sS https://data.streamlit.io/tokens.json | jq -r '.mapbox') | ||
| echo '[mapbox]' > ~/.streamlit/config.toml | ||
| echo 'token = "'$MAPBOX_TOKEN'"' >> ~/.streamlit/config.toml |
There was a problem hiding this comment.
We need a solution for local e2e tests too
There was a problem hiding this comment.
I added the same for the dockerfile
… showingTokenErrorWhenNotLocalhost


Issue: Fix #1136 #812
Description: As it is not possible to render a Mapbox without any token we are delimiting the use locally.
Contribution License Agreement
By submiting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.