[PNE-7426] Expose Project.archived.#1000
Conversation
6926c74 to
3489ad0
Compare
3489ad0 to
b852119
Compare
Allow users to view the archive status of a project.
b852119 to
2764ac1
Compare
| def _list_base(self, *, per_page: int = 1000, archived: Optional[bool] = None): | ||
| filters = {} | ||
| if archived is not None: | ||
| filters["archived"] = str(archived).lower() |
There was a problem hiding this comment.
Both requests and our testing library just call str on a bool, leaving it capitalized. And it seems the accounts service doesn't recognize that as a valid boolean.
For the record, I confirmed that at least Orion paths can handle either. So I'm slightly inclined to add a snippet in Session that converts any bool query parameters to lower-cased strings automatically. But I've left that for the future, when we can more thoroughly ensure there are no ill effects elsewhere in the system.
There was a problem hiding this comment.
I'll approve, but I'd rather see json used to encode this, since the problem (I believe) is that the JSON standard uses lower case false and stringified Python uses title case. This works, but is less intuitive about why.
| collection_builder=self._build_collection_elements, | ||
| per_page=per_page) | ||
|
|
||
| def list(self, *, per_page: int = 1000) -> Iterator[Project]: |
There was a problem hiding this comment.
Note that ProjectCollection.list defaults to listing every project. This differs from many other collections, such as predictors an design spaces, where list only lists the active assets. This will be addressed in 4.0 by renaming PredictorCollection.list to list_active and PredictorCollection.list_all to list.
kroenlein
left a comment
There was a problem hiding this comment.
Minor optional quibble.
| def _list_base(self, *, per_page: int = 1000, archived: Optional[bool] = None): | ||
| filters = {} | ||
| if archived is not None: | ||
| filters["archived"] = str(archived).lower() |
There was a problem hiding this comment.
I'll approve, but I'd rather see json used to encode this, since the problem (I believe) is that the JSON standard uses lower case false and stringified Python uses title case. This works, but is less intuitive about why.
Allow users to view the archive status of a project.
Citrine Python PR
Description
Please briefly explain the goal of the changes/this PR.
The reviewer should be able to understand why the change is being made by reading this description
and its links (e.g. JIRA tickets).
PR Type:
Adherence to team decisions