Skip to content

OpenCage provider: use no_annotations=1 as returned data is not used#464

Merged
KostyaEsmukov merged 1 commit into
geopy:masterfrom
mtmail:opencage-provider-url-without-annotations
Mar 20, 2021
Merged

OpenCage provider: use no_annotations=1 as returned data is not used#464
KostyaEsmukov merged 1 commit into
geopy:masterfrom
mtmail:opencage-provider-url-without-annotations

Conversation

@mtmail

@mtmail mtmail commented Jan 15, 2021

Copy link
Copy Markdown
Contributor

OpenCage results include https://opencagedata.com/api#annotations data by default. As this data isn't put into the Location response object it can be skipped in the request.

@KostyaEsmukov

Copy link
Copy Markdown
Member

I'm afraid this might count as a breaking change, because it would affect the contents of the location.raw value.

Is the benefit from disabling these by default really prominent?

@KostyaEsmukov KostyaEsmukov added this to the 2.2 milestone Mar 20, 2021
@KostyaEsmukov

Copy link
Copy Markdown
Member

Well, it seems to reduce mean request time in tests by 20%, so I guess that's something.

I'm merging this, but will add a new method param to switch annotations and will make it on by default, in order to not break backwards compatibility.

@KostyaEsmukov KostyaEsmukov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@KostyaEsmukov KostyaEsmukov merged commit ac98b8d into geopy:master Mar 20, 2021
@mtmail

mtmail commented Mar 20, 2021

Copy link
Copy Markdown
Contributor Author

Sounds good. Thanks a lot.

KostyaEsmukov added a commit that referenced this pull request Mar 20, 2021
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.

2 participants