feat(models): allow null battery_mah/weight_g on mobile devices - #109
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Allow unknown battery capacity and weight on tablets, watches, and PDAs to be represented as
nullinstead of fabricated numbers. Accuracy work in GetTechAPI/TechAPI#296 found the samebattery_mah=1500andweight_g=150.0placeholders across 43 watch and 217 tablet records; the correction in blocked draft GetTechAPI/TechAPI#324 cannot be seeded or dumped while the engine requires numeric values. Those required fields likely encouraged the original placeholder workaround.How
battery_mahandweight_gtoNonein SQLModel and the response schema; smartphone requirements and every other field's nullability stay unchanged.Existing databases need these columns altered to allow SQL NULL, or the tables recreated, before reseeding corrected records: SQLModel's
create_allcreates new tables but does not migrate existing ones. This PR changes only TechEngine; it does not modify TechAPI data.Testing
pytest --cov=app --cov-report=term --cov-fail-under=60 --tb=short --basetemp=.pytest-nullable-canonical: 552 passed, 77.63% coverage, usingTECHAPI_DATA_DIR=C:/Users/29/Desktop/TechAPI/dataread-only.python -m mypy app: success, 111 source files.python -m ruff check app tests: all checks passed.python -m app.validate: canonical seed data validation passed.Checklist
ruff checkandpytestpass locally