feat: Add ownership parameter to storage collection listing methods by nmanerikar · Pull Request #696 · apify/apify-client-python · GitHub
Skip to content

feat: Add ownership parameter to storage collection listing methods#696

Merged
vdusek merged 2 commits into
masterfrom
feat/storage-listing-ownership
Apr 7, 2026
Merged

feat: Add ownership parameter to storage collection listing methods#696
vdusek merged 2 commits into
masterfrom
feat/storage-listing-ownership

Conversation

@nmanerikar

Copy link
Copy Markdown
Contributor

Description

Adds an ownership query parameter (ownedByMe | sharedWithMe) to the list() method on DatasetCollectionClient, KeyValueStoreCollectionClient, and RequestQueueCollectionClient (both sync and async variants). This allows filtering listed storages by whether they are owned by the user or shared with the user.

Testing

Includes unit tests verifying the parameter is correctly passed through to the API request for all three storage types.

@nmanerikar nmanerikar requested review from tobice and vdusek April 2, 2026 09:02
@nmanerikar nmanerikar self-assigned this Apr 2, 2026
@github-actions github-actions Bot added t-core-services Issues with this label are in the ownership of the core services team. tested Temporary label used only programatically for some analytics. labels Apr 2, 2026
@codecov

codecov Bot commented Apr 2, 2026

Copy link
Copy Markdown

@tobice tobice left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Nish!

From my PoV, it's just piping the param to API, which makes sense. I'll leave the Python stuff to the tooling team.

@vdusek vdusek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, just one small thing:

Could you please move the definition of the ownership type

Literal['ownedByMe', 'sharedWithMe']

to a _types.py and give it a name?

This is the preferred approach for now. In the future, it should be derived from the specs and live in _models.py, but _types.py is currently the right place for manually defined types.

Thanks.

@nmanerikar nmanerikar requested a review from vdusek April 2, 2026 12:50

@vdusek vdusek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks

Comment on lines +12 to +13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I was wondering whether we should have a conversion mechanism between snake_case and camelCase for literal values. But we already have camelCase values in the codebase, e.g.:

sort_by: Literal['createdAt', 'stats.lastRunStartedAt'] | None = 'createdAt'

So let's merge this as-is.

However, we should consider whether to introduce such a mechanism before v3 - allowing snake_case values in the Python interface and converting them to camelCase for the API under the hood.

cc @janbuchar , @Pijukatel

@vdusek vdusek changed the title feat: Add the new ownership parameter to the storage listing methods feat: Add ownership parameter to storage collection listing methods Apr 7, 2026
@vdusek vdusek merged commit 51a92a3 into master Apr 7, 2026
26 checks passed
@vdusek vdusek deleted the feat/storage-listing-ownership branch April 7, 2026 08:39
@tobice tobice added the validated Issues that are resolved and their solutions fulfill the acceptance criteria. label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-core-services Issues with this label are in the ownership of the core services team. tested Temporary label used only programatically for some analytics. validated Issues that are resolved and their solutions fulfill the acceptance criteria.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants