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

Use raw number for number column overlay and copy #8708

Merged
merged 27 commits into from
May 27, 2024

Conversation

LukasMasuch
Copy link
Collaborator

@LukasMasuch LukasMasuch commented May 18, 2024

Describe your changes

This PR enforces that the raw number value is used in the cell overlay and as copy value without any formatting applied. This was always supposed to be the case, but wasn't fully enforced in the number column yet.

Demo

GitHub Issue Link (if applicable)

Testing Plan

  • Added unit test and updated tests.

Contribution License Agreement

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

@LukasMasuch LukasMasuch changed the title Use raw number for number column overlay and copy [WIP] Use raw number for number column overlay and copy May 18, 2024
@LukasMasuch LukasMasuch added type:enhancement Requests for feature enhancements or new features security-assessment-completed impact:users labels May 23, 2024
@LukasMasuch LukasMasuch added change:feature and removed type:enhancement Requests for feature enhancements or new features labels May 23, 2024
@LukasMasuch LukasMasuch marked this pull request as ready for review May 23, 2024 14:26
@LukasMasuch LukasMasuch changed the title [WIP] Use raw number for number column overlay and copy Use raw number for number column overlay and copy May 23, 2024
@raethlein
Copy link
Collaborator

raethlein commented May 23, 2024

Could you please add a screenshot of before and after to make it really easy to spot the difference in the dataframe (the demo only shows the new behavior)?

@LukasMasuch
Copy link
Collaborator Author

LukasMasuch commented May 23, 2024

Could you please add a screenshot of before and after to make it really easy to spot the difference in the dataframe (the demo only shows the new behavior)?

There isn't any change in the table rendering. But there is a small visible change in the overlay editor for which we don't have any e2e tests yet. I'm currently attempting to build something to e2e test this, but not sure how much effort it is.

@LukasMasuch
Copy link
Collaborator Author

LukasMasuch commented May 24, 2024

@raethlein I added additional e2e tests to test the visuals in the overlay editor within the + migrated the expect written text method to app_utils. Its ready for another round of review.

from playwright.sync_api import Locator, expect


def expect_prefixed_markdown(
Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks for extracting the utils functions. I hoped that it could also be used for the expect_written_text function in the st_altair_chart_basic_select function here, so I believe it would make sense to offer it directly in a way where it'd be compatible. But can also be done in a future PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated st_altair_chart_basic_select to use the utils method 👍

"""
# This is currently the best way to get the cell overlay
# We should eventually add a stable test ID to the cell overlay
# within GDG to better target it.
Copy link
Collaborator

@raethlein raethlein May 26, 2024

Choose a reason for hiding this comment

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

nit: "GDG" -> glide data grid. I expect no one very familiar with the matter to know the abbreviation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Renamed

)

cell_overlay_test_column_config = {
# the e2e test requires all cells to medium width
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: could you add a short comment why the e2e test requires this, please?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added 👍

@LukasMasuch
Copy link
Collaborator Author

@raethlein Ready for another round

Copy link
Collaborator

@raethlein raethlein left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@LukasMasuch LukasMasuch merged commit 32667dd into develop May 27, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Commas can't be removed from numbers in st.dataframe
2 participants