-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TaxonomyParser
schema version behavior not intuitive
#44
Comments
Does schema/src/instructlab/schema/taxonomy.py Lines 220 to 222 in 139a429
not count as documentation?
Schema versions are ints. So I do not think using tag strings in the API is helpful. 'latest' is also not a tag string. Also consider that this API is used by taxonomy repo's check_yaml script (instructlab/taxonomy#1259) which generally will want to use the latest version and |
Ah, thanks, I'm not sure how I missed that. So it is documented. I'm still not a fan of using I'll think on this and share the issue with folks to see if we can get other ideas or overall thoughts on this. |
TaxonomyParser
schema version behavior not clear/documentedTaxonomyParser
schema version behavior not intuitive
Could we introduce some sort of mapping layer here, where a user can pass either a raw int or string and if the latter if either maps to the appropriate non-string value or fails if no mapping exists? Could provide a better UX without needing to rework much of the existing logic. |
Not sure I understand. The schema_version parameter is of type int. If you want version 1,2 or 3, you pass in 1, 2, or 3. If you want to latest schema version, i.e. taxonomy repo PR checking, you pass in some value we will call "X". If you want to use the schema version as stated in the yaml file, i.e. SDG, you pass in some value we will call "Y". So now we are discussing what is "X" and what is "Y". As the code now stands, "X" is But I am not sure I see any utility for adding support for a Finally, this API (TaxonomyParser) is going to be used by a vanishingly small set of programmers. We can probably count the number on 1 hand :-) Right now it is the check_yaml script in the taxonomy repo, the |
Thanks, BJ! I see your point here, might not be worth devoting cycles to this. I'll close this issue for now and if we find that it's a problem in the future we can revisit. |
Caught this while reviewing instructlab/sdg#62. They initialize the parser using
version=0
, which allows the parser to read the version from the taxonomy file, however, this behavior is not documented in the class docstring here. Instead, it is just listed asint | None
, where theNone
behavior simply uses the latest version. This behavior should at least be described more clearly in the doctoring.Furthermore, I think the use of
None
to denote the latest version is misleading. I would suggest switching to version tags, so users can specify'v1', 'v2', ..., 'latest'
, with'latest'
as the default, and then users can passNone
to have the parser detect version from the yaml file.The text was updated successfully, but these errors were encountered: