Skip to content

Conversation

@vdonato
Copy link
Collaborator

@vdonato vdonato commented Jan 15, 2021

This makes the case where a user creates a st.number_input with int type and float format string behave analogously to the case with a float type / int format string.

Closes #1809

@vdonato vdonato requested a review from a team January 15, 2021 01:41
Copy link
Contributor

@akrolsmir akrolsmir left a comment

Choose a reason for hiding this comment

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

This looks good from the eng side! On the product side, though, I wonder if we ought to instead automatically change the type of the value from an int to float, if a float format type is specified? It feels like that would have been a closer representation to what the author of #1809 actually wanted.

In any case, we can also merge this in for now because it's an improvement, and then do the above change later, should Product (@asaini ) deem it a further improvement worth pursuing

@vdonato vdonato merged commit 2701a46 into streamlit:develop Jan 15, 2021
@vdonato vdonato deleted the number_input_fmt_string branch January 15, 2021 21:30
tconkling added a commit to tconkling/streamlit that referenced this pull request Jan 19, 2021
* develop:
  Feature/sudoless metrics (streamlit#2605)
  Have st.number_input warn user of mismatched type and format string (streamlit#2604)
  Remove extra period from sentence (streamlit#2601)
  Revert "Deploy button front (streamlit#2552)" (streamlit#2599)
  Fix slider UX (streamlit#2596)
CFrez pushed a commit to CFrez/streamlit that referenced this pull request Jan 21, 2021
…treamlit#2604)

* Add %u to list of valid number_input formatters

* Have number_input warn user of mismatched type and format string

* Use more modern f-string syntax instead of .format()
kmcgrady pushed a commit that referenced this pull request Jan 25, 2021
* switched react-katex package

* lockfile updated

* update test to corrected spelling

* decapitalize KaTex

* Fix slider UX (#2596)

* Fix slider UX

* Add snapshot

* Revert "Deploy button front (#2552)" (#2599)

* Revert "Deploy button front (#2552)"

This reverts commit 0f66b6e.

* Fix merge (erm... revert) conflict.

* Revert "Deploy button py (#2535)"

This reverts commit 0bbc7aa.

Co-authored-by: karrie <[email protected]>

* Remove extra period from sentence (#2601)

* Have st.number_input warn user of mismatched type and format string (#2604)

* Add %u to list of valid number_input formatters

* Have number_input warn user of mismatched type and format string

* Use more modern f-string syntax instead of .format()

* Feature/sudoless metrics (#2605)

* Add and use sudoless machine id getter for metrics

Step 2 of the metrics user ID improvement plan.

* Add machine-id v3 tests

Duplicates of the v1 tests, since those covered the cases that remain in v3,
and we will remove v1 and its tests later.

Also fix formatting of some python files.

* DRY out machine ID paths into global constants

* Increase side padding to 5rem when app is in wide mode (#2613)

* Increase side padding to 5rem when app is in wide mode

* Upload Cypress snapshot

* Rerender Maybe components when they're first disabled (#2617)

\#2395 ended up being caused by this since we don't rerender placeholder
components created by `st.empty()` when react props/state change as a
performance optimization, but we need to do so when replacing an
existing component with an empty one to get rid of what's currently
drawn on screen.

Closes #2395

Co-authored-by: karrie <[email protected]>
Co-authored-by: Thiago Teixeira <[email protected]>
Co-authored-by: Randy Zwitch <[email protected]>
Co-authored-by: Vincent Donato <[email protected]>
Co-authored-by: Amanda Walker <[email protected]>
Co-authored-by: Austin Chen <[email protected]>
Co-authored-by: Vincent Donato <[email protected]>
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.

In number_input, min_value & max_value format override format string and raises no warning

2 participants