jenkins-bot has submitted this change and it was merged. Change subject: Keep backward compatability ......................................................................
Keep backward compatability This returns error on toJSON() in P625 claim: https://www.wikidata.org/w/api.php?action=query&prop=revisions&revids=221842942&rvprop=content Reported at https://github.com/wiki-ai/revscoring/issues/239 Change-Id: I7174587e38332ce48f5ef08a3051869c10208f5e --- M pywikibase/coordinate.py 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibase/coordinate.py b/pywikibase/coordinate.py index 232a9d4..58705f0 100644 --- a/pywikibase/coordinate.py +++ b/pywikibase/coordinate.py @@ -107,7 +107,6 @@ else: # Default to earth or should we use None here? globe = 'earth' - return cls(data['latitude'], data['longitude'], data['altitude'], data['precision'], globe, site=site, entity=data['globe']) @@ -135,6 +134,8 @@ self._dim/(radius*math.cos(math.radians(self.lat)))) """ if not self._precision: + if self._dim is None: + return self._precision radius = 6378137 # TODO: Support other globes self._precision = math.degrees( self._dim / (radius * math.cos(math.radians(self.lat)))) -- To view, visit https://gerrit.wikimedia.org/r/269087 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7174587e38332ce48f5ef08a3051869c10208f5e Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/wikibase Gerrit-Branch: master Gerrit-Owner: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits