Merged
Conversation
- query_rec -> read_records - top_index -> read_top_index - get_columns -> read_columns - exists -> read_exists - get_version -> read_version - get_report -> read_report - list_unresolved -> read_unresolved - alleles2st -> read_st - bestST -> read_best_st - bestAlleles -> read_best_alleles - get_unique_alleles -> read_unique_alleles All call sites updated across utils/, cli.py, and tests/.
- setPredictor -> set_predictor - sync_novel -> set_novel_st - rm_novel -> set_novel_ignored - set_report already correct upd_rec kept as generic updater for profile table operations. All call sites updated.
- purge_rec -> delete_records All call sites updated.
Add typed per-model methods for ORM tables: - _add_orm_record(): shared private helper (replaces ORM path of add_rec) - add_sample/project/seq_type/resistance/expac/report/collection/version() - update_sample() — includes CG_ID_sample cascade to child tables - update_project() / update_version() - delete_sample() / delete_project() / delete_collection() Old generic methods (add_rec ORM path, upd_rec, delete_records) still present; callers migrated in next commit.
…llers of add_rec/upd_rec/delete_records now use the typed per-model\nequivalents (add_sample, add_version, add_report, update_sample,\ndelete_sample, delete_project, delete_collection). The only remaining\nadd_rec call is the ProfileTable (non-ORM) path in set_predictor.
…le only\n\n- Strip ORM path from add_rec; it now only handles non-ORM Table objects (ProfileTable / novel tables)\n- Remove upd_rec entirely (no remaining callers)\n- Remove delete_records entirely (no remaining callers)\n- Update tests: replace remaining upd_rec/delete_records/add_rec-with-string calls with typed per-model methods; drop test_add_rec_unknown_table which tested removed ORM fallback behaviour
…ion helpers\n\n- add_sample/project/seq_type/resistance/expac/report/collection/version(**kwargs)\n are now pure factory functions that construct and return the ORM object;\n callers are responsible for add_to_session() and commit_session()\n- add_to_session(obj): coerces string DateTime fields, skips silently if PK\n already exists, then stages the object\n- commit_session(): thin wrapper around session.commit()\n- Remove _add_orm_record helper\n- Update all callers (scraper, job_creator, conftest, tests) to\n factory(**kwargs) -> add_to_session -> commit_session pattern
- Introduced JobCreationError for better error management in job creation processes. - Removed unused date_ordered field from Projects model. - Cleaned up and organized imports across multiple files. - Updated sampleinfo_projects.json to remove date_ordered entries. - Refactored methods in Job_Creator to raise JobCreationError when sample information is missing. - Improved type hints and code readability in various functions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This pull request refactors several database access patterns and improves error handling across the codebase, especially in job creation and data scraping utilities. The main focus is on standardising method names for database operations, introducing more robust error handling for job creation, and updating the interfaces for interacting with the database. Additionally, some minor code cleanups and formatting improvements are included.
Primary function of PR
Testing
bash /home/proj/production/servers/resources/hasta.scilifelab.se/install-microsalt-stage.sh BRANCHNAMEusconda activate S_microSALTmicroSALT analyse --input /path/to/fastq/ SAMPLEINFO_FILETest results
These are the results of the tests, and necessary conclusions, that prove the stability of the PR.
Sign-offs