Skip to content

Make GeoPolygon interiors optional#2766

Merged
agourlay merged 1 commit intodevfrom
make-geopolygon-interior-optional
Oct 5, 2023
Merged

Make GeoPolygon interiors optional#2766
agourlay merged 1 commit intodevfrom
make-geopolygon-interior-optional

Conversation

@agourlay
Copy link
Member

@agourlay agourlay commented Oct 5, 2023

In #2315 we made the interiors field of geo polygons effectively optional by performing the validation in a shadow type.

We have tests showing that it works fine but we forgot to propagate the change to the type which provided the JSON schema.

Issue discovered while updating the Python client qdrant/qdrant-client#325

/// each GeoLineString must consist of a minimum of 4 points, and the first
/// and last points must be the same.
pub interiors: Vec<GeoLineString>,
pub interiors: Option<Vec<GeoLineString>>,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is the important change.

Scrolling above you will find the shadow type which already had the optional field

#[derive(Deserialize)]
pub struct GeoPolygonShadow {
    pub exterior: GeoLineString,
    pub interiors: Option<Vec<GeoLineString>>,
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for capturing!

@agourlay agourlay merged commit 3bff12d into dev Oct 5, 2023
@agourlay agourlay deleted the make-geopolygon-interior-optional branch October 5, 2023 16:34
generall pushed a commit that referenced this pull request Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants