IAMconsortium / pyam

Analysis & visualization of energy & climate scenarios
https://pyam-iamc.readthedocs.io/
Apache License 2.0
222 stars 116 forks source link

Unexpected failures with incorrect permissions in the IIASA database system #676

Closed danielhuppmann closed 1 year ago

danielhuppmann commented 2 years ago

When a user has access to a Scenario Explorer database instance but no permission to view any models (or no scenarios exist), querying data from the API fails with an error similar to

  if nmissing == len(indexer):
      if use_interval_msg:
          key = list(key)
              raise KeyError(f"None of [{key}] are in the [{axis_name}]")
E KeyError: "None of [Index(['model', 'scenario', 'version', 'is_default', 'run_id'], dtype='object')] are in the [columns]"

The pyam.iiasa module should check that a response exists before casting to an IamDataFrame.

danielhuppmann commented 1 year ago

Seems that this isn't yet fully resolved, see https://github.com/IAMconsortium/pyam/issues/693#issuecomment-1231479261...