Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev 3371 streamlit 1.26 #5

Merged
merged 61 commits into from
Sep 5, 2023
Merged

Conversation

kylelrichards11
Copy link

Update Tagup fork to 1.26.0

dependabot bot and others added 30 commits July 24, 2023 14:41
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.5.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](jonschlinkert/word-wrap@1.2.3...1.2.5)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Adding the recommended rules/configuration 'plugin:testing-library/react' to our ESLint config to enforce recommended practices. Resolves all outstanding warnings/errors from these rules.
Allows markdown in the options of st.radio - the same ones as permitted in Radio's label, with the exception of links because it is a clickable element.
…treamlit#7033)

The help param causes use_container_width=True to be ignored - the button doesn't extend across the container. This PR resolves by passing container width down to the button
Converting FE test files from Enzyme to RTL
* Initial investigation

* Update python playwright support

* Cleanup

* Add github actions flow

* Fix playwright workflow

* Update playwright

* Add snapshots

* Remove e2e script

* Fix linting issue

* Add additional time

* Add copyright header

* Update snapshots

* Move into main gitignore

* Fix wait for logic

* Add debug results to workflow

* Improve gitignore

* Improved conftest

* Add additional tests

* Use locator everywhere

* Fix wrong upload dir

* Add snapshots

* Update e2e/playwright/conftest.py

Co-authored-by: Kamil Breguła <[email protected]>

* Use healthcheck

Co-authored-by: Kamil Breguła <[email protected]>

* Get random available port from operating system

Co-authored-by: Kamil Breguła <[email protected]>

* Fix issues

* Add comment

* Remove unneeded comment

* Add make command and other updates

* Add some docstring comments

* Some more updates

* Add checkbox test

* Migrate multiselect test

* Add snapshots

* Improve e2e tests

* Update tests

* Change e2e screenshot utils to work on element

* Update tests

* Improve tests

* Improve app loader functionality

* Change back Pipfile

* Fix flaky test

* Remove wait for pause

* Update conftest

* Apply review comments

* Remove snapshots

* Apply review comments

* Lower wait time

* Remove wait time

* Add todo comment

* Migrate two additional tests

* Add new snapshots

* Downgrade machine to 4 cores

* Add file type docstring

---------

Co-authored-by: Kamil Breguła <[email protected]>
* Add new template and workflow

* Update formatting

* Remove triage label

* Make comment more shorter

* Fjx linter issue

* Update feature_request.yml

* Update feature_request.yml

* Update feature_request.yml
<!--
⚠️ BEFORE CONTRIBUTING PLEASE READ OUR CONTRIBUTING GUIDELINES!
https://github.com/streamlit/streamlit/wiki/Contributing
-->

## Context
There are 3 libraries that should supposedly replace `imghdr`: 
<img width="798" alt="Screenshot 2023-07-26 at 2 31 21 PM" src="https://github.com/streamlit/streamlit/assets/16749069/fa41965c-da7d-412c-bf78-3f9276614c49">
https://peps.python.org/pep-0594/#deprecated-modules

1. puremagic
  a. it is smaller lib (365 KB) 
  b. **However, attempted to incorporate the library but it didn't end up working and api documentation is sparse.**
     1. branch attempt on: https://github.com/streamlit/streamlit/tree/fix/7027_puremagic
2. python-magic
  a. no go almost surely; needs a separate installation of libmagic which is a c library
3. filetype
  a. easy api with documentation (https://h2non.github.io/filetype.py/v1.0.0/filetype.m.html)
  b. it ends up working and seems like an easy change
  c. looks like the filetype package isn’t in conda defaults, so we'd either need to find an equivalent package that is (since it looks like there are a few options) or contact the anaconda team requesting it be added

However, these are actually not needed because we can just use pillow to get the format. Technically, `For images created by the [pillow library itself (via a factory function, or by running a method on an existing image), [format] attribute is set to None.` However, since we actually save the image with `Pillow` in `_PIL_to_bytes`, then the format should always be specified.

This was sanity tested with the following code:
```
import streamlit as st
from PIL import Image

image = Image.open('google.png')
resized_image = image.resize([100,200])
st.write(resized_image.format)
st.image(resized_image, caption='GOOGLE')
```
which shows the format being `none` in the first line: 
<img width="1101" alt="Screenshot 2023-07-27 at 12 01 25 AM" src="https://github.com/streamlit/streamlit/assets/16749069/bfc50a38-4670-4515-984c-2a11340915ac">

and a print statement:
<img width="1168" alt="Screenshot 2023-07-27 at 12 03 29 AM" src="https://github.com/streamlit/streamlit/assets/16749069/2681ff44-ebff-42d2-9b4a-5a37a47902ea">



## Describe your changes
- replace `imghdr` with `pillow`
## GitHub Issue Link (if applicable)
- streamlit#7027
## Testing Plan
- Explanation of why no additional tests are needed
- Unit Tests (JS and/or Python)
- E2E Tests
- Any manual testing needed?
  - none needed from my perspective

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
Handles column specification in altair charts by passing header defaults for fonts/colors to both default and streamlit chart themes in CustomTheme.tsx
This PR change is a reworking of a process to upload files for st.file_uploader and st.camera_input.
It introduces the abstraction for UploadedFileManager, the default implementation continues to store files in memory.

Now the process of uploading file will consist from two steps

Issuing upload file URLs (happen via web socket communication, file_urls_request handler).
Upload a file to the URL issued in step 1.
Abstracts certain details such as the global style
Bumps [aidan-mundy/react-to-issue](https://github.com/aidan-mundy/react-to-issue) from bc84ae193d0d4a2ca36a9a411ee52e5d065cc415 to 14d172c22f28fabdd86b3458b1701ba1a684bc19.
- [Release notes](https://github.com/aidan-mundy/react-to-issue/releases)
- [Commits](aidan-mundy/react-to-issue@bc84ae1...14d172c)

---
updated-dependencies:
- dependency-name: aidan-mundy/react-to-issue
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…amlit#7093)

Now that we've merged streamlit#7003, some of the comments we have about when certain
fields are written to widget protos are now stale. While removing these comments, we also
move a few lines around so that lines where we're writing to widget protobufs are grouped.
Bumps [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) from 30a3d626642351ee2779298c1baeadb7047e1362 to 716151b9579b05352dbf244d48e968d211889bbc.
- [Release notes](https://github.com/peter-evans/create-or-update-comment/releases)
- [Commits](peter-evans/create-or-update-comment@30a3d62...716151b)

---
updated-dependencies:
- dependency-name: peter-evans/create-or-update-comment
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add ai and human presets

* Also check for human for chat message background

* Update comment

* Fix

* Don't use the set constructor
Add type parameter to download_button (similarly to how it works in st.button)
* Implement toggle widget

* Use updated sizes

* Add e2e tests

* Update e2e tests

* Add toggle unit test

* Add toggle to public API

* Add a long label example

* Optimize spacing

* Rewrite unit tests to RTL

* Fix unit test

* Add toggle snapshots

* Always use label placement right

* Add back unit test

* Apply PR review feedback

* Update e2e widget labels

* Update snapshots
* Fix telemetry and activate deploy dialog

* Remove not needed constant

* Remove .git extension

* Remove feature flag

* Update e2e test

* Remove isTesting functionality
Add gray & rainbow to extend supported markdown colors (currently blue, green, orange, red, violet)
* Refactor expander

* Add expander e2e test

* Migrate additional e2e tests

* Minor cleanups

* Fix comment
* Fix issues with local image as message avatar

* Add chat message e2e playwright test

* Fix unit test issue

* Update chat message snapshots

* Wait until images have loaded

* Add second message reusing the same image

* Increment counter

* Add additional snapshot

* Change timeout

* Change how we wait for image to load

* Add missing snapshot
Convert FE test files for TextInput, TextArea, BaseColorPicker, & ColorPicker from Enzyme to RTL.
Bumps [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) from 716151b9579b05352dbf244d48e968d211889bbc to 38217c6b94b54c0dbbe75be237257364e2dd2e62.
- [Release notes](https://github.com/peter-evans/create-or-update-comment/releases)
- [Commits](peter-evans/create-or-update-comment@716151b...38217c6)

---
updated-dependencies:
- dependency-name: peter-evans/create-or-update-comment
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
lukasmasuch and others added 26 commits August 11, 2023 18:57
…it#7149)

* Stop dropping file uploader state after websocket disconnect

* Stop dropping camera input state after websocket disconnect

* Remove now-unused arg

* Add some e2e tests

* Fix incorrect path in call to jest.requireActual

* Increase timeout to reduce test flakiness
* Add color support to charts, and refactor things a bit.

* Fix tests and types.

* Fix types in type_util

* Removin unnecessary DF cloning, and add test to ensure we're not mutating the orig DF.

* Fix tests in latest Pandas and Arrow.

* Revert st_arrow_add_rows test to avoid too many changes in this PR. Will land in another PR.

* Remove snaps that should be regenerated.

* Don't show labels when no x or y specified (to match existing behavior).

* Update snapshots (need to regenerate)

* Fix bug where x axis was sometimes quantitative rather than temporal.

* Fix x enc when no x_column.

* Fix tests.

* Revert to melting data by hand since Snowflake doesn't include Altair 4.2

* Improve error messages.

* Fix MyPy types

* Update snapshots

* Fix empty check

* Revert setup.py

* Remove dead code.

* simple rename

* Remove more dead code

* Address comments.

* Fix snapshots

* Fix stupid copy/paste bug >_<

* Small cleanup. Always use str() around dataset ids. Should be a no-op since JSON stringifies keys anyways, but this is cleaner.
streamlit#7150)

Describe your changes
Change commitWidgetValue to take in dirty parameter as we need to change dirty to true when committing the widget value
we need to commit the widget value because when autofill is done, the widget value is not committed as thus username will show up to be an empty string without interaction
GitHub Issue Link (if applicable)
streamlit#7101
streamlit#7084

Testing Plan
Explanation of why no additional tests are needed
Unit Tests (JS and/or Python)
readded tests I deleted before with some slight additions
E2E Tests
Any manual testing needed?
yes
it doesn't seem very doable to test autofill functionality. However, I can probably add some tests for commit value being called
Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
* Improve community voting

* Use hashes instead of tags

* Use github cli instead of action

* Fix linting

---------

Co-authored-by: Lukas Masuch <[email protected]>
Update docstrings referencing colored text for the new colors - gray & rainbow. See PR streamlit#7106.
Also allow alternative spellings gray/grey to map to same color.
* Remove old deploy functionality

* Minor refactoring

* Remove outdated snapshots

* Add snapshots

* Fix implementation by using app context instead of outdated state

* Remove export

* FIx linter issue

* Fix linter issue

* Refactor URL handling
* Fix the margin bottom for code in markdown

* Update tests

* Update snapshots

* Remove outdated snapshots

* Update snapshots

* Update e2e tests

* Update snapshots

* Fix wrong snapshot

* Apply review feedback
st.radio - adding a keyword-only param that allows you to add captions/descriptions to radio button options.
These captions support the same markdown as radio button labels (which also don't allow links).
…#7133)

Added a divider param to st.header & st.subheader, takes a str (supported colors: “blue”, “green”, “orange”, “red”, “violet”, “gray”/"grey", or “rainbow”) or bool. If divider=True, the divider color will cycle through selected options (blue -> green -> orange -> red -> violet -> blue ...)
Something strange is happening in the Cypress test environment that is scrambling the desired order of auto-colored heading dividers. Unable to replicate it manually. Going to remove Cypress tests for now since e2e covered by playwright.
* Add icon to expander

* Add implementation for st.status

* Fix

* Add top comment

* Add docstring

* Fixes

* Improve implementation

* Some refactoring

* Minor fixes

* Add auto collapse mode

* Add auto collapse mode

* Various fixes and improvements

* Add empty expander test

* Add empty expander test

* Disallow empty for normal expander

* Apply various updates

* Some refactoring

* Update status container

* Update callback handler

* Change empty state for expander

* Move icon implementation to expander

* Add e2e tests

* Add unit tests

* Add empty expander e2e test

* Update comment

* Cleanups

* Cleanup

* Add metrics

* Update docstring

* Update snapshot

* Add test for empty status

* Use smaller block

* Update docstrings

* Don't change color on hover if empty

* Update docstrings based on feedback

* Minor change

* Update playback tests

* Integrated PR feedback

* Fix test

* Use descriptive names for screenshot tests

* Update status snapshots

* Update st.status docstring

---------

Co-authored-by: Debbie Matthews <[email protected]>
…amlit#7198)

Video from recent flaky run shows timeout error, and since re-running resolves, increase timeout for uploadFile .wait from current 5000ms should resolve most incidences.
z-index on st.chat_input container places it above toasts. Adjusting so toasts display above.
Docstring edits to fix typos and update embedded examples.
Specify mypy-protobuf version in test requirements to <3.4.0 resolve failing python dep min version test
Copy link

@tedsand tedsand left a comment

Choose a reason for hiding this comment

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

LGTM

@kylelrichards11 kylelrichards11 merged commit a22413a into tagup-main Sep 5, 2023
@kylelrichards11 kylelrichards11 deleted the DEV-3371-streamlit-1.26 branch September 5, 2023 15:12
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.