Skip to content

Conversation

@vdonato
Copy link
Collaborator

@vdonato vdonato commented Mar 31, 2021

I ran into some trouble trying to call st.warning outside of code run by
the ScriptRunner, which made me remember that some code changed in a
recent PR (#3001) did just that.

I double-checked that this code indeed doesn't work as calls that
end up sending Delta protos rely on a ReportContext, which isn't
available in the LocalSourcesWatcher.

Since we can't present the warning in Streamlit itself (which would be
ideal), I just downgraded this to be a warning log for now.

I ran into some trouble trying to call st.warning outside of code run by
the ScriptRunner, which made me remember that some code changed in a
recent PR (streamlit#3001) did just that.

I double-checked that this code indeed doesn't work as calls that
end up sending Delta protos rely on a ReportContext, which isn't
available in the LocalSourcesWatcher.

Since we can't present the warning in Streamlit itself (which would be
ideal), I just downgraded this to be a warning log for now.
@vdonato vdonato requested a review from a team March 31, 2021 04:32
@vdonato vdonato merged commit ae2270f into streamlit:develop Apr 2, 2021
@vdonato vdonato deleted the local-sources-watcher-warning branch April 2, 2021 00:02
tconkling added a commit that referenced this pull request Apr 5, 2021
* develop:
  Added "allow-downloads" to the sandbox attributes (#3053)
  Small fix for `make pylint` command (#3062)
  Set genericColors properly and make theme defs more consistent (#3051)
  Downgrade st.warning in local_sources_watcher to a log (#3050)
  Extend docstring of st.image (#3055)
  Move docs.streamlit.io to Segment (#3005)
  Fix bokeh example in docs (`legend` arg) (#2907)
  Remove incorrect markdown table styling (#3038)
  document getattr
  Show the beta_warning only a single time per object
  object_beta_warning: handle every __ magic method
  object_beta_warning: handle the subscript operator
  beta_util_test
  Move secrets out of beta
  [Security] Upgrade y18n to 4.0.1 or later (#3041)
  Fix gap not working on Safari (#3042)
  formatting
  call _repr_html_ when available
tconkling added a commit to tconkling/streamlit that referenced this pull request Apr 5, 2021
* st_form:
  Added "allow-downloads" to the sandbox attributes (streamlit#3053)
  Small fix for `make pylint` command (streamlit#3062)
  Set genericColors properly and make theme defs more consistent (streamlit#3051)
  Downgrade st.warning in local_sources_watcher to a log (streamlit#3050)
  Extend docstring of st.image (streamlit#3055)
  Move docs.streamlit.io to Segment (streamlit#3005)
  Fix bokeh example in docs (`legend` arg) (streamlit#2907)
  Remove incorrect markdown table styling (streamlit#3038)
  document getattr
  Show the beta_warning only a single time per object
  object_beta_warning: handle every __ magic method
  object_beta_warning: handle the subscript operator
  beta_util_test
  Move secrets out of beta
  [Security] Upgrade y18n to 4.0.1 or later (streamlit#3041)
  Fix gap not working on Safari (streamlit#3042)
  formatting
  call _repr_html_ when available
tconkling added a commit to tconkling/streamlit that referenced this pull request Apr 5, 2021
# By Tim Conkling (7) and others
# Via GitHub (3) and Tim Conkling (1)
* st_form:
  FormsManager (streamlit#3046)
  Added "allow-downloads" to the sandbox attributes (streamlit#3053)
  Small fix for `make pylint` command (streamlit#3062)
  Set genericColors properly and make theme defs more consistent (streamlit#3051)
  Downgrade st.warning in local_sources_watcher to a log (streamlit#3050)
  Extend docstring of st.image (streamlit#3055)
  Move docs.streamlit.io to Segment (streamlit#3005)
  Fix bokeh example in docs (`legend` arg) (streamlit#2907)
  Remove incorrect markdown table styling (streamlit#3038)
  document getattr
  Show the beta_warning only a single time per object
  object_beta_warning: handle every __ magic method
  object_beta_warning: handle the subscript operator
  beta_util_test
  Move secrets out of beta
  [Security] Upgrade y18n to 4.0.1 or later (streamlit#3041)
  Fix gap not working on Safari (streamlit#3042)
  formatting
  call _repr_html_ when available

# Conflicts:
#	frontend/src/components/core/Block/Block.tsx
#	frontend/src/components/widgets/Form/Form.tsx
#	frontend/src/components/widgets/Form/FormSubmitButton.tsx
#	frontend/src/components/widgets/Form/FormsData.test.ts
#	frontend/src/components/widgets/Form/FormsManager.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants