Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error thrown if drive filter excludes all drives #7

Open
chazlarson opened this issue Nov 4, 2021 · 0 comments
Open

Error thrown if drive filter excludes all drives #7

chazlarson opened this issue Nov 4, 2021 · 0 comments

Comments

@chazlarson
Copy link

I have no shared drives with BAZ in the name:

(safire-venv) ➜  safire git:(master) ✗ ./safire.py list drives BAZ
Traceback (most recent call last):
  File "./safire.py", line 701, in <module>
    main()
  File "./safire.py", line 697, in main
    fire.Fire(Commands)
  File "/opt/safire/safire-venv/lib/python3.8/site-packages/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/opt/safire/safire-venv/lib/python3.8/site-packages/fire/core.py", line 466, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "/opt/safire/safire-venv/lib/python3.8/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "./safire.py", line 88, in drives
    self._export(drivelist, filter, file_tag, ["id", "name"], "drives", prt)
  File "/opt/safire/safire/utils.py", line 44, in _export
    print(df[fields])
  File "/opt/safire/safire-venv/lib/python3.8/site-packages/pandas/core/frame.py", line 3464, in __getitem__
    indexer = self.loc._get_listlike_indexer(key, axis=1)[1]
  File "/opt/safire/safire-venv/lib/python3.8/site-packages/pandas/core/indexing.py", line 1314, in _get_listlike_indexer
    self._validate_read_indexer(keyarr, indexer, axis)
  File "/opt/safire/safire-venv/lib/python3.8/site-packages/pandas/core/indexing.py", line 1374, in _validate_read_indexer
    raise KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Index(['id', 'name'], dtype='object')] are in the [columns]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant