Closed dchess closed 4 years ago
@zkagin It looks like the shape of the orgUnit dataframe is pivoted and the row index is now the column header. I was able to get this work by changing it to:
ou_id = None if result.empty else result[1].iloc[0]
But that is pretty obtuse. I'm wondering if this is related the the df.reindex()
function that is being used now.
I think it's the filter_data
line in OrgUnits causing the issue, I'm looking into it now.
I figured out how to create Org Units and was able to repro the bug, so hopefully will have a fix shortly.
Nope, wasn't that: the pivoting is happening at the line all_data = all_data.append(df)
.
Looking at why that's the case and what we can do instead now.
https://github.com/kipp-bayarea/google_classroom/pull/30
This is a quick fix for now. I need to look a little bit more closely at pandas append behavior to fully understand why this is happening and whether there is a better solution long-term.
https://github.com/kipp-bayarea/google_classroom/blob/e8e40c5ae5891adf1eb94ef1b717f9a6a0d91b9c/api.py#L169-L171
@zkagin I am encountering an issue running the latest branch (traceback below)