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

Add miscellaneous small changes #8508

Merged
merged 27 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
416f3d8
Add misc changes
LukasMasuch Apr 16, 2024
f0191a4
Add ml dependencies
LukasMasuch Apr 16, 2024
5dde65b
Update the comments of height/width to pixels
LukasMasuch Apr 17, 2024
51e1dd5
Merge branch 'develop' into lukasmasuch/misc-changes
LukasMasuch Apr 17, 2024
57c58ba
Remove cypress comment
LukasMasuch Apr 17, 2024
ddbd573
Remove cypress mentions
LukasMasuch Apr 17, 2024
be0bf98
Add gather metrics for update command
LukasMasuch Apr 30, 2024
0db75c4
Merge remote-tracking branch 'upstream/develop' into lukasmasuch/misc…
LukasMasuch Apr 30, 2024
4a3e92f
Merge remote-tracking branch 'upstream/develop' into lukasmasuch/misc…
LukasMasuch May 18, 2024
989957d
Fix map test to run locally
LukasMasuch May 18, 2024
4dea20d
Merge remote-tracking branch 'upstream/develop' into lukasmasuch/misc…
LukasMasuch May 21, 2024
7c2a688
Update st_json e2e test
LukasMasuch May 21, 2024
4bb3130
Update title
LukasMasuch May 21, 2024
35ee7d6
Remove new line
LukasMasuch May 21, 2024
1e7150d
Fix some nits
LukasMasuch May 21, 2024
a8ee4c5
Update snapshots
LukasMasuch May 21, 2024
5f92de9
Remove unused entrypoint.sh file
LukasMasuch May 22, 2024
1b493f4
Merge branch 'develop' into lukasmasuch/misc-changes
sfc-gh-lmasuch May 22, 2024
11b4852
Add missing snapshots
LukasMasuch May 22, 2024
43f5a93
Remove useless step
LukasMasuch May 22, 2024
23d7e69
Upgrade upload job to v4
LukasMasuch May 22, 2024
f2b7357
Use e2e test asset folder
LukasMasuch May 24, 2024
7d1c8e1
Merge remote-tracking branch 'upstream/develop' into lukasmasuch/misc…
LukasMasuch May 24, 2024
1a260c0
Merge remote-tracking branch 'upstream/develop' into lukasmasuch/misc…
LukasMasuch May 28, 2024
23b7221
Remove query params update
LukasMasuch May 28, 2024
f3f5788
Fix page config test
LukasMasuch May 28, 2024
8b80b18
Merge branch 'develop' into lukasmasuch/misc-changes
LukasMasuch May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions e2e_playwright/st_set_page_config_icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from pathlib import Path
import os

import streamlit as st

icon_path = Path(__file__).parent.parent.joinpath("assets/favicon.ico")
if not icon_path.is_file():
print(f"Missing favicon at {str(icon_path)}")
exit(1)
# Construct test assets path relative to this script file to
# allow its execution with different working directories.
TEST_ASSETS_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "test_assets"
)
ICON_PATH = os.path.join(TEST_ASSETS_DIR, "favicon.ico")

st.set_page_config(page_icon=str(icon_path))
st.set_page_config(page_icon=str(ICON_PATH))
File renamed without changes.
2 changes: 1 addition & 1 deletion frontend/lib/src/util/UriUtil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ describe("isValidOrigin", () => {
expect(
isValidOrigin(
"http://localhost",
// Example of localhost url used by Cypress
// Example of localhost url used by e2e test
"http://localhost:35475"
)
).toBeTruthy()
Expand Down
2 changes: 1 addition & 1 deletion frontend/lib/src/util/UriUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export function isValidOrigin(
}

// Allow localhost w/ any port for testing of host <-> guest communication
// using hostframe.html (facilitates manual & Cypress e2e testing)
// using hostframe.html (facilitates manual & e2e testing)
if (
allowedUrl.protocol !== testUrl.protocol ||
(allowedUrl.port !== testUrl.port && testUrl.hostname !== "localhost")
Expand Down
43 changes: 0 additions & 43 deletions lib/entrypoint.sh

This file was deleted.

1 change: 1 addition & 0 deletions lib/streamlit/elements/empty.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@


class EmptyMixin:
@gather_metrics("empty")
def empty(self) -> DeltaGenerator:
"""Insert a single-element container.

Expand Down
4 changes: 4 additions & 0 deletions lib/streamlit/runtime/metrics_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@
"litellm",
"comet_llm",
"instructor",
"xgboost",
"lightgbm",
"catboost",
"sklearn",
# Workflow Tools:
"prefect",
"luigi",
Expand Down
22 changes: 13 additions & 9 deletions lib/tests/streamlit/elements/map_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,23 @@ def test_basic(self):
self.assertEqual(c.get("initialViewState").get("pitch"), 0)
self.assertEqual(c.get("layers")[0].get("@@type"), "ScatterplotLayer")

@parameterized.expand(
itertools.product(
def test_alternative_names_columns(self):
"""Test that it can be called with alternative names of lat/lon columns."""
name_combination = itertools.product(
{"lat", "latitude", "LAT", "LATITUDE"},
{"lon", "longitude", "LON", "LONGITUDE"},
)
)
def test_alternative_names_columns(self, lat_column_name, lon_column_name):
"""Test that it can be called with alternative names of lat/lon columns."""
df = mock_df.rename(columns={"lat": lat_column_name, "lon": lon_column_name})
st.map(df)

c = json.loads(self.get_delta_from_queue().new_element.deck_gl_json_chart.json)
self.assertEqual(len(c.get("layers")[0].get("data")), 4)
for lat_column_name, lon_column_name in name_combination:
df = mock_df.rename(
columns={"lat": lat_column_name, "lon": lon_column_name}
)
st.map(df)

c = json.loads(
self.get_delta_from_queue().new_element.deck_gl_json_chart.json
)
self.assertEqual(len(c.get("layers")[0].get("data")), 4)

def test_map_uses_convert_anything_to_df(self):
"""Test that st.map uses convert_anything_to_df to convert input data."""
Expand Down
2 changes: 0 additions & 2 deletions lib/tests/streamlit/runtime/metrics_util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,7 @@ def test_public_api_commands(self):
"connection",
"experimental_connection",
"spinner",
"empty",
"progress",
"get_option",
}

# Create a list of all public API names in the `st` module (minus
Expand Down
4 changes: 2 additions & 2 deletions proto/streamlit/proto/Arrow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ message Arrow {
bytes data = 1;
// Pandas styler information
Styler styler = 2;
// Width in CSS points
// Width in pixels
uint32 width = 3;
// Height in CSS points
// Height in pixels
uint32 height = 4;
// If True, will overwrite the dataframe width to fit to container.
bool use_container_width = 5;
Expand Down
4 changes: 2 additions & 2 deletions proto/streamlit/proto/ForwardMsg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ message ForwardMsgMetadata {
// DEPRECATED: This is not used anymore.
// Specifies the dimensions for the element
message ElementDimensionSpec {
// width in CSS points
// width in pixels
uint32 width = 1;

// height in CSS points
// height in pixels
uint32 height = 2;
}
2 changes: 1 addition & 1 deletion proto/streamlit/proto/Skeleton.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ message Skeleton {
// Skeleton visual style
SkeletonStyle style = 1;

// Height in CSS points
// Height in pixels
optional int32 height = 2;
}