astrapy
astrapy copied to clipboard
[core] Love to Ops
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.
Two things come to mind:
- probably there's no reason why
create_keyspacereturns a rawhttpx.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 - 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.
Closing since the whole Ops coverage has been sanitized and distilled into the strictly-data-api-related subset.