Skip to content

Add APIs to get ticket, location, assignment data #4

Description

@pancakereport

Issue originally filed by @rayzhao1 here https://github.com/Cal-CS-61A-Staff/berkeley-cs61a/issues/8100

Conversation from private issue:

Raised by @pancakereport

Context

We (cs61a) own all data related to our OH queue, which is stored in the oh database on GCP. However, other courses also utilize our OH queue and occasionally find use in our data.
For example, to get a sense of the volume/content/distribution + online vs. in person frequency of tickets over the week, Data 100 currently requests weekly DB dumps from Silas. They also occasionally request locations data.

Todo

It'd be nice if Silas didn't need to do this weekly manual process and could give a Data 100 staff member the ability to retrieve this data themselves. We know from #7995 that can retrieve an API key to access all of our APIs with sudo access, so all that's left is to expose some new APIs to fulfill their current use cases.
Something like this (refer to /apps/oh/oh_queue/models.py for DB schemas)
get_tickets(course: str, start_time: int, end_time: int)

  • return serialized object (dataframe, or SQLAlchemy object, or some other idiomatic way) or JSON dictionary of unmanipulated rows from tickets table ranging from start_time to end_time. We probably would want to limit the time range to some amount.
    get_locations(course: str)
  • return whole location table in chosen form, as it's mostly static data
    get_assignments(course: str)
  • return whole assignment table in chosen form, as it's mostly static data

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions