Open garawaa opened 1 year ago
@garawaa can you please share what your input was?
docref = self.db.document(docPath)
doc = docref.get()
data = doc.to_dict()
try:
doc_size = document_size(data)
except Exception as e:
print(e)
When document contains a document reference value it gives an exception.
Traceback (most recent call last): File "D:\Python39\lib\site-packages\firestore_size\calculate.py", line 75, in document_size return additional_document_size + _calculate_size(document) File "D:\Python39\lib\site-packages\firestore_size\calculate.py", line 68, in _calculate_size return _object_size(obj) File "D:\Python39\lib\site-packages\firestore_size\calculate.py", line 44, in _object_size [ File "D:\Python39\lib\site-packages\firestore_size\calculate.py", line 45, in
_calculate_size(key) + _calculate_size(value)
File "D:\Python39\lib\site-packages\firestore_size\calculate.py", line 68, in _calculate_size
return _object_size(obj)
File "D:\Python39\lib\site-packages\firestore_size\calculate.py", line 31, in _object_size
return 16 + sum([len(segment) + 1 for segment in obj._key._path._segments])
AttributeError: 'DocumentReference' object has no attribute '_key'
This is exception message.