Skip to Content
0
Nov 23, 2020 at 10:27 AM

Data Intelligence - AttributeError: 'NoneType' object has no attribute 'get_datacollection'

222 Views

Hi All,

I am referring to this blog and creating a predictive data model - https://blogs.sap.com/2020/04/07/sap-data-intelligence-to-train-export-serve-inference-machine-learning-models/

I got an error with this code which I keyed in as mentioned in the blog. It says there is no attribute "get_datacollection'. But the example code used the same attribute 'get_datacollection'.

I don't know Python so would appreciate any help in fixing this code.

Thank you.

ws = sapdi.get_workspace(name='Pav_Nov23-ws')

dc = ws.get_datacollection(name='PredictiveMealFactor')

with dc.open('DiabetesData.csv').get_reader() as reader:

df = pd.read_csv(reader)

/opt/conda/lib/python3.7/site-packages/ipykernel_launcher.py:1: DeprecatedWarning: get_workspace is deprecated as of 0.3.30.
  """Entry point for launching an IPython kernel.
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-8-b1367336437f> in <module>
      1 ws = sapdi.get_workspace(name='Pav_Nov23-ws')
----> 2dc = ws.get_datacollection(name='PredictiveMealFactor')
      3 with dc.open('DiabetesData.csv').get_reader() as reader:
      4     df = pd.read_csv(reader)

AttributeError: 'NoneType' object has no attribute 'get_datacollection'

Attachments