-
Notifications
You must be signed in to change notification settings - Fork 19
Added pricing, applies, solution and approach to AIAsset #669
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
base: develop
Are you sure you want to change the base?
Conversation
mardalla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, works, approving
|
I approved the PR, but FYI the pre-commit pytest-check step is currently failing. The failing tests are:
They all return:
So the new
|
Signed-off-by: rohansen856 <[email protected]>
Signed-off-by: rohansen856 <[email protected]>
|
@mardalla Thanks for the approve and thans for pointing out ht eexamples issue that i overlooked. I double checked and changing the approach examples to this: |
Signed-off-by: rohansen856 <[email protected]>
|
Done the chnges... pre-commit pytest-check should be passing now... |
|
CI is red due to pytest-check: test_example_is_valid[...] fails because the approach examples ("deep learning theory", "representation learning") are not part of the approach taxonomy. Please align the examples with the taxonomy so the POSTs return 200 instead of 400. |
Signed-off-by: rohansen856 <[email protected]>
|
@mardalla i think the issue was with proper case (as i was in my windows it probably passed but not in the CI which is in unix env). I fixed that and pushed a commit. Kindly run the CI and see if its passing now. |
Summary
This PR implements pricing information fields and taxonomy relationships for AIAsset models. It adds two new string fields (
pricing_infoandapplies_to) and two many-to-many taxonomy relationships (solutionandapproach) to all AIAsset subclasses (datasets, ML models, experiments, computational assets, case studies, and publications).The implementation follows existing patterns in the codebase precisely, using the same structure as the
licensetaxonomy relationship and thecreator/contactmany-to-many patterns.Change(s)
Change Type: Added
Change Category: Interface
Changelog Entry:
Added
pricing_info,applies_to,solution, andapproachfields to AIAsset, enabling assets to specify pricing models, application contexts, solution types, and methodological approaches.These fields enhance AIAsset metadata with:
pricing_info(string): Information about pricing models or cost structuresapplies_to(string): Context or domain where the asset can be appliedsolution(list): Solution categories/types that the asset implements (many-to-many taxonomy)approach(list): Methodological approaches/techniques employed by the asset (many-to-many taxonomy)All fields are available across the 6 AIAsset types: datasets, ML models, experiments, computational assets, case studies, and publications.
Technical Implementation
Files Modified/Created
src/database/model/ai_asset/solution.pycreate_taxonomyfactory patternsrc/database/model/ai_asset/approach.pycreate_taxonomyfactory patternsrc/database/model/ai_asset/ai_asset.pySolutionandApproachimportspricing_infoandapplies_tostring fields toAIAssetBasesolutionandapproachRelationship fields toAIAssetupdate_relationships_assetto create link tablessrc/tests/routers/resource_routers/test_router_pricing_solution_approach.pyalembic/alembic/versions/9k2m4n6p8q0r_add_pricing_applies_solution_approach.pysolutionandapproachtaxonomy tablespricing_infoandapplies_tocolumns to 6 AIAsset tablesDatabase Changes
New Taxonomy Tables:
New Columns Added to AIAsset Tables:
pricing_info VARCHAR(200) NULLapplies_to VARCHAR(200) NULLApplied to: dataset, ml_model, experiment, computational_asset, case_study, publication
Link Tables Created:
Following the naming pattern:
solution_<asset_type>_linkandapproach_<asset_type>_linkFor all 6 AIAsset types: dataset, ml_model, experiment, computational_asset, case_study, publication.
Each table structure:
How to Test
1. Run Database Migration
2. Verify Database Schema
3. Run Unit Tests
pytest src/tests/routers/resource_routers/test_router_pricing_solution_approach.py -v pytest src/tests --versions 'latest'4. Manual API Testing
5. Verify in Swagger UI
http://localhost/docs/datasetsPOST endpoint shows all 4 new fields in schemapricing_infoandapplies_toare stringssolutionandapproachare arrays of stringsChecklist
test_router_pricing_solution_approach.pyRelated Issues
Closes #589
cc @joaquinvanschoren @mardalla