Skip to content

Instantly share code, notes, and snippets.

@ojmccall
Last active September 4, 2021 03:15
Show Gist options
  • Save ojmccall/ba9d3fdf21d31d3fc46c2cfbb1378a23 to your computer and use it in GitHub Desktop.
Save ojmccall/ba9d3fdf21d31d3fc46c2cfbb1378a23 to your computer and use it in GitHub Desktop.
GCP - SFMC Data Extensions Rows section 2
# find config data values
client_id = config_data['client_id']
client_secret = config_data['client_secret']
baseURL = config_data['base_url']
#Find DE data in filename
var = filename[5:]
var = var.replace(".csv","")
split =var.split("_")
DEName = split[0]
#get csv values and create a data frame
df = pd.read_csv(fullpath, low_memory=False)
df = df.fillna("")
#create a list from the data frame
datarows = df.to_dict(orient='records')
print('row count: '+str(len(df_dict)))
#delete the file from GSC
storage_client = storage.Client()
bucket = storage_client.bucket(bucketname)
blob = bucket.blob(filename)
blob.delete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment