Idea #21283
closed
Make Python arvados.api importable
Added by Brett Smith about 1 year ago.
Updated about 1 year ago.
Release relationship:
Auto
Description
Steps to reproduce: import arvados.api
Expected result: I can now call functions in the arvados.api
module like arvados.api.api_client
, arvados.api.api_from_config
, etc.
Actual result: I can't do any of that, because arvados/__init__.py
shadows arvados.api
to be arvados.api.api
, making the rest of the module difficult to access.
Proposed solution: Arcane magicks
21283-callable-api-module @ 1372710a7f3b33d822c52455ed613c1063ad4b16 - developer-run-tests: #3956 
- All agreed upon points are implemented / addressed.
- Anything not implemented (discovered or discussed during work) has a follow-up story.
- Code is tested and passing, both automated and manual, what manual testing was done is described
- Documentation has been updated.
- This change should be transparent to users, but I did take the opportunity to try to clarify the
arvados/__init__.py
docstring.
- Behaves appropriately at the intended scale (describe intended scale).
- The only scale change is adding another function to the call stack when constructing an Arvados API client, which should be an acceptable hit
- Considered backwards and forwards compatibility issues between client and server.
- The whole goal of this branch is to be transparent to normal API use. There are some ways to tell that something has changed through deep introspection. For example,
isinstance(arvados.api, types.ModuleType)
used to return False
, and now it will return True
. But I don't think we guarantee API compatibility at this level, just at the level of function signatures, which are all retained.
- Follows our coding standards and GUI style guidelines.
- Technically this bends PEP 8's "two blank lines after class definition" rule, but I think that's appropriate given that (a) it's short (b) it's used more as a one-shot class decorator than a normal class and (c) we have existing code that follows the same pattern.
- Status changed from In Progress to Resolved
Also available in: Atom
PDF