Help

Python airtable wapper and google cloud machine

Topic Labels: API
2601 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Ryan_Thomson
4 - Data Explorer
4 - Data Explorer

I’m at wit’s end…Any help or hints would be AMAZING.

Airtable Python Wrapper is able to find a field using Airtable.Match when executed from the local machine, but It Airtable Python Wrapper is able to find a field using Airtable.MAtch when executed from the local machine, but It cannot make the match on Google Cloud.

Declared:

- - coding: UTF-8 - -

search = d['TITLE'] +  d['OFFICE']
    try: #THIS WONT WORK?? WHAT?
       record = airtable.match('mysearch', search)
       airtable.update(record['id'], d, typecast=True)
       print (' UPDATED ')       
   except:
       try: #NO PROBLEM INSERTING - TOO BAD ITS NOT CATCHING DUPLICATES
       airtable.insert(d,typecast=True)
       print (' INSERTED ')

Expected to find the search var in {mysearch} field. Works great on my machine. Will NOT find the match in GCM. make the match on Google Cloud.

I’ve tried adding:

- - coding: UTF-8 - -

here’s whats failing (airtable.match)

search = d['TITLE'] +  d['OFFICE']
    try: **#THIS WONT WORK?? WHAT?**
       record = airtable.match('mysearch', search)
       airtable.update(record['id'], d, typecast=True)
       print (' UPDATED ')       
   except:
       try: **#NO PROBLEM INSERTING - TOO BAD ITS NOT CATCHING DUPLICATES**
       airtable.insert(d,typecast=True)
       print (' INSERTED ')

Script Works great on my machine. Will NOT find the match in GCM. Pls assist?

3 Replies 3
Giovanni_Briggs
6 - Interface Innovator
6 - Interface Innovator

If I’m reading your code-snippets correctly, it looks like you are trying to do an “upsert.” If the value exists, update it, otherwise insert a new record.

Your try/except block here may be too general and there may be some other error happening not explicitly related to making API calls to Airtable. Are records being inserted into your Airtable base from the script on GCM? Or are all calls failing? What error are you getting in the “except” clause?

I don’t know I’m over my head. If anyone can make this stupid script work. (like it does on any local machine, now, you have your first job of the day.)

I hate it when I’m in over my head.

Also, there are in fact, two separate scripts to upload to make all work on GCLOUD. Then I need some sort of CRON set to run them 3x day each.

And whatever else help you can pick out,

To answer without the frustration with myself… It seems to just wan to do an Insert no matter what.

The difference when I run it is may checkpoints and flaks al have weird -unicode so i think the answer lies there.