我有一个小班,可以帮助我提取 salesforceobject 数据框和列。我对 simple_salesforce 包中的 SFType 有疑问。我正在尝试从某个 Salesforce 对象的数据框中检索列标题。这是我的课程的一个片段:
from simple_salesforce import Salesforce
from simple_salesforce import SFType
import pandas as pd
import numpy as np
class SfData:
def __init__(self,user,pw,token,obj):
self.user = user
self.pw = pw
self.token = token
self.sf = Salesforce(username = self.user,password = self.pw, security_token=self.token)
self.obj = obj
def retrieve_columns(self):
df = SFType(self.obj, self.sf.session_id, self.sf.sf_instance)
col_names = [x['name'] for x in self.sf.df.describe()['fields']]
return col_names
调用该类后,调用该方法时出现以下错误:
test.SfData(myuser,mypw,mytoken,"Account")
test.retrieve_columns()
Resource df Not Found. Response content: [{'errorCode': 'NOT_FOUND', 'message': 'The requested resource does not exist'}]
MM们
相关分类