Project

General

Profile

Actions

Idea #21283

closed

Make Python arvados.api importable

Added by Brett Smith 5 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
SDKs
Start date:
12/11/2023
Due date:
Story points:
-
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


Subtasks 1 (0 open1 closed)

Task #21284: Review 21283-callable-api-moduleResolvedBrett Smith12/11/2023Actions
Actions #1

Updated by Brett Smith 5 months ago

21283-callable-api-module @ 1372710a7f3b33d822c52455ed613c1063ad4b16 - developer-run-tests: #3956

  • All agreed upon points are implemented / addressed.
    • Yes
  • Anything not implemented (discovered or discussed during work) has a follow-up story.
    • N/A
  • Code is tested and passing, both automated and manual, what manual testing was done is described
    • See above
  • 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.
Actions #2

Updated by Tom Clegg 5 months ago

This LGTM, thanks.

Actions #3

Updated by Brett Smith 5 months ago

  • Status changed from In Progress to Resolved
Actions #4

Updated by Peter Amstutz 3 months ago

  • Release set to 69
Actions

Also available in: Atom PDF