datasets icon indicating copy to clipboard operation
datasets copied to clipboard

ApiTypeError

Open Viromic opened this issue 2 years ago • 2 comments

probably just a misnomer /tmp/ipykernel_48/688326240.py in 7 refseq_only=True, 8 exclude_sequence=False, ----> 9 _preload_content=False 10 ) 11

/srv/conda/envs/notebook/lib/python3.7/site-packages/ncbi/datasets/openapi/api/virus_api.py in virus_genome_download(self, taxon, **kwargs) 945 self.gene_download_summary_by_accession_endpoint.headers_map[key] = headers[key] 946 --> 947 return self.virus_genome_download_endpoint.call_with_http_info(**kwargs) 948 949 def virus_genome_summary(

/srv/conda/envs/notebook/lib/python3.7/site-packages/ncbi/datasets/openapi/api_client.py in call_with_http_info(self, **kwargs) 816 ) 817 --> 818 self.__validate_inputs(kwargs) 819 820 params = self.__gather_params(kwargs)

/srv/conda/envs/notebook/lib/python3.7/site-packages/ncbi/datasets/openapi/api_client.py in __validate_inputs(self, kwargs) 716 False, 717 kwargs['_check_input_type'], --> 718 configuration=self.api_client.configuration 719 ) 720 kwargs[key] = fixed_val

/srv/conda/envs/notebook/lib/python3.7/site-packages/ncbi/datasets/openapi/model_utils.py in validate_and_convert_types(input_value, required_types_mixed, path_to_item, spec_property_naming, _check_type, configuration) 1575 key_type=False, 1576 must_convert=True, -> 1577 check_type=_check_type 1578 ) 1579 return converted_instance

/srv/conda/envs/notebook/lib/python3.7/site-packages/ncbi/datasets/openapi/model_utils.py in attempt_convert_item(input_value, valid_classes, path_to_item, configuration, spec_property_naming, key_type, must_convert, check_type) 1447 if configuration is None or not configuration.discard_unknown_keys: 1448 raise get_type_error(input_value, path_to_item, valid_classes, -> 1449 key_type=key_type) 1450 for valid_class in valid_classes_coercible: 1451 try:

ApiTypeError: Invalid type for variable 'taxon'. Required value type is str and passed type was int at ['taxon']

Viromic avatar Jan 07 '22 01:01 Viromic

Hi Viromic,

Thanks for your feedback. This bug should be fixed in the latest version of the python package. Please try upgrading to the latest version of the python package:

pip install --upgrade ncbi-datasets-pylib

Best, Eric

Eric Cox, PhD [Contractor] (he/him/his) NCBI Datasets Sequence Enhancements, Tools and Delivery (SeqPlus) NIH/NLM/NCBI [email protected]

ericcox1 avatar Jan 10 '22 20:01 ericcox1

Hi Eric,

I've tried upgrading but still get the error:

ApiTypeError: Invalid type for variable 'taxon'. Required value type is str and passed type was int at ['taxon']`

khanfs avatar Jul 01 '22 14:07 khanfs