Error: Must be unicode or string, C Source=(src/convert.c,107)

Hi
getting error “Must be unicode or string, C Source=(src/convert.c,107)” while upserting data into couchbase 6.0 from csv using python (3.7) script via linux box. just Fyi, Some records are inserting but are ending with this error “Must be unicode or string, C Source=(src/convert.c,107)”

here is the code using to send function
df2[‘id’] = df2[‘recId’] + ‘:’ + df2[‘code’]
df2[‘docType’] = ‘RESPONSES’
df2_result = df2.to_json(orient=“records”)
parsed2 = json.loads(df2_result)
for p in parsed2:
p = json.dumps§
p = json.loads§
print§
upsert_Couchbase(p,fileName)

- Insert into Couchbase

#https://docs.couchbase.com/python-sdk/3.0/hello-world/start-using-sdk.html
def upsert_Couchbase(doc,fileName):
# Connect to cluster - cblabt1
cluster = Cluster(‘couchbase://10.xx.xx.xx:8091’
ClusterOptions(PasswordAuthenticator(‘xyz’, ‘xyz’)))
cb_coll = cluster.bucket(‘xbucket’)#‘contact_tracing’)
try:
# key will equal: “ResponseId::code”
key = doc[‘id’]
print(key)
result = cb_coll.upsert(key, doc)
print(result.cas)
print(“Success in upserting " + fileName + " to Couchbase.”)
except Exception as e:
print(“Failure in upserting " + fileName + " to Couchbase.”)
print(e)

Appriciate for suggestion

cb_coll needs to be a collection, not a bucket. Try: cb_coll=cluster.bucket('xbucket').default_collection(). See https://docs.couchbase.com/python-sdk/current/hello-world/start-using-sdk.html for some examples.