Skip to content

Conversation

@tvst
Copy link
Contributor

@tvst tvst commented Feb 13, 2020

Prior to this PR, something broke the signatures of wrapped DG methods. This was reflected in docs.streamlit.io (where things like st.text(body) were written as st.text()) and in the Python console (e.g. help(st.text)). It was probably broken in IDEs too.

That's because we use some magic to make our signatures cleaner, and something broke that magic. I fixed that now and added tests.

@tvst tvst requested a review from monchier February 13, 2020 01:26
@tvst tvst requested a review from a team as a code owner February 13, 2020 01:26
that users have no access to.
Note that "self" is ignored by default. So to remove both "self" and the
next argument you'd pass num_args_to_remove=1.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behavior is new. Not sure why functools.partial is removing self now, but it definitely is.

"""

@_wraps_with_cleaned_sig(method, 2) # Remove self and element from sig.
@_wraps_with_cleaned_sig(method, 1) # Remove self and element from sig.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, I was seeing element in Intellij, so this should fix it.

@tvst tvst merged commit 84bd47c into streamlit:develop Feb 15, 2020
@tvst tvst deleted the sigs branch February 15, 2020 21:28
tconkling added a commit to tconkling/streamlit that referenced this pull request Feb 18, 2020
* develop: (29 commits)
  Release 0.56.0 (streamlit#1101)
  Fix bug where icon assets were missing from "make install" (streamlit#1100)
  Clean signatures of wrapped DeltaGenerator methods (streamlit#1099)
  Using widgetId as the key when rendering elements (streamlit#1102)
  Pass --skip-lock to pipenv under pipenv-install Makefile target. (streamlit#1093)
  Allow wider range of int-like types in NumberInput (streamlit#1087)
  Fix missing caching URL (streamlit#1094)
  Version 0.55.1 (just pointing to new docs) (streamlit#1089)
  Retire python-3.7.4 CircleCI project. (streamlit#1086)
  Handle different Caching error messages (streamlit#1068)
  Fix an incomplete copy for a dict that's then modified. (streamlit#1078)
  Fix indentation error in fad994c. (streamlit#1084)
  Widgets unit tests (streamlit#1077)
  [mypy] First phase of work on testing Python type annotations. (streamlit#1079)
  Add CircleCI jobs to run the oldest and newest Python versions we support. (streamlit#1053)
  Improve docs (streamlit#1075)
  Adding CORS to troubleshooting guide. (streamlit#1001)
  Fix for the CORS check (streamlit#965)
  Advanced caching updates feb (streamlit#1040)
  Fixing add_rows index calculation (streamlit#1054)
  ...
tconkling added a commit to tconkling/streamlit that referenced this pull request Feb 19, 2020
* develop: (30 commits)
  [Screencast] Fixing countdown bug (streamlit#1082)
  Release 0.56.0 (streamlit#1101)
  Fix bug where icon assets were missing from "make install" (streamlit#1100)
  Clean signatures of wrapped DeltaGenerator methods (streamlit#1099)
  Using widgetId as the key when rendering elements (streamlit#1102)
  Pass --skip-lock to pipenv under pipenv-install Makefile target. (streamlit#1093)
  Allow wider range of int-like types in NumberInput (streamlit#1087)
  Fix missing caching URL (streamlit#1094)
  Version 0.55.1 (just pointing to new docs) (streamlit#1089)
  Retire python-3.7.4 CircleCI project. (streamlit#1086)
  Handle different Caching error messages (streamlit#1068)
  Fix an incomplete copy for a dict that's then modified. (streamlit#1078)
  Fix indentation error in fad994c. (streamlit#1084)
  Widgets unit tests (streamlit#1077)
  [mypy] First phase of work on testing Python type annotations. (streamlit#1079)
  Add CircleCI jobs to run the oldest and newest Python versions we support. (streamlit#1053)
  Improve docs (streamlit#1075)
  Adding CORS to troubleshooting guide. (streamlit#1001)
  Fix for the CORS check (streamlit#965)
  Advanced caching updates feb (streamlit#1040)
  ...
tconkling added a commit to tconkling/streamlit that referenced this pull request Feb 24, 2020
* develop: (53 commits)
  Update plotly.js to 1.52 (streamlit#1119)
  Add tooltip in Altair/Vega-lite docstring code (streamlit#1092)
  Ability to bind to a server address with server.address config option (streamlit#1107)
  [mypy] Enable check_untyped_defs throughout the codebase. (streamlit#1110)
  st.map: set "radiusMinPixels" to 3 (streamlit#1113)
  st.plotly_chart docs incorrectly refer to Altair (streamlit#1118)
  Fix BytesIO and numpy array data sources for audio/video (streamlit#1116)
  Show warning to user and use skipkeys=True if json.dumps causes TypeError (streamlit#1112)
  Server: store SessionInfo by id (streamlit#1056)
  [Screencast] Fixing countdown bug (streamlit#1082)
  Release 0.56.0 (streamlit#1101)
  Fix bug where icon assets were missing from "make install" (streamlit#1100)
  Clean signatures of wrapped DeltaGenerator methods (streamlit#1099)
  Using widgetId as the key when rendering elements (streamlit#1102)
  Pass --skip-lock to pipenv under pipenv-install Makefile target. (streamlit#1093)
  Allow wider range of int-like types in NumberInput (streamlit#1087)
  Fix missing caching URL (streamlit#1094)
  Version 0.55.1 (just pointing to new docs) (streamlit#1089)
  Retire python-3.7.4 CircleCI project. (streamlit#1086)
  Handle different Caching error messages (streamlit#1068)
  ...
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