Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sudden error with timeseries_client.py #321

Open
craignwf opened this issue May 1, 2023 · 0 comments
Open

Sudden error with timeseries_client.py #321

craignwf opened this issue May 1, 2023 · 0 comments

Comments

@craignwf
Copy link

craignwf commented May 1, 2023

A section of python used to retrieve data has suddenly started to fail last week:

readings = dict(
(loc['Identifier'],
timeseries.publish.get('/GetFieldVisitReadingsByLocation', params={
'LocationIdentifier': loc['Identifier'],
'Parameters': ['Discharge'],
'ApplyDatumConversion': 'true'
})['FieldVisitReadings']
) for loc in locationDescriptions)

and receiving the following error:

Traceback (most recent call last):
File "C:\Scripts\CreateStage.py", line 18, in
readings = dict(
File "C:\Scripts\CreateStage.py", line 20, in
timeseries.publish.get('/GetFieldVisitReadingsByLocation', params={
File "C:\Scripts\timeseries_client.py", line 203, in get
return self.json_or_none(self._get_raw(url, **kwargs))
File "C:\Scripts\timeseries_client.py", line 223, in get_raw
return response_or_raise(r)
File "C:\Scripts\timeseries_client.py", line 27, in response_or_raise
json = response.json()
File "C:\Users\isbcf\AppData\Roaming\Python\Python39\site-packages\requests\models.py", line 910, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Program Files\Python39\lib\json_init
.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Program Files\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Program Files\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

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

No branches or pull requests

1 participant