Skip to content

[PNE-7426] Expose Project.archived.#1000

Merged
anoto-moniz merged 1 commit intomainfrom
feature/pne-7426-expose-project-archive-status
Sep 29, 2025
Merged

[PNE-7426] Expose Project.archived.#1000
anoto-moniz merged 1 commit intomainfrom
feature/pne-7426-expose-project-archive-status

Conversation

@anoto-moniz
Copy link
Copy Markdown
Collaborator

@anoto-moniz anoto-moniz commented Sep 25, 2025

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:

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Maintenance (non-breaking change to assist developers)

Adherence to team decisions

  • I have added tests for 100% coverage
  • I have written Numpy-style docstrings for every method and class.
  • I have communicated the downstream consequences of the PR to others.
  • I have bumped the version in __version__.py

@anoto-moniz anoto-moniz force-pushed the feature/pne-7426-expose-project-archive-status branch from 6926c74 to 3489ad0 Compare September 25, 2025 18:43
@anoto-moniz anoto-moniz marked this pull request as ready for review September 25, 2025 19:06
@anoto-moniz anoto-moniz requested a review from a team as a code owner September 25, 2025 19:06
@anoto-moniz anoto-moniz force-pushed the feature/pne-7426-expose-project-archive-status branch from 3489ad0 to b852119 Compare September 25, 2025 19:23
Allow users to view the archive status of a project.
@anoto-moniz anoto-moniz force-pushed the feature/pne-7426-expose-project-archive-status branch from b852119 to 2764ac1 Compare September 26, 2025 14:56
def _list_base(self, *, per_page: int = 1000, archived: Optional[bool] = None):
filters = {}
if archived is not None:
filters["archived"] = str(archived).lower()
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

@kroenlein kroenlein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@anoto-moniz anoto-moniz merged commit 603dcdd into main Sep 29, 2025
45 checks passed
@anoto-moniz anoto-moniz deleted the feature/pne-7426-expose-project-archive-status branch September 29, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants