Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Fix panic from Go maps with primitive types#370

Merged
mattjohnsonpint merged 3 commits intomainfrom
mjp/hyp-2171-maps-of-primitive-types-are-failing-when-built-from-the-go
Sep 18, 2024
Merged

Fix panic from Go maps with primitive types#370
mattjohnsonpint merged 3 commits intomainfrom
mjp/hyp-2171-maps-of-primitive-types-are-failing-when-built-from-the-go

Conversation

@mattjohnsonpint
Copy link
Contributor

If a plugin compiled from the Go SDK used a map with a primitive type as it's value or key, a panic occurred in the runtime when the plugin was loaded.

This was due to the mapHandler presuming that the keys and values could be written using a sliceHandler. In the case of primitives, they're written with a primitiveSliceHandler instead.

Fixed, and added tests.

@mattjohnsonpint mattjohnsonpint requested a review from a team September 18, 2024 04:20
@linear
Copy link

linear bot commented Sep 18, 2024

HYP-2171 Maps of primitive types are failing when built from the Go SDK

ex: map[string]float32 on a function parameter is causing a panic when the execution plan is built.

This is due to some optimizations in the Go languages support, for passing slices of primitives, which weren't accounted for in the maps handler.

@mattjohnsonpint mattjohnsonpint enabled auto-merge (squash) September 18, 2024 04:21
@mattjohnsonpint mattjohnsonpint merged commit 3c07ba1 into main Sep 18, 2024
@mattjohnsonpint mattjohnsonpint deleted the mjp/hyp-2171-maps-of-primitive-types-are-failing-when-built-from-the-go branch September 18, 2024 04:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants