Skip to content

admin module usage_reports - credit() and users() does not report accurately. #2560

Open

Description

@Clubdebambos

Describe the bug
I am not sure if this is a bug or simply requires clarification and updated documentation. Firstly, the credit() method is supposed to return credit usage for the organization but returns for the logged in user.

Secondly, the reported credit consumption is wildly inaccurate, or maybe you can shed light on the actual values returned? Incorrect user credit consumption also reported with users(). See information below...

To Reproduce
Steps to reproduce the behavior:

from arcgis.gis import GIS

## access ArcGIS Online orgnaization
agol = GIS("home")

## generate an AGOLUsageReports object
usage = agol.admin.usage_reports

## print credit usage dataframe
## see screenshots
credits_df = usage.credit()
credits_df

## users report, see screenshots
user_usage = usage.users(
    time_frame = "week"
)

user_usage["data"]

error:
No error, see screenshots

Screenshots

Image This shows the dataframe returned from credits() This is not reflective of the overall consumption or for the logged in user. Image This shows the user consumption. I am a single user organization , but I have tested on a clients org and the same results. The 'credits' is accurate, but those for individual users are not and match those returned from credits(), which is supposed to return to the whole org as stated in the docs [here](https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.admin.html#arcgis.gis.admin.AGOLUsageReports.credit), but clearly does not.

Expected behavior
Proper credits returned for whole organization when using credits() and per user when using users()

Platform (please complete the following information):

  • OS: Windows 11 Home
  • Browser Chrome / Edge
  • Python API Version 2.4.3

Additional context
tested in AGOL and Pro Notebooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions