-
Notifications
You must be signed in to change notification settings - Fork 554
fix(query-source): Fix query source relative filepath #2717
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
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2f05dab
Improve query source path handling
gggritso 69e4f6c
Disable Objective C fork safety errors
gggritso 99f4584
Omit Python 2.x
gggritso d0125d6
Add tests
gggritso 9e42b30
Whoops, missed the rename
gggritso 7c786fc
Omit Python 2 completely
gggritso 101f018
Improve documentation
gggritso 086b9d1
Merge branch 'master' into ggg/fix-query-source-base-path
sentrivana 02feafa
Merge branch 'master' into ggg/fix-query-source-base-path
sentrivana 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
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
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,4 +1,10 @@ | ||
import os | ||
import sys | ||
import pytest | ||
|
||
pytest.importorskip("asyncpg") | ||
pytest.importorskip("pytest_asyncio") | ||
|
||
# Load `asyncpg_helpers` into the module search path to test query source path names relative to module. See | ||
# `test_query_source_with_module_in_search_path` | ||
sys.path.insert(0, os.path.join(os.path.dirname(__file__))) | ||
Empty file.
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,2 @@ | ||
async def execute_query_in_connection(query, connection): | ||
await connection.execute(query) |
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,3 +1,9 @@ | ||
import os | ||
import sys | ||
import pytest | ||
|
||
pytest.importorskip("django") | ||
|
||
# Load `django_helpers` into the module search path to test query source path names relative to module. See | ||
# `test_query_source_with_module_in_search_path` | ||
sys.path.insert(0, os.path.join(os.path.dirname(__file__))) |
Empty file.
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,9 @@ | ||
from django.contrib.auth.models import User | ||
from django.http import HttpResponse | ||
from django.views.decorators.csrf import csrf_exempt | ||
|
||
|
||
@csrf_exempt | ||
def postgres_select_orm(request, *args, **kwargs): | ||
user = User.objects.using("postgres").all().first() | ||
return HttpResponse("ok {}".format(user)) |
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,3 +1,9 @@ | ||
import os | ||
import sys | ||
import pytest | ||
|
||
pytest.importorskip("sqlalchemy") | ||
|
||
# Load `sqlalchemy_helpers` into the module search path to test query source path names relative to module. See | ||
# `test_query_source_with_module_in_search_path` | ||
sys.path.insert(0, os.path.join(os.path.dirname(__file__))) |
Empty file.
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,7 @@ | ||
def add_model_to_session(model, session): | ||
session.add(model) | ||
session.commit() | ||
|
||
|
||
def query_first_model_from_session(model_klass, session): | ||
return session.query(model_klass).first() |
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
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.