-
-
Notifications
You must be signed in to change notification settings - Fork 10
Make site_uuid field on PVSiteMetadata model optional #65
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #65 +/- ##
=======================================
Coverage 91.90% 91.90%
=======================================
Files 8 8
Lines 321 321
=======================================
Hits 295 295
Misses 26 26
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -21,7 +21,7 @@ class PVSiteAPIStatus(BaseModel): | |||
class PVSiteMetadata(BaseModel): | |||
"""Site metadata""" | |||
|
|||
site_uuid: str = Field(..., description="Unique internal ID for site.") | |||
site_uuid: Optional[str] = Field(None, description="Unique internal ID for site.") |
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.
nice
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.
I put one small comment, but other wise looks great
Pull Request
Description
Makes the
site_uuid
field in thePVSiteMetadata
model optional to support automatic uuid generation by SQLAlchemy. I've also changed the site post endpoint to now not supply a site_uuid (previously from request data).The reason I made the type optional inside
PVSiteMetadata
instead of removing is because the model is used in other endpoints which do have a validsite_uuid
.Fixes #62
How Has This Been Tested?
Tested locally via accessing the endpoints. I've changed tests to now try both supplying and not supplying a site uuid when creating a site.
Checklist: