Merged
Conversation
…pected no return value
jrhone
reviewed
Sep 18, 2019
jrhone
approved these changes
Sep 18, 2019
| @_wraps_with_cleaned_sig(method) | ||
| @_wraps_with_cleaned_sig(method, 1) # Remove self from sig. | ||
| def wrapped_method(self, *args, **kwargs): | ||
| return method(self, None, *args, **kwargs) |
Contributor
There was a problem hiding this comment.
Not sure I understand why we removed None here. It's because _wraps_with_cleaned_sig was always removing the first two args before but now we can tell it to remove just one?
Contributor
Author
There was a problem hiding this comment.
The only method that used this decorator was st.dataframe, and it had this signature:
def datafame(self, element, data, etc, etc):
...where element was actually not used in that method.
So when we called method(self, None, *args, **kargs) here, we were actually calling:
dg.dataframe(self=self, element=None, *args, **kwargs)
In this PR I removed the unused element argument, so we no longer need to pass None here.
tconkling
added a commit
to tconkling/streamlit
that referenced
this pull request
Sep 23, 2019
* develop: Release 0.46.0 (streamlit#170) Magic fixes (streamlit#138) [docs] Add analytics; redirect /secret/docs; fix compilation problem (streamlit#149) Fix bug for startup under windows (streamlit#144) Responsive layout (streamlit#104) Add basic PR template Better method signatures (streamlit#88) Publish docs to both /docs and /secret/docs, until we deprecate /secret/docs in January. (streamlit#141) Rename/report2app (streamlit#126)
tconkling
added a commit
to tconkling/streamlit
that referenced
this pull request
Sep 23, 2019
* develop: (54 commits) Removing uber demo from streamlit repo (streamlit#159) Release 0.46.0 (streamlit#170) Magic fixes (streamlit#138) [docs] Add analytics; redirect /secret/docs; fix compilation problem (streamlit#149) Fix bug for startup under windows (streamlit#144) Responsive layout (streamlit#104) Add basic PR template Better method signatures (streamlit#88) Publish docs to both /docs and /secret/docs, until we deprecate /secret/docs in January. (streamlit#141) Rename/report2app (streamlit#126) Test running streamlit commands "bare" (streamlit#133) Updates to LP and sidebar. (streamlit#134) tests for z-index of date input popover in sidebar (streamlit#131) cypress test for escaping html in markdown (streamlit#125) On a Mac, check if xcode installed before requiring watchdog (streamlit#91) [Docs] Fix st.slider API in tutorial (streamlit#98) Sidebar exceptions (streamlit#107) Fixing unbound local variable (streamlit#110) Support hashing dataframes with unhashable objects. Gracefully f… (streamlit#118) Fix hashing if the object has a name but the name is not a string. (streamlit#117) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most DeltaGenerator methods are decorated with helper functions that insert special arguments into them. For example, the arugment
elementis inserted into almost every DeltaGenerator method, andui_valueis inserted into every widget method.These arguments aren't be user-visible, in the sense that users can't pass their own
elementproto into these methods. So a while back we implemented the_wraps_with_cleaned_sigfunction to modify some special metadata in those methods, so theelementargument wouldn't appear in the output of utilities like Python'shelp()function, ipython's?, Streamlit'sst.help, and our autogenerated API docs.But we never updated the
_wraps_with_cleaned_sigdecorator to appropriately the user-hiddenui_valueargument from widget methods. So that's what I'm doing in this PR.In this PR, the actual fix was the introduction of the
num_args_to_removeargument to the_wraps_with_cleaned_sigfunction. Everything else is just some cleanup and minor refactor, which should have no effect on actual logic.