asyml / asyml/forte

Allow `cls` to be a string of type class name in `DataStore._is_subclass()`

Open
#803 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

data_efficiency
Dominant language
Python
Stars
253
Forks
59
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
Currently DataStore._is_subclass(type_name, cls) require input argument cls to be an entry class. We also want it to support string of fully qualified name of the entry (e.g., "forte.data.ontology.top.Annotation").

Describe the solution you'd like
Maybe add some type checking for cls and convert it to a class using get_class() when it's a string.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in forte/data/data_store.py at DataStore._is_subclass(type_name, cls), then inspect the existing get_class() utility. Support fully qualified entry class names such as "forte.data.ontology.top.Annotation" while preserving class inputs, and verify that both forms produce the expected subclass check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.