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

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


Hi All,

I am referring to this blog and creating a predictive data model -

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'DiabetesData.csv').get_reader() as reader:

df = pd.read_csv(reader)

/opt/conda/lib/python3.7/site-packages/ 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'DiabetesData.csv').get_reader() as reader:
      4     df = pd.read_csv(reader)

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