While I am using this great library, I came to need to retrieve raw data itself.
So if we can add return_raw_data option for operations which returns item (e.g., get, batch_get, scan ... ), I think it will be helpful for using flexibility of DynamoDB schemaless characteristic.
I'll introduce an example situation:
If I want to change an attribute type of certain table, it is very easily allowed on DynamoDB - You can just put new item with attribute type you desire.
class SampleModel(Model):
id = UnicodeAttribute()
document = MapAttribute()
and if you want to change attribute data type of document to,
class SampleModel(Model):
id = UnicodeAttribute()
document = NumberAttribute() # changed attribute data type
This changed model will produce TypeError: string indices must be integers on Model.from_raw_data() since this should be returned as integer from botocore.
For resolving this, you have to update all document attribute of all items as newly changed attribute type.
I think return_raw_data option can handle this issue, without migration.
I will PR regarding on this issue in short period of term.
Hello,
While I am using this great library, I came to need to retrieve raw data itself. So if we can add
return_raw_data
option for operations which returns item (e.g., get, batch_get, scan ... ), I think it will be helpful for using flexibility of DynamoDB schemaless characteristic.I'll introduce an example situation:
and if you want to change attribute data type of
document
to,This changed model will produce
TypeError: string indices must be integers
onModel.from_raw_data()
since this should be returned as integer from botocore.For resolving this, you have to update all
document
attribute of all items as newly changed attribute type.I think
return_raw_data
option can handle this issue, without migration. I will PR regarding on this issue in short period of term.