-
Notifications
You must be signed in to change notification settings - Fork 2
bugfix: increase length of LithologicModifier field to accommodate larger values #429
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
Merged
+70
−21
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ead4baf
feat: increase length of LithologicModifier field to accommodate larg…
jirhiker fa2463e
feat: update NMA_Stratigraphy table schema with new constraints and f…
jirhiker 970019f
feat: refactor waterlevels_transducer_transfer to use SQLAlchemy inse…
jirhiker 052c1e2
feat: add high-volume transfer playbook to optimize SQLAlchemy data h…
jirhiker 4d32a13
feat: filter observation columns before inserting into TransducerObse…
jirhiker 844cd0d
Update AGENTS.MD
jirhiker 3a57364
Update transfers/waterlevels_transducer_transfer.py
jirhiker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # AGENTS: High-Volume Transfer Playbook | ||
|
|
||
| This repo pushes millions of legacy rows through SQLAlchemy. When Codex or any other agent has to work on | ||
| these transfers, keep the following rules in mind to avoid hour-long runs: | ||
|
|
||
| ## 1. Skip ORM object construction once volume climbs | ||
| - **Do not call `session.bulk_save_objects`** for high frequency tables (e.g., transducer observations, | ||
| water-levels, chemistry results). It still instantiates every mapped class and kills throughput. | ||
| - Instead, build plain dictionaries/tuples and call `session.execute(insert(Model), data)` or the newer | ||
| SQLAlchemy `session.execute(stmt, execution_options={"synchronize_session": False})`. | ||
| - If validation is required (Pydantic models, bound schemas), validate first and dump to dicts before the | ||
| Core insert. | ||
|
|
||
|
|
||
| ## 2. Running pytest safely | ||
| - Activate the repo virtualenv before testing: `source .venv/bin/activate` from the project root so all | ||
| dependencies (sqlalchemy, fastapi, etc.) are available. | ||
| - Load environment variables from `.env` so pytest sees the same DB creds the app uses. For quick shells: | ||
| `set -a; source .env; set +a`, or use `ENV_FILE=.env pytest ...` with `python-dotenv` installed. | ||
| - Many tests expect a running Postgres bound to the vars in `.env`; confirm `POSTGRES_*` values point to the | ||
| right instance before running destructive suites. | ||
| - When done, `deactivate` to exit the venv and avoid polluting other shells. | ||
|
|
||
| Following this playbook keeps ETL runs measured in seconds/minutes instead of hours. EOF |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.