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

Explicitly floor start row/col and ceil end row/col #1112

Merged
merged 2 commits into from
Jul 26, 2020
Merged

Conversation

sc1f
Copy link
Contributor

@sc1f sc1f commented Jul 6, 2020

This PR prevents to_format from being called with float start/end row and column indices, and unifies behavior across Javascript and Python bindings. This fixes an issue with perspective-datagrid where float start/end row indices were being sent to a perspective-python Table, and rejected by a C++ function whose parameters were integers.

For start_row and start_col, floor is called - so requesting a start row of 0.3 would start at 0, and not at 1. For end_row and end_col, ceil is called so that an end row of 1.2 would return 2, and not 1. This means that the data window should never be smaller than requested by the plugin.

@sc1f sc1f added internal Internal refactoring and code quality improvement JS Python labels Jul 6, 2020
@sc1f
Copy link
Contributor Author

sc1f commented Jul 9, 2020

Fixes #1115

Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

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

Looks good!

@texodus texodus merged commit 39a74e1 into master Jul 26, 2020
@texodus
Copy link
Member

texodus commented Jul 26, 2020

Thanks for the PR!

@texodus texodus deleted the fix-data-slice branch July 26, 2020 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal refactoring and code quality improvement JS Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants