Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

JSONDecodeError in client.query()Β #567

@Vanclief

Description

@Vanclief

I am trying to perform a valid query to a remote influx database. It will fail for certain time frames.

query = "SELECT * FROM {} WHERE \
            time > '{}' and time < '{}'".format(metric, str(start_date)[:10],
                    str(end_date)[:10])

    raw_tweets = client.query(query, database=dbname)

Will fail with:

File "/usr/lib/python3.6/site-packages/influxdb/client.py", line 400, in query
    data = response.json()
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Why would be the response not be a valid JSON object?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy