Skip to content

Conversation

@ahmedkansulum
Copy link

Summary

While reading through VectorStore in src/classifai/indexers/main.py I noticed a few small clarity issues:

  • The ValueError raised for unsupported data_type only mentioned ['csv'] and the later error message used {self.data_type} literally (no f-string).
  • The module- and class-level docstrings contained a handful of typos (e.g. "Vectoriers mdodule", "curently", "Pacakge", "correpsonding", "metadataq", "vectoiser").

This PR cleans those up without changing any functional behaviour.


Changes

  • Improve the data_type validation message in VectorStore.__init__:

    • Now raises:
      ValueError(
          f"Unsupported data_type='{self.data_type}'. Currently only 'csv' is supported."
      )
    • Behaviour is unchanged: csv remains the only supported data_type.
  • Fix the error raised in _create_vector_store_index for unsupported file types:

    • Convert the message to an f-string and make it more explicit:
      ValueError(
          f"File type not supported: '{self.data_type}'. Choose from ['csv']."
      )
  • Tidy up docstrings and comments in VectorStore and from_filespace:

    • "Vectoriers mdodule" → "vectorisers module"
    • "the the servers module" → "the servers module"
    • "curently only csv supported" → "currently only 'csv' is supported"
    • "ClassifAI Pacakge" → "ClassifAI package"
    • "correpsonding types" → "corresponding types"
    • "metadataq" → "metadata"
    • "vectoiser" → "vectoriser"

Rationale

  • Makes error messages more informative for downstream users who pass the wrong data_type.
  • Avoids confusion from {self.data_type} being rendered literally in the current error.
  • Improves readability and professionalism of the public API docstrings with no behavioural change.

Testing

  • Ran:

    make check-python

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