question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with persist_as

See original GitHub issue

@andy-esch When attempting to persist an augmented table using cc.data(‘denver_stations’, carfree, persist_as=‘persist_test’) received this error:

---------------------------------------------------------------------------
JSONDecodeError                           Traceback (most recent call last)
<ipython-input-122-51c758ead48b> in <module>()
      7 
      8 df = cc.data('denver_stations', carfree)
----> 9 cc.data('denver_stations', carfree, persist_as='persist_test')

/srv/venv/lib/python3.5/site-packages/cartoframes/context.py in data(self, table_name, metadata, persist_as, how)
   1432                        '\'', '\'\''))
   1433         return self.query(query,
-> 1434                           table_name=persist_as)
   1435 
   1436     # backwards compatibility

/srv/venv/lib/python3.5/site-packages/cartoframes/context.py in query(self, query, table_name, decode_geom)
    628                                     # collision_strategy='',
    629                                     table_name=table_name),
--> 630                         headers={'Content-Type': 'application/json'})
    631             except CartoException:
    632                 raise CartoException('Table `{0}` already exists. Delete it '

/srv/venv/lib/python3.5/site-packages/cartoframes/context.py in _auth_send(self, relative_path, http_method, **kwargs)
   1447         if isinstance(res.content, str):
   1448             return json.loads(res.content)
-> 1449         return json.loads(res.content.decode('utf-8'))
   1450 
   1451     def _check_query(self, query, style_cols=None):

/usr/lib/python3.5/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    317             parse_int is None and parse_float is None and
    318             parse_constant is None and object_pairs_hook is None and not kw):
--> 319         return _default_decoder.decode(s)
    320     if cls is None:
    321         cls = JSONDecoder

/usr/lib/python3.5/json/decoder.py in decode(self, s, _w)
    337 
    338         """
--> 339         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    340         end = _w(s, end).end()
    341         if end != len(s):

/usr/lib/python3.5/json/decoder.py in raw_decode(self, s, idx)
    355             obj, end = self.scan_once(s, idx)
    356         except StopIteration as err:
--> 357             raise JSONDecodeError("Expecting value", s, err.value) from None
    358         return obj, end

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
andy-eschcommented, Dec 13, 2017

Yep, looks like I’m not putting the data into the body. Good catch!

0reactions
juanignacioslcommented, Dec 11, 2017

Sorry, but I don’t know a lot about Python or CARTO Python SDK. You’re using POST but the error is related to URI length. It looks like you’re sending the parameters in the URL instead of using the body. Could you check that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem persists definition and meaning - Collins Dictionary
Problem persists definition: If something undesirable persists , it continues to exist. [...] | Meaning, pronunciation, translations and examples.
Read more >
Reverso - If error persists definition | English definition dictionary
1 a mistake or inaccuracy, as in action or speech · 2 an incorrect belief or wrong judgment · 3 the condition of...
Read more >
this error persists | English examples in context - Ludwig
High quality example sentences with “this error persists” in context from reliable sources - Ludwig is the linguistic search engine that helps you...
Read more >
We couldn't sign you in. If this error persists, contact your
When i tried to open a shared calendar in Outlook 2019, i am prompted to enter my username and password. After entering the...
Read more >
error persists - Spanish translation – Linguee
Many translated example sentences containing "error persists" – Spanish-English dictionary and search engine for Spanish translations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found