Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ def read_array(column, type)
when DictionaryType
validity_buffer = read_bitmap(column["VALIDITY"])
indices_buffer = read_values(column["DATA"], type.index_type)
dictionary = read_dictionary(type.id, type.value_type)
dictionary_array = read_dictionary(type.id, type.value_type)

Copilot AI Apr 1, 2026

Copy link

Choose a reason for hiding this comment

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

read_dictionary can return nil when the dictionary id isn't present in the JSON. Wrapping that in Dictionary.new(type.id, dictionary_array) will defer the failure to a later NoMethodError (e.g., when DictionaryArray#to_a calls dictionary.array). Consider raising a clear exception here if dictionary_array is nil (include the dictionary id and value type) to fail fast with an actionable error.

Suggested change
dictionary_array = read_dictionary(type.id, type.value_type)
dictionary_array = read_dictionary(type.id, type.value_type)
if dictionary_array.nil?
raise "Dictionary with id #{type.id} and value type " \
"#{type.value_type.inspect} is missing from JSON dictionaries"
end

Copilot uses AI. Check for mistakes.
dictionary = Dictionary.new(type.id, dictionary_array)
type.build_array(length,
validity_buffer,
indices_buffer,
Expand Down
Loading