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

[WIP] Explore dataframe max depth issue #8555

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ playwright-custom-components:
cd e2e_playwright; \
rm -rf ./test-results; \
pip install extra-streamlit-components streamlit-ace streamlit-antd-components streamlit-aggrid streamlit-autorefresh streamlit-chat streamlit-echarts streamlit-folium streamlit-lottie streamlit-option-menu streamlit-url-fragment; \
pytest ${custom_components_test_folder} --browser webkit --browser chromium --browser firefox --video retain-on-failure --screenshot only-on-failure --output ./test-results/ -n auto --reruns 1 --reruns-delay 1 --rerun-except "Missing snapshot" --durations=5 -r aR -v
pytest ${custom_components_test_folder} --tracing retain-on-failure --browser webkit --browser chromium --browser firefox --video retain-on-failure --screenshot only-on-failure --output ./test-results/ -n auto --reruns 1 --reruns-delay 1 --rerun-except "Missing snapshot" --durations=5 -r aR -v

.PHONY: loc
# Count the number of lines of code in the project.
Expand Down
2 changes: 1 addition & 1 deletion e2e_playwright/st_popover.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

with st.popover("popover 4 (with dataframe)", help="help text"):
st.markdown("Popover with dataframe")
st.dataframe(df, use_container_width=False)
st.dataframe(df, use_container_width=True)
st.image(np.repeat(0, 100).reshape(10, 10))

with st.sidebar.popover("popover 5 (in sidebar)"):
Expand Down
6 changes: 5 additions & 1 deletion e2e_playwright/st_popover_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@
)


def test_fullscreen_mode_is_disabled_in_popover(app: Page):
def test_fullscreen_mode_is_disabled_in_popover(
app: Page, assert_snapshot: ImageCompareFunction
):
"""Test that the fullscreen mode is disabled within a popover container."""
# Get the fullscreen elements popover container:
popover_element = app.get_by_test_id("stPopover").nth(4)
Expand All @@ -138,13 +140,15 @@

# Check dataframe toolbar:
dataframe_element = popover_container.get_by_test_id("stDataFrame").nth(0)
expect(dataframe_element).to_be_visible()

Check failure on line 143 in e2e_playwright/st_popover_test.py

View workflow job for this annotation

GitHub Actions / test

test_fullscreen_mode_is_disabled_in_popover[chromium] AssertionError: Locator expected to be visible Actual value: None Call log: LocatorAssertions.to_be_visible with timeout 5000ms - waiting for get_by_test_id("stPopoverBody").get_by_test_id("stDataFrame").first

Check failure on line 143 in e2e_playwright/st_popover_test.py

View workflow job for this annotation

GitHub Actions / test

test_fullscreen_mode_is_disabled_in_popover[chromium] AssertionError: Locator expected to be visible Actual value: None Call log: LocatorAssertions.to_be_visible with timeout 5000ms - waiting for get_by_test_id("stPopoverBody").get_by_test_id("stDataFrame").first
dataframe_toolbar = dataframe_element.get_by_test_id("stElementToolbar")
# Hover over dataframe
dataframe_element.hover()
# Should only have two buttons, search + download CSV
expect(dataframe_toolbar.get_by_test_id("stElementToolbarButton")).to_have_count(2)

assert_snapshot(popover_container, name="st_popover-container")


def test_show_tooltip_on_hover(app: Page):
"""Test that the tooltip is shown when hovering over a popover button."""
Expand Down
4 changes: 3 additions & 1 deletion frontend/lib/src/components/core/Block/Block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ const VerticalBlock = (props: BlockPropsWithoutWidth): ReactElement => {

// The width should never be set to 0 since it can cause
// flickering effects.
setWidth(entry.target.getBoundingClientRect().width || -1)
setWidth(
Math.floor(entry.target.getBoundingClientRect().width) || -1
)
})
}),
[setWidth]
Expand Down