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

Fix crash when initial selection contains mix of string and bool #274

Merged
merged 3 commits into from
Mar 23, 2023

Conversation

jonmmease
Copy link
Collaborator

Fix a crash when a Vega spec contains an initial selection like this:

        [
            {
              "unit": "",
              "fields": [
                {"field": "Major Genre", "channel": "x", "type": "E"},
                {"field": "is_pg", "channel": "color", "type": "E"}
              ],
              "values": ["Adventure", true]
            },
            {
              "unit": "",
              "fields": [
                {"field": "Major Genre", "channel": "x", "type": "E"},
                {"field": "is_pg", "channel": "color", "type": "E"}
              ],
              "values": ["Comedy", false]
            }
        ]

When converting to arrow, the true and false scalars get converted to the string "true" and "false", which resulted in the following error in vlSelectionTest.

'Boolean = Utf8' can't be evaluated because there isn't a common type to coerce the types to

This fixes the crash, by converting the strings "true" and "false" back to booleans when a string is compared to a boolean.

@jonmmease jonmmease merged commit 6b0e04c into main Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant