Skip to content

Conversation

@akrolsmir
Copy link
Contributor

@akrolsmir akrolsmir commented Jan 22, 2021

Fixes #2627

(Wait for #2635 before merging in)

Spec from Thiago:

Without going so far as completely rethinking how we do sizes, the least we could do is change `use_column_width` to accept three values:

- `'auto'` : sets the image to its natural size, unless its width is greater than the column width. In which case it scales the image to fit the column width.
- `True` or `'always'`: sets the image size to fit the column width.
- `False` or `'never'`: sets the image to its natural size.

Then we'd make `'auto'` the default. (The current default is `False`)
@akrolsmir akrolsmir requested a review from a team January 22, 2021 14:58
@akrolsmir akrolsmir marked this pull request as draft January 22, 2021 14:58
@akrolsmir akrolsmir changed the title Fully remove support for format in st.image 🔥 Fully remove support for format in st.image Jan 22, 2021
@akrolsmir akrolsmir changed the title 🔥 Fully remove support for format in st.image 🔥 Fully remove format param from st.image Jan 22, 2021
@akrolsmir akrolsmir marked this pull request as ready for review January 25, 2021 18:14

[deprecation]

# Set to false to disable the deprecation warning for the image format parameter.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also modify the last updated timestamp earlier in this code snippet, to recognize you've changed it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh wow, didn't know about that at all. Thanks for the reminder!

(I'm now curious if we can automate this by eg pulling the time of the last Git commit into wherever in the docs this is getting surfaced, or something... maybe a project for when someone has too much time on their hands :P)

Copy link
Contributor

@randyzwitch randyzwitch left a comment

Choose a reason for hiding this comment

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

See comment, otherwise LGTM

Copy link
Contributor

@karriebear karriebear left a comment

Choose a reason for hiding this comment

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

This works so approving but there is a product question for how to actually remove. Either way super small change. Happy to review again if needed

default_val="True",
scriptable="True",
type_=bool,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

We actually have an expiration param we can put on this so that if someone uses the config option it doesn't cry too hard for them and gives them some message about config removed I think. We should probably use that instead of deleting but ultimately up to product. cc @asaini

Copy link

Choose a reason for hiding this comment

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

We've had the deprecation warning for a while so I think it's safe to simply remove it (Our docs also reflect the the new param option)

Copy link
Contributor

Choose a reason for hiding this comment

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

It wasn't clear what the resulting behavior from removing the config entirely and after testing, we'd like to instead deprecate the config option instead. @akrolsmir do you have time to address before Sunday 10:30pm PT so we can get this into the next release?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll get it in right now.

@asaini
Copy link

asaini commented Feb 24, 2021

LGTM 👍

@kmcgrady kmcgrady merged commit 2437421 into streamlit:develop Feb 25, 2021
tconkling added a commit that referenced this pull request Mar 1, 2021
* develop: (29 commits)
  Update bug_report.md
  Refactor CodeBlock.tsx (#2814)
  Remove copy button for empty codeblocks (#2808)
  Add image format deprecation config with expiration (#2865)
  Remove unneeded "use_column_width=True" from our doc examples (#2692)
  Extend our st.cache MagicMock handling logic to Mock (#2846)
  save work (#2862)
  Remove .stale-element class (#2848)
  Release 0.77 (#2849)
  Fix watchdog import failure (#2856)
  🔥 Fully remove `format` param from st.image (#2637)
  Don't memoize config._server_headless (#2858)
  hide empty columns on mobile (#2756)
  st.beta_secrets (#2757)
  `watch_file` utility function (#2851)
  Align st.beta_columns  (#2811)
  Update "showErrorDetails" config description and docs (#2841)
  Pause Dependabot updates for non-security-related issues (#2840)
  client.showTracebacks -> showErrorDetails (per product) (#2837)
  Color picker - show value (#2817)
  ...
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.

Remove st.image format parameter once and for all

5 participants