Plugin error: issubclass() arg 1 must be a class

I've got my plugin set up without any errors, but now when I try to run the basic percentile-normalize function (which is currently just a print statement that's supposed to return one of the inputs), I get the following error:

Plugin error from perc-norm:

  issubclass() arg 1 must be a class

Full traceback provided in the log file is:

Traceback (most recent call last):
  File "/Users/claire/anaconda/envs/qiime2-2017.12.0-dev/lib/python3.5/site-packages/q2cli/commands.py", line 246, in __call__
    results = action(**arguments)
  File "<decorator-gen-120>", line 2, in percentile_normalize
  File "/Users/claire/anaconda/envs/qiime2-2017.12.0-dev/lib/python3.5/site-packages/qiime2/sdk/action.py", line 222, in bound_callable
    spec.view_type, recorder)
  File "/Users/claire/anaconda/envs/qiime2-2017.12.0-dev/lib/python3.5/site-packages/qiime2/sdk/result.py", line 257, in _view
    to_type = transform.ModelType.from_view_type(view_type)
  File "/Users/claire/anaconda/envs/qiime2-2017.12.0-dev/lib/python3.5/site-packages/qiime2/core/transform.py", line 21, in from_view_type
    if issubclass(view_type, model.base.FormatBase):
TypeError: issubclass() arg 1 must be a class

I'm using the dev qiime release (from qiime2-latest-py35-osx-conda.yml), and you can see my current setup and scripts on the repo. I'm not sure what I'm doing wrong or how to go about debugging this!

Hi @cduvallet! It looks like your method function annotation is using Sematic Types, rather than view types.

If you update that to use something like this:

def percentile_normalize(table: biom.Table,
                         metadata: CategoricalMetadataColumn) -> biom.Table:

you should be able to get moving again. Sorry, this part of the development process is not the most straightforward --- we are working on creating new Developer Docs right now to assist with these common stumbling blocks. Don't hesitate to ping us with more questions! Thanks! :t_rex:

1 Like

Awesome, thanks @thermokarst. Figuring out my way around the different data types has been the most difficult part of getting started. FWIW - would be happy to provide feedback on any docs y'all are working on.

3 Likes