sassoftware / pyviyatools

Python command-line tools that call the SAS Viya REST APIs - for SAS administrators.
Apache License 2.0
38 stars 31 forks source link

getactivityrecords.py only json output #187

Open viya4-deployments-psd opened 1 year ago

viya4-deployments-psd commented 1 year ago

I get an output only when I use python3 getactivityrecords.py -o json using python3 getactivityrecords.py -o csv i get

Traceback (most recent call last):
  File "getactivityrecords.py", line 89, in <module>
    printresult(files_result_json, output_style, cols)
  File "/home/ubuntu/pyviyatools/sharedfunctions.py", line 624, in printresult
    csvresults(result,columns=colsforcsv,header=header)
  File "/home/ubuntu/pyviyatools/sharedfunctions.py", line 485, in csvresults
    total_items=resultdata['count']
KeyError: 'count'
gerrynelson63 commented 12 months ago

@afarzam1 would you mind taking a look at this one. I could not reproduce during a quick test.

afarzam1 commented 12 months ago

@tomstarr pointed out that this happens when the number of records exceeds the "limit", which defaults to 1000. It works if you increase the value with the --limit argument. I will increase the default limit and put in some error handling.