fix: resolve nil panic, silent error swallow, and unsafe type assertions in table parser - #32
Open
belowzeroff wants to merge 1 commit into
Conversation
…ons in table parser
- standardColumnParser now returns (interface{}, error) instead of silently
swallowing stringParser errors (was a commented-out return)
- correctedTableIndex guards against nil from correctedIndex before
type assertion (potential panic)
- parseFrameName replaces unsafe .Data.([]interface{}) with safe
key.Index() method, avoiding panic on kdb.KC type
belowzeroff
force-pushed
the
fix/parser-nil-panic-error-propagation
branch
from
July 23, 2026 10:53
21fa10a to
51a7d49
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three fixes in the kdb+ table parser layer:
standardColumnParsersilently swallowed parser errors — Forkdb.K0(mixed list) columns,stringParsercould return an error (e.g. non-string column), but the code had//return nil, fmt.Errorf(...)commented out, silently returning a potentially empty/nil slice. Changed signature to(interface{}, error)and propagated errors to both callers.correctedTableIndexcould panic on nil —correctedIndexreturnsnilfor some inputs, but the result was unconditionally type-asserted as*(*kdb.K). Now guarded with a nil check before assertion.parseFrameNameused unsafe.Data.([]interface{})type assertions — Forkdb.KC(char vector) the underlying Data isstring, not[]interface{}, and for other non-K0 types Data is a typed slice. Replaced with the safekey.Index()method.Verification
go build ./...succeedsgo vet ./...shows no new warnings