ESIOS icon indicating copy to clipboard operation
ESIOS copied to clipboard

Manage empty data

Open rlopezsanz opened this issue 2 years ago • 1 comments

Address the output of:

get_multiple_series(self, indicators, start, end):

In case of "df_new = None" display a warning message. Otherwise this will have an impact later on, such as the following TypeError:

  File "C:\Users\lopsanru\PycharmProjects\utilRLS\PyTools\ESIOS\conexion_pyesios.py", line 49, in <module>
    grafico(token, indicators_, start_, end_)
  File "C:\Users\lopsanru\PycharmProjects\utilRLS\PyTools\ESIOS\conexion_pyesios.py", line 13, in grafico
    df = df_merged[names]  # get the actual series and neglect the rest of the info
TypeError: 'NoneType' object is not subscriptable

rlopezsanz avatar Nov 22 '23 12:11 rlopezsanz

Hi,

I believe that in this case, there should be an if statement like so:

dfmul, df_list, names = esios.get_multiple_series(indicators_, start_, end_)

if dfmul is not None:
    df = dfmul[names]

SanPen avatar Nov 23 '23 16:11 SanPen