Migration to peprs#155
Conversation
There was a problem hiding this comment.
Pull request overview
Migrates pepdbagent from peppy to peprs for project/sample handling, updating the raw PEP dict shape and adjusting tests + fixture PEPs accordingly.
Changes:
- Replace peppy imports/usages with peprs across pepdbagent modules and tests.
- Update raw project/sample dict conventions from
_config/_sample_dicttoconfig/samples(andsubsampleswhere applicable). - Adjust test fixture PEP YAMLs and expectations to accommodate peprs parsing/inference behavior.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
pepdbagent/modules/project.py |
Switches project CRUD paths to peprs constants/dict shape; updates sample retrieval conversion. |
pepdbagent/modules/sample.py |
Returns peprs.Sample when raw=False and updates sample-name lookup key handling. |
pepdbagent/modules/view.py |
Updates view retrieval to return peprs projects / peprs-style raw dicts. |
pepdbagent/models.py |
Updates pydantic raw-project model aliases to peprs constants. |
pepdbagent/utils.py |
Switches SAMPLE_RAW_DICT_KEY import to peprs constant. |
pepdbagent/const.py |
Removes outdated peppy-const comment. |
requirements/requirements-all.txt |
Replaces peppy dependency with peprs. |
tests/utils.py |
Uses peprs.Project(...) during DB seeding; adds skip-on-parse-failure behavior. |
tests/test_project.py |
Updates project retrieval/serialization assertions to peprs dict shape and pandas conversion. |
tests/test_updates.py |
Updates update flows to use samples list and peprs.Project.from_dict. |
tests/test_samples.py |
Updates sample type assertions to peprs.Sample and adjusts expectations for inferred numeric types. |
tests/test_project_history.py |
Updates history update flows to use peprs dict shape (samples, config). |
tests/data/private_test/remove/project_config.yaml |
Removes a derive source entry to fit updated parsing/fixtures. |
tests/data/private_test/derive/project_config.yaml |
Removes a derive source entry to fit updated parsing/fixtures. |
tests/data/private_test/amendments1/project_config.yaml |
Removes a derive source entry to fit updated parsing/fixtures. |
tests/data/namespace3/remove/project_config.yaml |
Removes a derive source entry to fit updated parsing/fixtures. |
tests/data/namespace3/piface/project_config.yaml |
Adjusts pipeline_interfaces fixture value format. |
tests/data/namespace2/derive/project_config.yaml |
Removes a derive source entry to fit updated parsing/fixtures. |
tests/data/namespace1/amendments1/project_config.yaml |
Removes a derive source entry to fit updated parsing/fixtures. |
Comments suppressed due to low confidence (1)
pepdbagent/modules/project.py:103
- The
get()docstring still describes the old peppy raw-project keys (_config,_sample_dict,_subsample_dict). After migrating to peprs, the raw dict returned here usesconfig/samples/subsamples(viapeprs.const). Please update the docstring so it matches the actual return shape.
:return: peprs.Project object with found project or dict with unprocessed
PEP elements: {
name: str
description: str
_config: dict
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if isinstance(project, peprs.Project): | ||
| proj_dict = project.to_dict(raw=True, by_sample=True) | ||
| elif isinstance(project, dict): |
There was a problem hiding this comment.
Using peprs.Project.to_dict(raw=True, by_sample=True) will preserve peprs/polars-inferred column dtypes (e.g., numeric columns become ints). This appears to be a behavioral change vs the prior peppy-based behavior (tests now expect time == 0 instead of '0') and can be a breaking API change for clients expecting strings. Consider normalizing sample values to strings before persisting, or explicitly documenting this type change as part of the migration.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Changes:
TODO:
__version__.pyfile