Data Service Rest Refactor -- Library Code#327
Data Service Rest Refactor -- Library Code#327aaraney wants to merge 30 commits intoNOAA-OWP:masterfrom
Conversation
|
@aaraney, I lost track of this one previously. It needs to be rebased after the recent merges. I'll probably start glancing at it, but I'll wait to perform the review in earnest until that's done. |
…ved although we may want to merge the work
35306c6 to
b1cc93d
Compare
|
@robertbartel, ive rebased and force pushed the changes. |
|
@aaraney, the first thing I noticed starting my review was the duplication of several Dataset related things, including the Dataset class. I vaguely recall a conversation - perhaps not about this but something similar - where the plan was to duplicate several types temporarily while we waited on the Pydantic refactoring work, in order to give Pydantic functionality to the temporary, copied types. With the Pydantic work now finished, I want to confirm before I get too deep into the review process: do we still need to duplicate things like this? |
|
@robertbartel, your memory is correct. The majority if not all of the duplication can be removed now that #331 has been merged. I am going to move this to draft status for now until I address the unnecessary duplication. |
|
This is superseded by the work introduced in #575. Some of the ideas and data transfer objects may be applicable to future work. |
The second phase of refactoring the data service. This phase focuses on rewriting library code that supports reading and writing to and from the object store (related #323). Much of this work will eventually be migrated into
dmod.metadata, but for now, it will live in the service as it is the sole user.Additions
DatasetClientandDatasetQueryClient. These classes separate the concerns of reading and writing to a data store (e.g.minio) and functionally replaceObjectStoreDatasetManager.Resulttype that conceptually functions like a enum of eitherOk(T)orErr(E). This forces users to explicitly handle errors and enables treating exceptions types as values. This addition was heavily inspired by Rust'sResulttype.exceptiongroup. "This is a backport of the BaseExceptionGroup and ExceptionGroup classes from Python 3.11." source.Testing
DatasetClientandDatasetQueryClient's are added.Todos
Checklist