Skip to content

Conversation

@domoritz
Copy link
Contributor

@domoritz domoritz commented Aug 24, 2019

  • Fix argument to error message
  • Fix typos
  • Implement Python 2 compatible example code generation
  • Add test

@domoritz domoritz requested a review from tvst August 24, 2019 04:56
@domoritz domoritz changed the title Improve caching Improve caching code Aug 24, 2019
@domoritz domoritz merged commit f5332a1 into streamlit:develop Aug 24, 2019
@domoritz domoritz deleted the hashing_python2 branch August 24, 2019 22:26
tconkling added a commit to tconkling/streamlit that referenced this pull request Aug 27, 2019
* develop:
  Fix streamlit#1230: OSError not caught when writing cache to disk (streamlit#8)
  Improve caching code (streamlit#2)
  Remove incorrect background of code inside error messages (streamlit#4)
  Fix line number in error message (streamlit#3)
  Update README.md
  Implement Caching object to support running code blocks only once (streamlit#1)
  Update README.md
  Add font licenses to NOTICE (streamlit#1267)
  Clean up repo for open source release. Remove unecessary folders. (streamlit#1266)
  Fix st.cache (streamlit#1273)
  Close streamlit#1092 (streamlit#1270)
  Change license header in variables.scss so it's compatible with scss-to-json. (streamlit#1268)
  Sidebar (streamlit#1224)
  Add Apache license and update all license headers (streamlit#1265)
  Handling objects with empty docs in st.help (streamlit#1261)
  Enhance Mochawesome report with screenshots (streamlit#1263)
  Add LICENSES file (streamlit#1262)
tvst added a commit that referenced this pull request Aug 26, 2021
* Update font sizes

* Allow sidebar to use same h1,h2,etc sizes as main content area.

* Fix columns e2e spec

* Fix st.metric merge conflict

* Fix fourXL font size
vdonato pushed a commit that referenced this pull request Nov 16, 2021
* initial scaffolding for camera_image_input widget

* Add missing files and remove docstring

* * Refactor CameraImageInput React component to class based component

* * class based draft front implementation for camera_image_input

* * Rewrite CameraImageInput behaviour similar to FileUploader widget behaviour

* * Rewrite CameraImageInput behaviour similar to FileUploader widget behaviour

* * Remove commiting data to backend from CameraImageInput widget for now

* * Remove unused value from CameraImageInput widget signature

* Add `files` to CameraImageInput react state, similar to FileUploader

* Add methods from FileUploader to CameraImageInput for working with files state field

* Integrate react-webcam into CameraImageInput component, send image to backend

* * Implement "Permission" screen draft
* Implement "Take new picture" functionality

* * Remove dot from docstring

* * Remove `label` argument for camera_image_input
* Fix docstring

* * Change buttons to styled `UIButton`, set screenshot quality to maximum

* * Make form work correctly inside `clear_on_submit` form

* Add width to video constraints

* Fix typo

* Fix (#2)

* Rename camera_image_input to camera_input in `__init__.py`

Co-authored-by: willhuang1997 <[email protected]>
@svictol svictol mentioned this pull request Oct 13, 2024
2 tasks
kmcgrady pushed a commit that referenced this pull request Dec 11, 2024
Make st.write use st.html when _repr_html_ is present.

## Describe your changes

1. When `_repr_html_()` is present in an object, `st.write` now displays
the HTML using `st.html()` rather than `st.markdown()` (assuming
`unsafe_allow_html=True`).

1. When `unsafe_allow_html=False` AND `_repr_html_()` did not contain
HTML tags we used to send its output to `st.markdown()`. This behavior
is now removed. Instead, the output is handled with `st.help()` like any
other object.

1. Removes `_repr_html_()` from `*Connection` objects. This wasn't
really buying us anything, and was just weird. Also, this was the reason
for adding behavior #2 in the first place.

1. This is totally unrelated to the above, but is so small I didn't want
to create a separate PR for it (though, LMK if you want me to!): Remove
an old check for an environment variable that Streamlit's Atom plugin
from 2018-19 used to depend on. That plugin no longer exists, so we can
safely remove this.


## GitHub Issue Link (if applicable)
n/a

## Testing Plan

- ~~Explanation of why no additional tests are needed~~
- Unit Tests (JS and/or Python): ✅ Included!
- E2E Tests: 🟢  No new tests added, but this is already well-tested.
- Any manual testing needed? 👎 No need.

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
edegp referenced this pull request in edegp/streamlit Jan 19, 2025
Make st.write use st.html when _repr_html_ is present.

## Describe your changes

1. When `_repr_html_()` is present in an object, `st.write` now displays
the HTML using `st.html()` rather than `st.markdown()` (assuming
`unsafe_allow_html=True`).

1. When `unsafe_allow_html=False` AND `_repr_html_()` did not contain
HTML tags we used to send its output to `st.markdown()`. This behavior
is now removed. Instead, the output is handled with `st.help()` like any
other object.

1. Removes `_repr_html_()` from `*Connection` objects. This wasn't
really buying us anything, and was just weird. Also, this was the reason
for adding behavior #2 in the first place.

1. This is totally unrelated to the above, but is so small I didn't want
to create a separate PR for it (though, LMK if you want me to!): Remove
an old check for an environment variable that Streamlit's Atom plugin
from 2018-19 used to depend on. That plugin no longer exists, so we can
safely remove this.


## GitHub Issue Link (if applicable)
n/a

## Testing Plan

- ~~Explanation of why no additional tests are needed~~
- Unit Tests (JS and/or Python): ✅ Included!
- E2E Tests: 🟢  No new tests added, but this is already well-tested.
- Any manual testing needed? 👎 No need.

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
sfc-gh-lwilby added a commit that referenced this pull request Oct 19, 2025
…ions

Addresses three suggestions from PR #12807 review:

1. Simplify test cases (suggestion #2)
   - Reduced from 9 parameterized tests to 3 focused tests
   - Removed fragment and expander contexts (regression only in containers)
   - Eliminated parameterization that made test app hard to read
   - Simple, clear structure with named containers

2. Add deterministic width assertions (suggestion #3)
   - stretch: Container width=600, expect ~580-600px (allows padding)
   - content: Figure 6.4in @ 100 DPI = 640px, expect ~620-640px
   - pixel: Explicit width=500, expect ~480-500px
   - More stable than arbitrary >200px threshold

3. Clean up unnecessary comments (suggestion #4)
   - Removed comments that just describe next line
   - Kept meaningful comments explaining test logic and expectations
   - Improved readability

Test structure:
- 3 regression tests in containers only
- Specific figure size (6.4in x 4.8in at 100 DPI)
- Known container width for stretch test
- Deterministic assertions with reasonable margins

Note: Suggestion #1 (use_container_width check) addressed with explanation
in PR comment - current logic is correct for the new widthConfig system.
sfc-gh-lwilby added a commit that referenced this pull request Oct 22, 2025
…ions

Addresses three suggestions from PR #12807 review:

1. Simplify test cases (suggestion #2)
   - Reduced from 9 parameterized tests to 3 focused tests
   - Removed fragment and expander contexts (regression only in containers)
   - Eliminated parameterization that made test app hard to read
   - Simple, clear structure with named containers

2. Add deterministic width assertions (suggestion #3)
   - stretch: Container width=600, expect ~580-600px (allows padding)
   - content: Figure 6.4in @ 100 DPI = 640px, expect ~620-640px
   - pixel: Explicit width=500, expect ~480-500px
   - More stable than arbitrary >200px threshold

3. Clean up unnecessary comments (suggestion #4)
   - Removed comments that just describe next line
   - Kept meaningful comments explaining test logic and expectations
   - Improved readability

Test structure:
- 3 regression tests in containers only
- Specific figure size (6.4in x 4.8in at 100 DPI)
- Known container width for stretch test
- Deterministic assertions with reasonable margins

Note: Suggestion #1 (use_container_width check) addressed with explanation
in PR comment - current logic is correct for the new widthConfig system.
sfc-gh-aamadhavan added a commit that referenced this pull request Nov 19, 2025
sfc-gh-aamadhavan added a commit that referenced this pull request Nov 20, 2025
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