Skip to content

unknown fields cause error #2

@adamjakab

Description

@adamjakab

when using an unknown attribute the plugin exits with backtrace:

(beetsdevel) jakabimac:BeetsPluginDescribe jackisback$ beet describe xyz
TYPE(xyz): <class 'beets.dbcore.types.String'>
┌────────────────┬───────────────────────────┐
│ Name           │                     Value │
╞════════════════╪═══════════════════════════╡
│ Field name     │                       xyz │
├────────────────┼───────────────────────────┤
│ Field type     │                      None │
├────────────────┼───────────────────────────┤
│ Auto type      │ beets.dbcore.types.String │
├────────────────┼───────────────────────────┤
│ Count          │                     21426 │
├────────────────┼───────────────────────────┤
│ Unique         │                         1 │
├────────────────┼───────────────────────────┤
│ Most frequent  │                   (21426) │
├────────────────┼───────────────────────────┤
│ Least frequent │                   (21426) │
├────────────────┼───────────────────────────┤
│ Empty          │                     21426 │
└────────────────┴───────────────────────────┘
describe: Unique element histogram
Traceback (most recent call last):
  File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/lib/python3.7/site-packages/beets/ui/__init__.py", line 1266, in main
    _raw_main(args)
  File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/lib/python3.7/site-packages/beets/ui/__init__.py", line 1253, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/Users/jackisback/Documents/Projects/Python/BeetsPluginDescribe/beetsplug/describe/command.py", line 64, in func
    self.handle_display()
  File "/Users/jackisback/Documents/Projects/Python/BeetsPluginDescribe/beetsplug/describe/command.py", line 78, in handle_display
    self.plot_field_data(data_desc)
  File "/Users/jackisback/Documents/Projects/Python/BeetsPluginDescribe/beetsplug/describe/command.py", line 130, in plot_field_data
    fig.barh(values, keys, force_ascii=False)
  File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/lib/python3.7/site-packages/termplotlib/figure.py", line 60, in barh
    self._content.append(barh(*args, **kwargs))
  File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/lib/python3.7/site-packages/termplotlib/barh.py", line 50, in barh
    out.append(fmt.format(*data))
ValueError: '=' alignment not allowed in string format specifier

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions