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

grass.jupyter: Ensure width and height in InteractiveMap are integers #4221

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

cwhite911
Copy link
Contributor

The users input wasn't getting checked here causing the query to fail if the user defined the width parameter as a string.

The code below would render the map and fail when the query_vector tried to return.

m = gj.InteractiveMap(width="500", map_backend="ipyleaflet")

@github-actions github-actions bot added Python Related code is in Python libraries notebook labels Aug 23, 2024
Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

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

This should be solved in InteractiveMap constructor. Simplest would be to do:

        self.width = int(width)
        self.height = int(height)

and let it throw the exception.

@cwhite911
Copy link
Contributor Author

This should be solved in InteractiveMap constructor. Simplest would be to do:

        self.width = int(width)
        self.height = int(height)

and let it throw the exception.

That makes sense.

@petrasovaa petrasovaa enabled auto-merge (squash) August 28, 2024 19:20
@petrasovaa petrasovaa changed the title grass.jupyter: InteractiveQueryController width check bug grass.jupyter: Ensure width and height in InteractiveMap are integers Aug 28, 2024
@petrasovaa petrasovaa merged commit 931a11c into OSGeo:main Aug 28, 2024
26 checks passed
@neteler neteler added this to the 8.5.0 milestone Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libraries notebook Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants