Airtable incompatibility with Sublime Text


I have a table in Airtable that I fill with data from a Python dataframe - pandas

I run code on a jupyter notebook and it works normally:

from airtable import Airtable

table = Airtable(api_key = "", 
	base_key ="", 
	table_name ="")

for num, row in posts_deputados.iterrows():
	dicio = {'post_id': row['post_id'],
	'text': row['text'],
	'post_text': row['post_text'],
	'shared_text': row['shared_text'],	
	'time': row['time'],	
	'image': row['image'],	
	'likes': row['likes'],	
	'comments': row['comments'],	
	'shares': row['shares'],	
	'post_url': row['post_url'],	
	'link': row['link'],	
	'cpf': row['cpf'],	
	'post_text_copia': row['post_text_copia'],	
	'SG_UF': row['SG_UF'],	
	'DS_CARGO': row['DS_CARGO'],	


But this same code when I run a script within Sublime Text appears this error:
HTTPError: 422 Client Error: Unprocessable Entity for url: 1 (Decoded URL) [Error: {'type': 'INVALID_REQUEST_BODY', 'message': 'Could not parse request body'}]

Please, is there any incompatibility between Airtable and Sublime Text?


Is it possible for you to perform URL encoding on the target URL in you Sublime script? I could be wrong, but it looks like your issue is stemming from the /Table 1 portion of your URL, which contains a whitespace character. For the URL to process properly, I think that needs to be encoded as such: /Table%201.

Alternatively, you could ensure that none of your Table names in your Airtable base have any whitespace characters in their names :man_shrugging:t2:

Thanks @Jeremy_Oglesby
I have now changed the name to “Table1”
On the jupyter notebook works
But in Sublime Text the same error continues

Ah ya… I guess the error is complaining about the request body, not the URL itself.

Not sure what’s going on then, that different systems are producing different request bodies out of the same script…

Recommendation - downsize the request to a single text field to see if something in the payload is causing this error message.

Also, consider the possibility that Sublime Text is inappropriately re-stringifying or failing to stringify dicio when it performs the POST.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.