Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional filters for 'space_member_usage'. #49

Open
kputschko opened this issue Oct 25, 2021 · 6 comments
Open

Additional filters for 'space_member_usage'. #49

kputschko opened this issue Oct 25, 2021 · 6 comments

Comments

@kputschko
Copy link

In the help page for the space_member_usage function, I see there is a filters argument that makes use of both groupby and from. I'm wondering if there are any more parameters that could be passed into this filter argument?

@kputschko
Copy link
Author

kputschko commented Oct 25, 2021

In addition, are there any additional ways to specify the from argument? The help page shows from = "90d", but I'm curious how to further specify a date range of interest.

These work:
space_member_usage(space, filters = list(groupby = "user_id", from = "30d"))
space_member_usage(space, filters = list(groupby = "user_id", from = "123456789")) (I assume it's milliseconds from 1970-01-01)

But these don't work:
space_member_usage(space, filters = list(groupby = "user_id", from = "2021-10-20"))
space_member_usage(space, filters = list(groupby = "user_id", from = "1y"))
space_member_usage(space, filters = list(groupby = "user_id", from = "1m"))
space_member_usage(space, filters = list(groupby = "user_id", from = "1 week"))

And this is the error that is returned:

Error: Request to endpoint `spaces/***/usage` failed with
  Status: 400
  Response: Invalid argument from: is not an ISO datetime type or is not a unix epoch timestamp or is not an ISO date or is not a valid relative date

@kputschko
Copy link
Author

I'm running into another issues as of today. This code ran successfully last week.

space_member_usage(space, filters = list(groupby = "user_id", from = "90d"))

But now it is returning this error:

Error: Problem with `mutate()` column `last_activity`.
i `last_activity = as.POSIXct(.data$last_activity/1000, origin = "1970-01-01")`.
x Column `last_activity` not found in `.data`

Interestingly, I can use from = 30, but not from = 35.

# Success
space_member_usage(space, filters = list(groupby = "user_id", from = "30d"))

# Failure
space_member_usage(space, filters = list(groupby = "user_id", from = "35d"))

@mine-cetinkaya-rundel
Copy link
Collaborator

@kputschko There was an update in the last week in the API to limit last_activity to 30 days. I'm working on updating the function to reflect this change so the function works for any time period but reports last_activity only up to 30 days and for time periods longer than that it doesn't report it.

@kputschko
Copy link
Author

Thanks for the response. To clarify, going forward it will only be possible to look back at time frames within the last 30 days?

@mine-cetinkaya-rundel
Copy link
Collaborator

Yes, for the last_active field it will only be possible to look back within the last 30 days. For other fields there won't be such time limit.

@mine-cetinkaya-rundel
Copy link
Collaborator

@kputschko The broken space_member_usage() call for longer time periods should now be fixed with #50. Leaving the issue open to remind of the original request re: better documentation of possible filters.

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

No branches or pull requests

2 participants