Skip to content

Comments

docs: adds docs for register/deregister methods#202

Merged
mekhlakapoor merged 3 commits intodevfrom
docs-201-metadatadb-methods
Feb 21, 2026
Merged

docs: adds docs for register/deregister methods#202
mekhlakapoor merged 3 commits intodevfrom
docs-201-metadatadb-methods

Conversation

@mekhlakapoor
Copy link
Contributor

@mekhlakapoor mekhlakapoor commented Feb 19, 2026

closes #201

Adds verbose docstrings for the register/deregister methods of the MetadataDbClient

"""Register a data asset to Code Ocean and the DocDB metadata index."""
"""
Register a data asset to Code Ocean and add its metadata to DocDB
given the metadata exists at the top level of the provided S3 location.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Given the de/registration endpoints are intended for admin, should we mention that it requires elevated AWS credentials?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Although pretty much all endpoints other than the public READ ones require some sort of elevated permissions, so I'm also ok to leave it out. Up to you.

Copy link
Member

Choose a reason for hiding this comment

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

I feel like that context would be great to clarify in the readthedocs somewhere, probably don't need it in every docstring

Copy link
Collaborator

@helen-m-lin helen-m-lin Feb 20, 2026

Choose a reason for hiding this comment

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

Good idea- Maybe somewhere in the User Guide or Rest API examples? This section briefly mentions that you need AWS credentials for updating metadata, but maybe we can expand this: https://aind-data-access-api.readthedocs.io/en/latest/ExamplesDocDBRestApi.html#updating-metadata

"""Register a data asset to Code Ocean and the DocDB metadata index."""
"""
Register a data asset to Code Ocean and add its metadata to DocDB
given the metadata exists at the top level of the provided S3 location.
Copy link
Member

Choose a reason for hiding this comment

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

I feel like that context would be great to clarify in the readthedocs somewhere, probably don't need it in every docstring

The name of the result asset.
co_asset_id : str
The Code Ocean asset ID for the result.
co_computation_id : str
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious what the computation ID is used for, doesn't seem necessary in addition to asset ID - and what happens if they don't match (asset is generated from a different computation ID)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The co_computation_id is used to download the metadata using Code Ocean's list_computation_results API. We do a sanity check that the co_asset_id exists and has provenance attributes that match the co_computation_id.

In retrospect maybe we could have done this with just s3_location and co_asset_id... I think this was originally due a mix of reasons: ease of using the Code Ocean API, access control, and confirming that it is in fact a result asset.

@mekhlakapoor mekhlakapoor merged commit 5d30c3d into dev Feb 21, 2026
3 checks passed
@mekhlakapoor mekhlakapoor deleted the docs-201-metadatadb-methods branch February 21, 2026 00:31
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.

docs - clarify MetadataDbClient methods

3 participants