Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ingest post dependency upgrade #1428

Merged
merged 7 commits into from
Oct 23, 2024
Merged

Fix ingest post dependency upgrade #1428

merged 7 commits into from
Oct 23, 2024

Conversation

naglepuff
Copy link
Collaborator

Fix #1423

Caused by #1420

Changes

After merging #1420 into dev, ingest stopped working. The initial reason reported by the failed ingest job was related to the use of pydantic in nmdc-server. After addressing that issue, I noticed there were more issues preventing ingest from running successfully.

PydanticUserError: Study is not fully defined; you should define List, then call Study.model_rebuild().

This was the original issue, which can be seen in the logs for the failed ingest jobs. I followed the instructions given in the message to resolve this.

Type mismatch between data and postgres tables

Several columns on MetagenomeAssembly and MetatranscriptomeAssembly were mistyped as BigInteger, where the most recent nmdc-schema documentation reports them as having a range of Float. The columns have had their types changed and a migration is included in this PR. The analogous pydantic model properties and faker properties have been changed as well. I'm not sure what the relationship between the changes in #1420 and this error being discovered is, but it was not reported before.

Failure to populate annotations column

As suggested in the issue, #1423, the json column, annotations on a few of our tables was empty. This caused an ingest failure because the annotations are used to populate the multiomics column for biosamples. This was fixed here by using Pydantic v2 model_validators instead of v1 root_validators. Some feature of Pydantic v1 can still be imported an used, but in this case those weren't working, while the v2 equivalent did.

Using the `pydantic.v1` `root_validator` failed to properly populate the
`annotations` column of our annotated models.
It doesn't seem like `mypy` was picking up on the relationship between
`BaseModel` and our defined models.
@naglepuff naglepuff requested a review from marySalvi October 21, 2024 19:06
@naglepuff naglepuff merged commit fe5f696 into main Oct 23, 2024
2 checks passed
@naglepuff naglepuff deleted the 1423-fix-ingest branch October 23, 2024 19:27
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.

bug: annotations column not populated by ingest
4 participants