Skip to content

Fix: Handle None values in has_fa_suffix() for pretrained classifiers#184

Open
clementcoclet wants to merge 1 commit intoV2from
fix/has_fa_suffix_handle_none
Open

Fix: Handle None values in has_fa_suffix() for pretrained classifiers#184
clementcoclet wants to merge 1 commit intoV2from
fix/has_fa_suffix_handle_none

Conversation

@clementcoclet
Copy link
Collaborator

Description

Fixes an AttributeError that occurs when using a pretrained classifier with the naive-bayes classification method. The has_fa_suffix() function was being called on None values for refseqs_file and taxa_file, which are correctly set to null when using a pretrained classifier.

Changes

  • Modified has_fa_suffix() function to check for None and empty string values before calling .endswith()
  • Returns False for None or empty values, allowing the if/elif chain to proceed correctly

Error Fixed

- Add check for None and empty string values before calling endswith()
- Prevents AttributeError when refseqs_file/taxa_file are None for pretrained classifiers
- Fixes issue where naive-bayes with pretrained_classifier fails when refseqs_file is null
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

Successfully merging this pull request may close these issues.

1 participant