-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Make st.write call st.json to display Streamlit secrets object #8659
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.
Overall, I think this LGTM 👍 But it might be worth to evaluate if we actually want to add an explicit to_dict
(preferred) or to_json
method to st.secrets
. The __repr__
call isn't necessarily guaranteeing that it returns a valid json
, its just doing that at the moment.
Thanks, Lukas!
Good point, I've added a |
Yep, I think that looks good 👍 added one comment above. And have you tested it manually with nested secrets if it works as expected? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@LukasMasuch does this PR need a review from another Eng or can I merge it? 😄 |
@snehankekre I think it is fine to merge :) |
Describe your changes
When you call
st.write(st.secrets)
, the output is displayed as inline code withst.markdown
. This PR makesst.write
callst.json
on objects of typestreamlit.runtime.secrets.Secrets
GitHub Issue Link (if applicable)
Closes #2905.
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.