esoreq / dcarte

Dcarte code
https://esoreq.github.io/dcarte/
9 stars 9 forks source link

JSONDecodeError #20

Open mjouaiti opened 1 year ago

mjouaiti commented 1 year ago

Motion = dcarte.load('Motion','base',update=True) runs forever and then crashes with the following error: same error with dcarte.load('Activity_Dailies','profile',update=True)

JSONDecodeError Traceback (most recent call last) File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/requests/models.py:971, in Response.json(self, kwargs) 970 try: --> 971 return complexjson.loads(self.text, kwargs) 972 except JSONDecodeError as e: 973 # Catch JSON-related errors and raise as requests.JSONDecodeError 974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError

File ~/miniconda3/envs/python3.8/lib/python3.8/json/init.py:357, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 354 if (cls is None and object_hook is None and 355 parse_int is None and parse_float is None and 356 parse_constant is None and object_pairs_hook is None and not kw): --> 357 return _default_decoder.decode(s) 358 if cls is None:

File ~/miniconda3/envs/python3.8/lib/python3.8/json/decoder.py:337, in JSONDecoder.decode(self, s, _w) 333 """Return the Python representation of s (a str instance 334 containing a JSON document). 335 336 """ --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end()

File ~/miniconda3/envs/python3.8/lib/python3.8/json/decoder.py:355, in JSONDecoder.raw_decode(self, s, idx) 354 except StopIteration as err: --> 355 raise JSONDecodeError("Expecting value", s, err.value) from None 356 return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

JSONDecodeError Traceback (most recent call last) Cell In[26], line 2 1 update = True ----> 2 Motion = dcarte.load('Motion','base',update=update) 3 Entryway = dcarte.load('Entryway','Base',update=update) 4 Physiology = dcarte.load('Physiology','Base',update=update)

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/utils.py:230, in timer..wrapper..wrapped(*fun_args, *fun_kwargs) 228 else: 229 prefix = f'Finished {desc} in:' --> 230 out = fun(fun_args, **fun_kwargs) 231 elapsed = time.perf_counter() - start 232 dur = f'{np.round(elapsed,1)}'

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/load.py:91, in load(dataset, domain, kwargs) 89 dflt['reapply'] = False 90 for _,row in dependencies.iterrows(): ---> 91 parent_datasets[row.dataset] = load(row.dataset,row.domain, dflt) 92 input = {'dataset_name':dataset, 93 'datasets':parent_datasets, 94 'pipeline':info[dataset]['pipeline'], (...) 98 'dependencies':info[dataset]['domains'], 99 'domain':domain} 100 input = merge_dicts(input,dflt)

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/utils.py:230, in timer..wrapper..wrapped(*fun_args, *fun_kwargs) 228 else: 229 prefix = f'Finished {desc} in:' --> 230 out = fun(fun_args, **fun_kwargs) 231 elapsed = time.perf_counter() - start 232 dur = f'{np.round(elapsed,1)}'

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/load.py:84, in load(dataset, domain, kwargs) 78 input = {'dataset_name':dataset, 79 'datasets':info[dataset]['datasets'], 80 'columns':info[dataset]['columns'], 81 'dtypes':info[dataset]['dtype'], 82 'domain':domain} 83 input = merge_dicts(input,dflt) ---> 84 output = MinderDataset(input) 85 else: 86 dependencies = pd.DataFrame(info[dataset]['domains'])

File :23, in init(self, dataset_name, datasets, columns, domain, dtypes, since, until, log_level, delay, organizations, headers, server, home, compression, data_folder, data, request_id, reload, reapply, update)

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/minder.py:127, in MinderDataset.__post_init__(self) 125 self.data = read_table(self.local_file) 126 elif self.update: --> 127 self.update_dataset() 128 else: 129 self.data = read_table(self.local_file)

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/minder.py:267, in MinderDataset.update_dataset(self) 265 self.data_request['until'] = self.until 266 self.post_request() --> 267 self.process_request() 268 if 'url' in self.csv_url.columns: 269 self.download_data()

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/minder.py:169, in MinderDataset.process_request(self, sleep_time) 167 while request_output.empty: 168 sleep(sleep_time) --> 169 request_output = self.get_output() 170 self.csv_url = request_output 171 print('')

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/minder.py:176, in MinderDataset.get_output(self) 174 try: 175 with requests.get(f'{self.server}/{self.request_id}/', auth=self.auth) as request: --> 176 request_elements = pd.DataFrame(request.json()) 177 output = pd.DataFrame() 178 if request_elements.status.iat[0] == 202:

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/requests/models.py:975, in Response.json(self, kwargs) 971 return complexjson.loads(self.text, kwargs) 972 except JSONDecodeError as e: 973 # Catch JSON-related errors and raise as requests.JSONDecodeError 974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError --> 975 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

esoreq commented 1 year ago

what version of dcarte are you using?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Melanie Jouaiti @.> Sent: Tuesday, September 12, 2023 12:09:47 AM To: esoreq/dcarte @.> Cc: Subscribed @.***> Subject: [esoreq/dcarte] JSONDecodeError (Issue #20)

This email from @.*** originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders listhttps://spam.ic.ac.uk/SpamConsole/Senders.aspx to disable email stamping for this address.

Motion = dcarte.load('Motion','base',update=True) runs forever and then crashes with the following error: same error with dcarte.load('Activity_Dailies','profile',update=True)

JSONDecodeError Traceback (most recent call last) File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/requests/models.py:971, in Response.json(self, kwargs) 970 try: --> 971 return complexjson.loads(self.text, kwargs) 972 except JSONDecodeError as e: 973 # Catch JSON-related errors and raise as requests.JSONDecodeError 974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError

File ~/miniconda3/envs/python3.8/lib/python3.8/json/init.py:357, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 354 if (cls is None and object_hook is None and 355 parse_int is None and parse_float is None and 356 parse_constant is None and object_pairs_hook is None and not kw): --> 357 return _default_decoder.decode(s) 358 if cls is None:

File ~/miniconda3/envs/python3.8/lib/python3.8/json/decoder.py:337, in JSONDecoder.decode(self, s, _w) 333 """Return the Python representation of s (a str instance 334 containing a JSON document). 335 336 """ --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end()

File ~/miniconda3/envs/python3.8/lib/python3.8/json/decoder.py:355, in JSONDecoder.raw_decode(self, s, idx) 354 except StopIteration as err: --> 355 raise JSONDecodeError("Expecting value", s, err.value) from None 356 return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

JSONDecodeError Traceback (most recent call last) Cell In[26], line 2 1 update = True ----> 2 Motion = dcarte.load('Motion','base',update=update) 3 Entryway = dcarte.load('Entryway','Base',update=update) 4 Physiology = dcarte.load('Physiology','Base',update=update)

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/utils.py:230, in timer..wrapper..wrapped(*fun_args, *fun_kwargs) 228 else: 229 prefix = f'Finished {desc} in:' --> 230 out = fun(fun_args, **fun_kwargs) 231 elapsed = time.perf_counter() - start 232 dur = f'{np.round(elapsed,1)}'

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/load.py:91, in load(dataset, domain, kwargs) 89 dflt['reapply'] = False 90 for _,row in dependencies.iterrows(): ---> 91 parent_datasets[row.dataset] = load(row.dataset,row.domain, dflt) 92 input = {'dataset_name':dataset, 93 'datasets':parent_datasets, 94 'pipeline':info[dataset]['pipeline'], (...) 98 'dependencies':info[dataset]['domains'], 99 'domain':domain} 100 input = merge_dicts(input,dflt)

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/utils.py:230, in timer..wrapper..wrapped(*fun_args, *fun_kwargs) 228 else: 229 prefix = f'Finished {desc} in:' --> 230 out = fun(fun_args, **fun_kwargs) 231 elapsed = time.perf_counter() - start 232 dur = f'{np.round(elapsed,1)}'

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/load.py:84, in load(dataset, domain, kwargs) 78 input = {'dataset_name':dataset, 79 'datasets':info[dataset]['datasets'], 80 'columns':info[dataset]['columns'], 81 'dtypes':info[dataset]['dtype'], 82 'domain':domain} 83 input = merge_dicts(input,dflt) ---> 84 output = MinderDataset(input) 85 else: 86 dependencies = pd.DataFrame(info[dataset]['domains'])

File :23, in init(self, dataset_name, datasets, columns, domain, dtypes, since, until, log_level, delay, organizations, headers, server, home, compression, data_folder, data, request_id, reload, reapply, update)

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/minder.py:127, in MinderDataset.post_init(self) 125 self.data = read_table(self.local_file) 126 elif self.update: --> 127 self.update_dataset() 128 else: 129 self.data = read_table(self.local_file)

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/minder.py:267, in MinderDataset.update_dataset(self) 265 self.data_request['until'] = self.until 266 self.post_request() --> 267 self.process_request() 268 if 'url' in self.csv_url.columns: 269 self.download_data()

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/minder.py:169, in MinderDataset.process_request(self, sleep_time) 167 while request_output.empty: 168 sleep(sleep_time) --> 169 request_output = self.get_output() 170 self.csv_url = request_output 171 print('')

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/dcarte/minder.py:176, in MinderDataset.get_output(self) 174 try: 175 with requests.get(f'{self.server}/{self.request_id}/', auth=self.auth) as request: --> 176 request_elements = pd.DataFrame(request.json()) 177 output = pd.DataFrame() 178 if request_elements.status.iat[0] == 202:

File ~/miniconda3/envs/python3.8/lib/python3.8/site-packages/requests/models.py:975, in Response.json(self, kwargs) 971 return complexjson.loads(self.text, kwargs) 972 except JSONDecodeError as e: 973 # Catch JSON-related errors and raise as requests.JSONDecodeError 974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError --> 975 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

— Reply to this email directly, view it on GitHubhttps://github.com/esoreq/dcarte/issues/20, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIMOSDSUJJNJF3ALHIHTKZDXZ54ZXANCNFSM6AAAAAA4T5KRPA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

mjouaiti commented 1 year ago

version '0.4.10', installed from pip

esoreq commented 1 year ago

update please the current is 4.16

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Melanie Jouaiti @.> Sent: Tuesday, September 12, 2023 1:01:44 AM To: esoreq/dcarte @.> Cc: Soreq, Eyal @.>; Comment @.> Subject: Re: [esoreq/dcarte] JSONDecodeError (Issue #20)

This email from @.*** originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders listhttps://spam.ic.ac.uk/SpamConsole/Senders.aspx to disable email stamping for this address.

version '0.4.10', installed from pip

— Reply to this email directly, view it on GitHubhttps://github.com/esoreq/dcarte/issues/20#issuecomment-1714644927, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIMOSDXPPRJMXZPJHKPI5MLXZ6C4RANCNFSM6AAAAAA4T5KRPA. You are receiving this because you commented.Message ID: @.***>

mjouaiti commented 1 year ago

it's working now, sorry about that