astrapy icon indicating copy to clipboard operation
astrapy copied to clipboard

[core] Love to Ops

Open hemidactylus opened this issue 2 years ago • 1 comments

The ops part of astrapy should get a systematic check: typing support is not always correct, test coverage is scarce (not an easy challenge), signature of methods should be checked.

hemidactylus avatar Nov 28 '23 14:11 hemidactylus

Two things come to mind:

  1. probably there's no reason why create_keyspace returns a raw httpx.Response. If so, align with the others, with custom handling since it will return 201 when successful. Much like create_database, in this case we could craft a sensible small dict to make this method uniform to the others
  2. In general, some DevOps calls return a List and others a Dict. Now everything is typed as OPS_API_RESPONSE which is union of the two, but this is not perfect. The create keyspace had to cast to dict for test to typecheck. Indeed whether dict or list is fixed for a given API call. Make the code reflect this, possibly with two _json_request and _list_request methods or something. A long, tedious work.

hemidactylus avatar Dec 02 '23 01:12 hemidactylus

Closing since the whole Ops coverage has been sanitized and distilled into the strictly-data-api-related subset.

hemidactylus avatar May 09 '25 09:05 hemidactylus