endlessm / azafea

Service to track device activations and usage metrics
Mozilla Public License 2.0
10 stars 2 forks source link

Reduce accuracy GeoIP #157

Closed antoinehashbang closed 3 years ago

antoinehashbang commented 3 years ago

https://phabricator.endlessm.com/T31730

dbnicholson commented 3 years ago

Looks like the test is failing:

self = <azafea.event_processors.endless.activation.v1.handler.Activation object at 0x7fcb0629f850>
key = 'latitude', latitude = 14.3

    @validates('latitude')
    def validate_latitude(self, key: str, latitude: Optional[int]) -> Optional[int]:
        # Catch both None and the empty string
        if not latitude:
            return None

        if math.floor(latitude) + 0.5 != latitude:
>           raise ValueError(f'latitude is not an integer + 0.5: {latitude}')
E           ValueError: latitude is not an integer + 0.5: 14.3

azafea/event_processors/endless/activation/v1/handler.py:76: ValueError