Skip to content

Commit

Permalink
Merge branch 'develop' into st_form
Browse files Browse the repository at this point in the history
* 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)
  ...
  • Loading branch information
tconkling committed Mar 1, 2021
2 parents 795ca5c + fda0ebd commit e4f2b49
Show file tree
Hide file tree
Showing 84 changed files with 3,113 additions and 1,739 deletions.
14 changes: 7 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ labels: bug, needs triage
assignees: ""
---

# Summary
### Summary

Type here a clear and concise description of the bug. Aim for 2-3 sentences.

# Steps to reproduce
### Steps to reproduce

Code snippet:

Expand All @@ -26,28 +26,28 @@ If applicable, please provide the steps we should take to reproduce the bug:
2. Click on '....'
3. Scroll down to '....'

## Expected behavior:
**Expected behavior:**

Explain what you expect to happen when you go through the steps above, assuming there were no bugs.

## Actual behavior:
**Actual behavior:**

Explain the buggy behavior you experience when you go through the steps above.
If applicable, add screenshots to help explain your problem.

## Is this a regression?
### Is this a regression?

That is, did this use to work the way you expected in the past?
yes / no

# Debug info
### Debug info

- Streamlit version: (get it with `$ streamlit version`)
- Python version: (get it with `$ python --version`)
- Using Conda? PipEnv? PyEnv? Pex?
- OS version:
- Browser version:

# Additional information
### Additional information

If needed, add any other context about the problem here. For example, did this bug come from https://discuss.streamlit.io or another site? Link the original source here!
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ updates:
directory: "/frontend"
schedule:
interval: "daily"
# Pause Dependabot updates. Security updates are unaffected
open-pull-requests-limit: 0

reviewers:
- "streamlit/core"
Expand All @@ -19,6 +21,8 @@ updates:
directory: "/lib"
schedule:
interval: "daily"
# Pause Dependabot updates. Security updates are unaffected
open-pull-requests-limit: 0

reviewers:
- "streamlit/core"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ docs/_static/css/custom.css
# Cypress
########################################################################
frontend/cypress/videos
frontend/cypress/screenshots
__diff_output__
cypress.env.json
frontend/test_results
Expand Down
2 changes: 1 addition & 1 deletion docs/api-examples-source/charts.image.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

IMAGE_URL = "https://images.unsplash.com/photo-1548407260-da850faa41e3?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1487&q=80"

st.image(IMAGE_URL, caption="Sunrise by the mountains", use_column_width=True)
st.image(IMAGE_URL, caption="Sunrise by the mountains")

st.write(
"""
Expand Down
6 changes: 3 additions & 3 deletions docs/api-examples-source/layout.columns1.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

with col1:
st.header("A cat")
st.image("https://static.streamlit.io/examples/cat.jpg", use_column_width=True)
st.image("https://static.streamlit.io/examples/cat.jpg")
st.markdown("By [@phonvanna](https://unsplash.com/photos/0g7BJEXq7sU)")


with col2:
st.header("A dog")
st.image("https://static.streamlit.io/examples/dog.jpg", use_column_width=True)
st.image("https://static.streamlit.io/examples/dog.jpg")
st.markdown("By [@shotbyrain](https://unsplash.com/photos/rmkIqi_C3cA)")


with col3:
st.header("An owl")
st.image("https://static.streamlit.io/examples/owl.jpg", use_column_width=True)
st.image("https://static.streamlit.io/examples/owl.jpg")
st.markdown("By [@zmachacek](https://unsplash.com/photos/ZN4CzqizIyI)")
13 changes: 13 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ This page lists highlights, bug fixes, and known issues for official Streamlit r
$ pip install --upgrade streamlit
```

## Version 0.77.0

_Release date: Feb 23, 2021_

**Features**

- Added a new config option `client.showErrorDetails` allowing the developer to control the granularity of error messages. This is useful for when you deploy an app, and want to conceal from your users potentially-sensitive information contained in tracebacks.

**Notable bug fixes**

- Fixed [bug](https://github.com/streamlit/streamlit/issues/1957) where `st.image` wasn't rendering certain kinds of SVGs correctly.
- Fixed [regression](https://github.com/streamlit/streamlit/issues/2699) where the current value of an `st.slider` was only shown on hover.

## Version 0.76.0

_Release date: February 4, 2021_
Expand Down
22 changes: 7 additions & 15 deletions docs/streamlit_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Shows all config options available for Streamlit, including their current
values:

```bash
# last updated 2021-01-04
# last updated 2021-02-22

[global]

Expand All @@ -97,15 +97,6 @@ disableWatchdogWarning = false
# Default: true
showWarningOnDirectExecution = true

# Level of logging: 'error', 'warning', 'info', or 'debug'.
# Default: 'info'
#
# DEPRECATED.
# global.logLevel has been replaced with logger.level
# This option will be removed on or after 2020-11-30.
#
#logLevel =


[logger]

Expand All @@ -128,6 +119,11 @@ caching = true
# Default: true
displayEnabled = true

# Controls whether uncaught app exceptions are displayed in the browser. By default, this is set to True and Streamlit displays app exceptions and associated tracebacks in the browser.
# If set to False, an exception will result in a generic message being shown in the browser, and exceptions and tracebacks will be printed to the console only.
# Default: true
showErrorDetails = true


[runner]

Expand Down Expand Up @@ -159,7 +155,7 @@ fileWatcherType = "auto"

# Symmetric key used to produce signed cookies. If deploying on multiple replicas, this should be set to the same value across all replicas to ensure they all share the same secret.
# Default: randomly generated secret key.
cookieSecret = "909a66338a19aad71fc0381e2b126f95ec2db3d19094e3c4ad51f866d3bda991"
cookieSecret = "f8b7582082c5a4903916139e55a911170246459cdd73190983f806b7fc81623e"

# If false, will attempt to open a browser window on start.
# Default: false unless (1) we are on a Linux box where DISPLAY is unset, or (2) server.liveSave is set.
Expand Down Expand Up @@ -226,10 +222,6 @@ token = ""

[deprecation]

# Set to false to disable the deprecation warning for the image format parameter.
# Default: "True"
showImageFormat = "True"

# Set to false to disable the deprecation warning for using the global pyplot instance.
# Default: "True"
showPyplotGlobalUse = "True"
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting/sanity-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pip install --upgrade streamlit
streamlit version
```

...and then verify that the version number printed is `0.76.0`.
...and then verify that the version number printed is `0.77.0`.

**Try reproducing the issue now.** If not fixed, keep reading on.

Expand Down
10 changes: 5 additions & 5 deletions e2e/scripts/st_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

# Same-width columns
c1, c2, c3 = st.beta_columns(3)
c1.image(CAT_IMAGE, use_column_width=True)
c2.image(CAT_IMAGE, use_column_width=True)
c3.image(CAT_IMAGE, use_column_width=True)
c1.image(CAT_IMAGE)
c2.image(CAT_IMAGE)
c3.image(CAT_IMAGE)


# Variable-width columns
for c in st.beta_columns((1, 2, 4, 8)):
c.image(CAT_IMAGE, use_column_width=True)
for c in st.beta_columns((1, 2, 3, 4)):
c.image(CAT_IMAGE)
21 changes: 21 additions & 0 deletions e2e/scripts/st_datetimes_dataframe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2018-2021 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import streamlit as st
import pandas as pd

df = pd.DataFrame({"str": ["2020-04-14 00:00:00"]})
df["notz"] = pd.to_datetime(df["str"])
df["yaytz"] = pd.to_datetime(df["str"]).dt.tz_localize("Europe/Moscow")
st.dataframe(df)
5 changes: 0 additions & 5 deletions e2e/scripts/st_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
img = np.repeat(0, 10000).reshape(100, 100)
img800 = np.repeat(0, 640000).reshape(800, 800)

st.set_option("deprecation.showImageFormat", True)
st.image(img, caption="Black Square with deprecated format", format="JPEG", width=100)

st.set_option("deprecation.showImageFormat", False)
st.image(img, caption="Black Square with deprecated format", format="JPEG", width=100)

st.image(img, caption="Black Square as JPEG", output_format="JPEG", width=100)

Expand Down
6 changes: 4 additions & 2 deletions e2e/specs/st_add_rows.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ describe("st.add_rows", () => {
which: 82 // "r"
});

// Wait for 'stale-element' class to go away, so the snapshot looks right.
cy.get(".element-container").should("not.have.class", "stale-element");
// Wait for 'data-stale' attr to go away, so the snapshot looks right.
cy.get(".element-container")
.should("have.attr", "data-stale", "false")
.invoke("css", "opacity", "1");

// Make the ribbon decoration line disappear
cy.get("[data-testid='stDecoration']").invoke("css", "display", "none");
Expand Down
18 changes: 9 additions & 9 deletions e2e/specs/st_columns.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,31 @@ describe("st.column", () => {
cy.visit("http://localhost:3000/");
});

it("creates 3 equal-width columns", () => {
it("creates 2 equal-width columns", () => {
cy.get("[data-testid='stHorizontalBlock'] [data-testid='stBlock']")
.eq(0)
.should("have.css", "flex", "1 1 0%");
.should("have.css", "flex", "1 1 33.3333%");
cy.get("[data-testid='stHorizontalBlock'] [data-testid='stBlock']")
.eq(1)
.should("have.css", "flex", "1 1 0%");
.should("have.css", "flex", "1 1 33.3333%");
cy.get("[data-testid='stHorizontalBlock'] [data-testid='stBlock']")
.eq(2)
.should("have.css", "flex", "1 1 0%");
.should("have.css", "flex", "1 1 33.3333%");
});

it("creates 4 variable-width columns", () => {
cy.get("[data-testid='stHorizontalBlock'] [data-testid='stBlock']")
.eq(3)
.should("have.css", "flex", "1 1 0%");
.should("have.css", "flex", "1 1 10%");
cy.get("[data-testid='stHorizontalBlock'] [data-testid='stBlock']")
.eq(4)
.should("have.css", "flex", "2 1 0%");
.should("have.css", "flex", "1 1 20%");
cy.get("[data-testid='stHorizontalBlock'] [data-testid='stBlock']")
.eq(5)
.should("have.css", "flex", "4 1 0%");
.should("have.css", "flex", "1 1 30%");
cy.get("[data-testid='stHorizontalBlock'] [data-testid='stBlock']")
.eq(6)
.should("have.css", "flex", "8 1 0%");
.should("have.css", "flex", "1 1 40%");
});

it("does not shift layout on a new element", () => {
Expand All @@ -54,6 +54,6 @@ describe("st.column", () => {
// When layout was shifting, there was an old "flex: 8" block here.
cy.get("[data-testid='stHorizontalBlock'] [data-testid='stBlock']")
.eq(3)
.should("have.css", "flex", "1 1 0%");
.should("have.css", "flex", "1 1 10%");
});
});
54 changes: 54 additions & 0 deletions e2e/specs/st_datetimes_dataframe.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* @license
* Copyright 2018-2021 Streamlit Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

describe("st.dataframe", () => {
beforeEach(() => {
cy.visit("http://localhost:3000/");
cy.get(".element-container .stDataFrame")
.find(".ReactVirtualized__Grid__innerScrollContainer")
.find("[data-testid='StyledDataFrameDataCell']")
.as("cells");
});

it("displays datetimes correctly", () => {
const datetimeString = "2020-04-14T00:00:00";

// Assert that notz and yaytz render as desired.
//
// We can't just assert "have.text" against a hardcoded string, because the
// timezone we want displayed depends on whatever timezone the test is
// being run in. So we use moment to dynamically generate the correct
// string.
//
// This feels a little like "tautologically copying the code we're trying
// to test into the test itself," but we're still contingently testing the
// actual important thing, the notz/yaytz logic.

// notz column should show datetime in current timezone
cy.get("@cells")
.eq(1)
.should("have.text", Cypress.moment(datetimeString).format());

// yaytz column should show datetime in provided timezone
cy.get("@cells")
.eq(2)
.should(
"have.text",
Cypress.moment.parseZone(`${datetimeString}+03:00`).format()
);
});
});

0 comments on commit e4f2b49

Please sign in to comment.