From 16a7655f52dfa53eb0acbe05bc20096028776e39 Mon Sep 17 00:00:00 2001 From: tux1337 <33804893+tux1337@users.noreply.github.com> Date: Fri, 12 Oct 2018 14:24:52 +0200 Subject: [PATCH] Update app.py Support maxDataPoints=auto like graphite it does --- graphite_api/app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/graphite_api/app.py b/graphite_api/app.py index 6a46b13..46eb5b1 100644 --- a/graphite_api/app.py +++ b/graphite_api/app.py @@ -282,8 +282,10 @@ def render(): request_options['jsonp'] = RequestParams['jsonp'] if 'maxDataPoints' in RequestParams: try: - request_options['maxDataPoints'] = int( - float(RequestParams['maxDataPoints'])) + if RequestParams['maxDataPoints'] == 'auto': + pass + else: + request_options['maxDataPoints'] = int(float(RequestParams['maxDataPoints'])) except ValueError: errors['maxDataPoints'] = 'Must be an integer.' if 'noNullPoints' in RequestParams: