-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix/sqlalchemy 2.0 compatibility - chapter6 UoW #110
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
Open
rickywesker
wants to merge
67
commits into
cosmicpython:chapter_05_uow_exercise
Choose a base branch
from
rickywesker:fix/sqlalchemy-2.0-compatibility
base: chapter_05_uow_exercise
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
9a74b16
makefile for running stuff
hjwp 5be7bcf
first test [first_test]
hjwp fc5811e
first stab at a model [domain_model_1]
hjwp 108a74c
more tests for can_allocate [test_can_allocate]
hjwp d817ecd
can_allocate fn [can_allocate]
hjwp bd0e75e
simple deallocate test
hjwp 8ad3236
simple deallocate function
hjwp bebd0fd
test deallocate not allocated [test_deallocate_unallocated]
hjwp b2d618a
model now tracks allocations [domain_model_complete]
hjwp ad26a08
test allocate twice [last_test]
hjwp 235e121
equality and hash operators [equality_on_batches]
hjwp d1dda70
new tests for allocate domain service [test_allocate]
hjwp 8a6ec0e
allocate fn, domain service [domain_service]
hjwp ff0a15c
fixup a batchref
hjwp 0c3b87e
change tests add one for return
hjwp 07dd382
make Batches sortable [dunder_gt]
hjwp 18aa3b4
fixup a sku
hjwp d75eaf7
test out of stock exception [test_out_of_stock]
hjwp 184d90d
raising out of stock exception [out_of_stock]
hjwp 73dae3f
add readme from master
hjwp 5b77fc4
Wrong path in venv creation line
karolpawlowski 3e9871d
travis config. [chapter_01_domain_model_ends]
hjwp 58d05e4
first cut of orm, orderlines only [sqlalchemy_classical_mapper]
hjwp ef7a621
first tests of orm [orm_tests]
hjwp 527b320
unfortunate hack on dataclass in model
hjwp 26b997e
batches with no allocations
hjwp fff68bd
ORM for _allocations set on Batch
hjwp 8dae126
repository tests
hjwp b635a15
repository for batches [chapter_02_repository_ends]
hjwp fda077d
first api tests [first_api_test]
hjwp 15902a6
all the dockerfile gubbins
hjwp 8fc086e
first cut of flask app [first_cut_flask_app]
hjwp 158e760
test persistence by double-allocating. [second_api_test]
hjwp d0ee7ad
need to commit [flask_commit]
hjwp f20c479
test some 400 error cases [test_error_cases]
hjwp 80dece9
flask now does error handling [flask_error_handling]
hjwp a1903fa
first tests for the services layer [first_services_tests]
hjwp 9fe9a3d
FakeRepository [fake_repo]
hjwp 15b9bf7
FakeSession [fake_session]
hjwp eded7eb
test commmits [second_services_test]
hjwp d1e2e6e
services layer with valid-sku check [service_function]
hjwp cf2f52b
modify flask app to use service layer [flask_app_using_service_layer]
hjwp b537364
strip out unecessary tests from e2e layer [fewer_e2e_tests]
hjwp 952a3d2
fix conftest waits and travis config [chapter_04_service_layer_ends]
hjwp bdf8fe9
move to a more nested folder structure
hjwp 1bb572a
nest the tests too
hjwp db89218
get all tests passing
hjwp c5822aa
rewrite service layer to take primitives [service_takes_primitives]
hjwp f341bee
services tests partially converted to primitives [tests_call_with_pri…
hjwp 1e1f238
fixture function for batches [services_factory_function]
hjwp 5c953da
new service to add a batch [add_batch_service]
hjwp 262eec0
service-layer test for add batch [test_add_batch]
hjwp c8fbb60
all service-layer tests now services [services_tests_all_services]
hjwp 96301d2
modify flask app to use new service layer api [api_uses_modified_serv…
hjwp 6b404b5
add api endpoint for add_batch [api_for_add_batch]
hjwp fd45a6f
api tests no longer need hardcoded sql fixture [chapter_05_high_gear_…
hjwp d9c340c
start moving files into src folder and add setup.py
hjwp c843a10
fix all the imports, get it all working
hjwp 12d2bc2
get tests working in docker container
hjwp 28afa9a
make mypy slightly stricter
hjwp 53ad798
better requirements.txt [appendix_project_structure_ends]
hjwp 833d48b
basic uow test, uow and conftest.py changes
hjwp 658e61a
use uow in services, flask app
hjwp 7526014
two more tests for rollback behaviour [chapter_06_uow_ends]
hjwp 916bcdd
strip out UoW and fake UoW, add some tips
hjwp 6876e75
update tests
hjwp 00f1574
fix: SQLAlchemy 2.0 compatibility for chapter_06_uow_exercise
rickywesker 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
Prev
Previous commit
fix: SQLAlchemy 2.0 compatibility for chapter_06_uow_exercise
- Replace deprecated mapper() with registry.map_imperatively() - Replace session.query() with session.scalars(select()) - Wrap raw SQL strings with text() - Replace clear_mappers() with mapper_registry.dispose() - Update requirements.txt to require sqlalchemy>=2.0
- Loading branch information
commit 00f1574723251a53ce2462be71a4a46c98ad6bd3
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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # app | ||
| sqlalchemy | ||
| sqlalchemy>=2.0 | ||
| flask | ||
| psycopg2-binary | ||
|
|
||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,24 +1,29 @@ | ||||
| import pytest | ||||
| from sqlalchemy import text | ||||
| from allocation.domain import model | ||||
|
||||
| from allocation.domain import model |
rickywesker marked this conversation as resolved.
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.