Fix ingest post dependency upgrade #1428
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
innmdc-server
. After addressing that issue, I noticed there were more issues preventing ingest from running successfully.PydanticUserError:
Study
is not fully defined; you should defineList
, then callStudy.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
andMetatranscriptomeAssembly
were mistyped asBigInteger
, where the most recentnmdc-schema
documentation reports them as having a range ofFloat
. 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
columnAs 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 themultiomics
column for biosamples. This was fixed here by using Pydantic v2model_validator
s instead of v1root_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.