You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #280 we added the first instance of nesting a list of one type of object inside another. While this generally works well, there is a small side effect: The 'submissions' key:value pair is removed from the attributes dict. This is potentially misleading, since one of the uses of calling attributes is to see what data was originally used to create the object (via .to_json()).
'submissions' being removed may give the (incorrect) impression that submissions were never returned from Canvas.
To Reproduce
Steps to reproduce the behavior:
Create a GroupedSubmission object with nested submissions
Print the attributes of the created object (print(grouped_submission.attributes))
Observe that there is no 'submissions' key:value pair
Expected behavior
'submissions' should be visible in the printed attributes, to assist in debugging.
Environment information
Python version (python --version)
3.7+
CanvasAPI version (pip show canvasapi)
0.14.0
Additional context
This is somewhat related to #56, as we'll need to be careful about deleting keys in the future.
The text was updated successfully, but these errors were encountered:
The issue lies here. We're deleting the 'submissions' key before it's passed off to CanvasObject.__init__(). We could call super() first, then override self.submissions after, although that does mean a little bit of extra processing.
Describe the bug
In #280 we added the first instance of nesting a list of one type of object inside another. While this generally works well, there is a small side effect: The
'submissions'
key:value pair is removed from theattributes
dict. This is potentially misleading, since one of the uses of callingattributes
is to see what data was originally used to create the object (via.to_json()
).'submissions'
being removed may give the (incorrect) impression that submissions were never returned from Canvas.To Reproduce
Steps to reproduce the behavior:
GroupedSubmission
object with nested submissionsprint(grouped_submission.attributes)
)'submissions'
key:value pairExpected behavior
'submissions'
should be visible in the printed attributes, to assist in debugging.Environment information
Python version (
python --version
)3.7+
CanvasAPI version (
pip show canvasapi
)0.14.0
Additional context
This is somewhat related to #56, as we'll need to be careful about deleting keys in the future.
The text was updated successfully, but these errors were encountered: