cBioPortal / icebox

very low priority issues
0 stars 0 forks source link

Objects in Python Client created with bravado don't have DICT object (__dict__ attribute missing) #297

Open tdeboer-ilmn opened 2 years ago

tdeboer-ilmn commented 2 years ago

After creation of a PYTHON Client API with bravado, the various classes (like studies etc.) don't seem to have the correct definition, since they are missing the dict attribute:

from bravado.client import SwaggerClient

cbioportal = SwaggerClient.from_url(
    'https://www.cbioportal.org/api/api-docs',
    config={
        "validate_requests":False,
        "validate_responses":False,
        "validate_swagger_spec":False
    })

studies = cbioportal.Studies.getAllStudiesUsingGET().result()
sorted_studies = sorted(studies, key=lambda x: x.allSampleCount)
from pprint import pprint
pprint(vars(sorted_studies[-1])['_Model__dict'])

Results in this error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/tmp/ipykernel_3305572/1839231580.py in <module>
     12 sorted_studies = sorted(studies, key=lambda x: x.allSampleCount)
     13 from pprint import pprint
---> 14 pprint(vars(sorted_studies[-1])['_Model__dict'])

TypeError: vars() argument must have __dict__ attribute

Not sure if this is related with issue cBioPortal/icebox#298 but not likely.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.