-
Notifications
You must be signed in to change notification settings - Fork 36
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
Allow None to be passed for geoms and bboxes on features #56
Allow None to be passed for geoms and bboxes on features #56
Conversation
057e865
to
3f6d11f
Compare
Codecov Report
@@ Coverage Diff @@
## master #56 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 106 106
=========================================
Hits 106 106
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -16,10 +16,10 @@ class Feature(GenericModel, Generic[Geom, Props]): | |||
"""Feature Model""" | |||
|
|||
type: str = Field("Feature", const=True) | |||
geometry: Geom | |||
geometry: Geom = None |
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.
geometry: Geom = None | |
geometry: Optional[Geom] = None |
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 agree that's easier to read. Do you think I should remove this line and incorporate the suggested change?
Geom = TypeVar("Geom", bound=Optional[Geometry]) |
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.
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.
Whoops my apologies I forgot that the Optional
was rolled into the TypeVar
, i'd prefer it to remain in the TypeVar
. My bad! 😬
Elaboration here: #47 (comment)
7479650
to
04cad7f
Compare
I think this is likely good to go. Are there any other outstanding changes we really want to see prior to another release? (Getting things lined up to push a release for stac-fastapi) |
@moradology @geospatial-jeff I'm getting a pre-commit error over #62 related to change made here
|
This looks a bit like a bug, but perhaps there's some wrinkle to the behavior here I'm missing. As you can see, the type variable is declared to be an
I'm happy to cut a PR or somesuch to make modifications that will avoid this issue. Do we have a sense about what the right approach is? |
@moradology To be honest I not sure where this comes from so I'll be more than happy if you can have a look 🙏 |
@moradology you can ignore ☝️ a other PR (#64) seems to work 👌 so I guess it's just a mypy configuration issue in #62 |
This PR addresses #55 by setting the default value of
bbox
andgeometry
on features toNone