pyam
pyam copied to clipboard
Unexpected failures with incorrect permissions in the IIASA database system
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.