Feature #18574
closedHelper methods for working with vocabularies
Description
Add features to Python SDK to make it easier to work with the vocabularies introduced in 2.3.1. Should include fetching the vocabulary, and methods that make it simple to perform lookups using both standardized ids and aliases.
Use design from ticket #18651
Related issues
Updated by Peter Amstutz almost 3 years ago
- Status changed from New to In Progress
Updated by Peter Amstutz almost 3 years ago
- Related to Idea #17454: Vocabulary checking of properties by API server/controller added
Updated by Peter Amstutz almost 3 years ago
- Related to Feature #18576: arv-put converts properties aliases to vocabulary ids added
Updated by Peter Amstutz almost 3 years ago
- Target version set to 2022-02-02 sprint
Updated by Peter Amstutz almost 3 years ago
- Status changed from In Progress to New
Updated by Peter Amstutz almost 3 years ago
- Blocked by Feature #18645: Design for search in dialogue window to select Project added
Updated by Peter Amstutz almost 3 years ago
- Target version changed from 2022-02-02 sprint to 2022-02-16 sprint
Updated by Peter Amstutz almost 3 years ago
- Target version changed from 2022-02-16 sprint to 2022-03-02 sprint
Updated by Lucas Di Pentima almost 3 years ago
- Assigned To set to Lucas Di Pentima
Updated by Lucas Di Pentima over 2 years ago
- Status changed from New to In Progress
Updated by Lucas Di Pentima over 2 years ago
Updates at 062d4e0 - branch 18574-pysdk-vocabulary-support
Test run: developer-run-tests: #2935
- Updates
arvados.api
to be able to fetch the vocabulary definition exported by the controller. - Adds
vocabulary.Vocabulary
,vocabulary.VocabularyKey
andvocabulary.VocabularyValue
classes adding the following features:- Case-insensitive key/value indexing.
- Conversion to/from identifiers/labels.
- Preferred label retrieval for every key or value.
- Adds
vocabulary.load_vocabulary()
function that accepts an API client object so that it loads the corresponding vocabulary definition. - Adds tests.
Pending¶
- Wrapper methods that translates properties on get, list, update, create, etc as requested by Tom.
Updated by Lucas Di Pentima over 2 years ago
Updates at 13c8401a8
Test run: developer-run-tests: #2936
- Fixes doc test failures.
Updated by Lucas Di Pentima over 2 years ago
Re-running failed test run: developer-run-tests-remainder: #3071
Updated by Lucas Di Pentima over 2 years ago
From chat with Tom: We'll make a separate ticket for the wrapping functions on the api client object and look for feedback from developers on how this would be useful.
Updated by Lucas Di Pentima over 2 years ago
- Related to Feature #18810: PySDK API Client wrapper methods that automatically translate properties using a vocabulary added
Updated by Peter Amstutz over 2 years ago
18574-pysdk-vocabulary-support @ 13c8401a89d34cc412e76ade8f112a31b9988e4f
- It looks like convert_to_identifiers() / convert_to_labels() doesn't handle lists in the "value" position.
Updated by Lucas Di Pentima over 2 years ago
Updates at a480283b6 - developer-run-tests: #2939
- Adds support for value list conversion.
- Adds tests.
- Generalize conversion code to avoid duplication.
Updated by Lucas Di Pentima over 2 years ago
- Target version changed from 2022-03-02 sprint to 2022-03-16 sprint
Updated by Lucas Di Pentima over 2 years ago
Updates at b6ffac07e - developer-run-tests: #2940
- Fixes a bug for cases when a key doesn't have any values defined.
- Adds a couple of cookbook examples to the docs.
Updated by Peter Amstutz over 2 years ago
What happens for when calling _convert_to_what
with non-string property values:
- null
- a number
- an object
- a list containing these
Updated by Peter Amstutz over 2 years ago
Also, the cookbook entries using the REPL are inconsistent with the other cookbook entries which are small standalone programs, I think a standalone code snippet showing "Translating between vocabulary identifiers and labels" would be most useful.
Updated by Lucas Di Pentima over 2 years ago
Updates at 1d7078e64 - developer-run-tests: #2942
- Fixes cookbook recipes formatting.
- Improves type checking on keys & values.
- Improves code's layout to minimize nesting
try: except:
blocks. - Adds tests.
Updated by Peter Amstutz over 2 years ago
Lucas Di Pentima wrote:
Updates at 1d7078e64 - developer-run-tests: #2942
- Fixes cookbook recipes formatting.
- Improves type checking on keys & values.
- Improves code's layout to minimize nesting
try: except:
blocks.- Adds tests.
LGTM
Updated by Lucas Di Pentima over 2 years ago
- % Done changed from 0 to 100
- Status changed from In Progress to Resolved
Applied in changeset arvados-private:commit:arvados|a154e1e469ea09fd7a54b79367a811dac673d058.