docs: update File Classifier Docstring (#3018)

* Update docstring

* Trigger pre-commit hook

* Trigger pre-commit hook

* Incorporate reviewer feedback

* Incorporate reviewer feedback
This commit is contained in:
Branden Chan 2022-08-15 12:37:28 +02:00 committed by GitHub
parent 7312f99584
commit ff38a20863
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 12 deletions

View File

@ -24,12 +24,9 @@ Node that sends out files on a different output edge depending on their extensio
**Arguments**:
- `supported_types`: the file types that this node can distinguish.
Note that it's limited to a maximum of 10 outgoing edges, which
correspond each to a file extension. Such extension are, by default
`txt`, `pdf`, `md`, `docx`, `html`. Lists containing more than 10
elements will not be allowed. Lists with duplicate elements will
also be rejected.
- `supported_types`: The file types that this node can distinguish between.
The default values are: `txt`, `pdf`, `md`, `docx`, and `html`.
Lists with duplicate elements are not allowed.
<a id="file_type.FileTypeClassifier.run"></a>

View File

@ -33,12 +33,9 @@ class FileTypeClassifier(BaseComponent):
"""
Node that sends out files on a different output edge depending on their extension.
:param supported_types: the file types that this node can distinguish.
Note that it's limited to a maximum of 10 outgoing edges, which
correspond each to a file extension. Such extension are, by default
`txt`, `pdf`, `md`, `docx`, `html`. Lists containing more than 10
elements will not be allowed. Lists with duplicate elements will
also be rejected.
:param supported_types: The file types that this node can distinguish between.
The default values are: `txt`, `pdf`, `md`, `docx`, and `html`.
Lists with duplicate elements are not allowed.
"""
if len(set(supported_types)) != len(supported_types):
duplicates = supported_types