Hello all,
I am doing use of the next library cjapy, which is a wrapper from Adobe API. In particular is this library : https://github.com/pitchmuc/cjapy
The problem that I have is that sometimes, when I call to the function myReport = cja.getReport(path), the following error appears:
Traceback (most recent call last):
File "/home/voc_analitica/rluque/indicadores_ratios_v3/main_v1.0.6.py", line 1478, in <module>
main()
File "/home/voc_analitica/rluque/indicadores_ratios_v3/main_v1.0.6.py", line 671, in main
df1 = df_paginas_vistas(cja, file_name, columnas_reporte, fecha_1_str, fecha_2_str, fecha_3_str, fecha_4_str, fecha_5_str, fecha_6_str, segmento_pais)
File "/home/voc_analitica/rluque/indicadores_ratios_v3/main_v1.0.6.py", line 121, in df_paginas_vistas
df_final_actual = ejecutar_reporte(cja, path, columnas_reporte, fecha_1_str)
File "/home/voc_analitica/rluque/indicadores_ratios_v3/main_v1.0.6.py", line 48, in ejecutar_reporte
myReport = cja.getReport(path)
File "/home/voc_analitica/.local/lib/python3.7/site-packages/cjapy/cjapy.py", line 2302, in getReport
) = self._decrypteStaticData(dataRequest=dataRequest, response=res)
File "/home/voc_analitica/.local/lib/python3.7/site-packages/cjapy/cjapy.py", line 2137, in _decrypteStaticData
response["columns"]["columnIds"], response["summaryData"]["totals"]
KeyError: 'columns'
I don't know the reason why It happens sometimes yes and sometimes not.
Can anyone please give me a hand?
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @RicardoLu1 ,
This seems to be originating from the cjapy code highlighted below,
It would help to have a look at the request definition which is causing this error but looks like the response that the code block is trying to process is does not have the expected attribute called "columns". It might be happening if the request didn't return the expected data which the code is expecting. I'd begin with printing the entire response and investigate if it has the needed attributes or not and then trace back from there. I suspect some validation checks are missing in the code to make sure the correct response is received before passing it to the next action, possibly the request failed or pulled an empty response which isn't getting processed correctly.
If this is still not getting resolved I'll suggest reaching out to the author Julian Piccini to get more help in understanding the error.
Cheers!
Views
Replies
Total Likes
Hi @RicardoLu1 ,
This seems to be originating from the cjapy code highlighted below,
It would help to have a look at the request definition which is causing this error but looks like the response that the code block is trying to process is does not have the expected attribute called "columns". It might be happening if the request didn't return the expected data which the code is expecting. I'd begin with printing the entire response and investigate if it has the needed attributes or not and then trace back from there. I suspect some validation checks are missing in the code to make sure the correct response is received before passing it to the next action, possibly the request failed or pulled an empty response which isn't getting processed correctly.
If this is still not getting resolved I'll suggest reaching out to the author Julian Piccini to get more help in understanding the error.
Cheers!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies