Table not sorting

I am trying to sort a table by the magnitude of a vector3

Data structure:
chunks_to_generate = {
[“1,1”] = 1, 0, 1
[“1,2”] = 1, 0, 2
}

sorting code:
– sort by distance from word origin

table.sort(chunks_to_generate, function(a,b)
	return a.Magnitude > b.Magnitude
end)

Problem: table is not sorted at all

Looks like table.sort only works if your table is formatted like:
table = {
[1] = {1, 0, 1},
[2] = {1, 0, 6},
[3] = {12, 0, 1}
}

(Basically, only works if you use table.insert() to setup your table)