PynamoDB icon indicating copy to clipboard operation
PynamoDB copied to clipboard

Need Polymorphism Batch Get Support

Open jl-DaDar opened this issue 3 years ago • 3 comments

Currently Pynamodb Polymorphism does not support Batch Get. But this sort of defeat the purpose of putting different items types in the same table.

A lot of time polymorphism is used to store data that are somewhat different, but many time we need to grab them together because it belongs to the same hash or not. If we wanted to get them separately we could have just used separate table and not deal with polymorphism

jl-DaDar avatar Feb 25 '22 10:02 jl-DaDar

I tested this myself and batch-get works as expected, even with a table on which Polymorphism is enabled. You are probably making a mistake in your setup. Without you providing a detailed example of what you're doing wrong, I suggest we close this issue.

mstykow avatar May 18 '22 17:05 mstykow

Did you try batch-get to fetch items from multiple children table? can you show me your working example?

jl-DaDar avatar May 20 '22 10:05 jl-DaDar

The point of polymorphism is that you have a single table with multiple different models. Not sure what you then mean by "multiple children table". But if you want further advice, I think you should post your non-working example here instead of me showing you a working one (for that you can check out the PynamoDB docs).

mstykow avatar May 20 '22 12:05 mstykow