Error using cjapy library | Community
Skip to main content
May 23, 2025
Solved

Error using cjapy library

  • May 23, 2025
  • 1 reply
  • 423 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Harveer_SinghGi1

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!

1 reply

Harveer_SinghGi1
Community Advisor
Harveer_SinghGi1Community AdvisorAccepted solution
Community Advisor
June 24, 2025

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!