Skip to content

Conversation

@willhuang1997
Copy link
Contributor

📚 Context

mypy is failing
Please describe the project or issue background here

  • What kind of change does this PR introduce?

    • Bugfix
    • Feature
    • Refactoring
    • Other, please describe:

🧠 Description of Changes

remove unnecessary mypy ignores and add ints for metric.py

Value: TypeAlias = Union["np.integer", "np.floating", float, str, None]
Delta: TypeAlias = Union[float, str, None]
Value: TypeAlias = Union["np.integer", "np.floating", float, int, str, None]
Delta: TypeAlias = Union[float, int, str, None]
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: are we not supporting "np.integer", "np.floating", for Delta as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm good point. I'll add those

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, looking at this a bit more, we actually do extra stuff for numpy values here:

elif hasattr(value, "item"):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we add that code and make it a function for reusability and add support for delta? I think Deltas and Values would almost surely likely use the same types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have decided to make this a separate PR.

This reverts commit 69d2027.
@willhuang1997 willhuang1997 merged commit aa4237d into streamlit:develop Nov 8, 2022
tconkling added a commit to tconkling/streamlit that referenced this pull request Nov 8, 2022
* develop:
  Add mypy fixes (streamlit#5662)
  Don't render stale st.snow and st.ballons elements (streamlit#5401)
tconkling added a commit to tconkling/streamlit that referenced this pull request Nov 8, 2022
* develop:
  Add mypy fixes (streamlit#5662)
  Don't render stale st.snow and st.ballons elements (streamlit#5401)
  Fix unevaluated dataframe exception formatting (streamlit#5657)
  Update aboutDialog to check SessionInfo.isSet() before referring the instance (streamlit#5518)
  Replace assertEquals->assertEqual to silence deprecation warnings (streamlit#5648)
  Reworke AttrDict for st.secrets to explicitly disallow item and attribute assignment (streamlit#5621)
  Fix pydoc command for streamlit package (streamlit#5535)
  Temporarily have /st-allowed-message-origins double as a healthcheck (streamlit#5642)
  Fix Plotly Charts when exiting out of fullscreen (streamlit#5645)
  Flaky test e2e fixes (streamlit#5610)
kmcgrady pushed a commit that referenced this pull request Nov 9, 2022
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.

3 participants