-
-
Notifications
You must be signed in to change notification settings - Fork 49
Code consistency #358
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
PGijsbers
wants to merge
12
commits into
main
Choose a base branch
from
code-consistency
base: main
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
Code consistency #358
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f672e59
rename fields for consistency and clarity
PGijsbers 7aacbd1
Rename and type study for consistency
PGijsbers 6aeb97d
Improve consistency for field names and typing
PGijsbers a7c4b57
Rename and type variable names more consistently
PGijsbers 34e5ba3
Improve consistency of naming and typing identifiers
PGijsbers 7c21f85
Use `Identifier` typing for identifiers
PGijsbers 853f876
Move schemas to router subdirectory
PGijsbers 910fd5e
partial progress to only use sesssions
PGijsbers 3bcb9b3
Do not use AsyncSession concurrently together, it's not supported
PGijsbers c33aafd
Troubleshooting the session/connection lifecycle
PGijsbers 532107b
Fix issue with prematurely closed connections
PGijsbers 19b9557
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 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
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: openml/server-api
Length of output: 1929
🏁 Script executed:
Repository: openml/server-api
Length of output: 1994
🌐 Web query:
SQLAlchemy AsyncConnection.execute parameters params signature AsyncSession.execute docs💡 Result:
In SQLAlchemy, the execute method signatures differ between AsyncConnection and AsyncSession, specifically regarding the parameter argument name. AsyncConnection.execute The signature for AsyncConnection.execute is: async def execute(self, statement: Executable, parameters: _CoreAnyExecuteParams | None = None, *, execution_options: CoreExecuteOptionsParameter | None = None) -> CursorResult[Any] The parameter holding the bind values is named parameters [1][2]. It accepts either a single dictionary (for a single execution) or a sequence of dictionaries (for executemany behavior) [1][2]. AsyncSession.execute The signature for AsyncSession.execute uses params instead of parameters: async def execute(self, statement: Executable, params: Optional[_CoreAnyExecuteParams] = None, *, execution_options: OrmExecuteOptionsParameter = util.EMPTY_DICT, bind_arguments: Optional[_BindArguments] = None, kw: Any) -> Result[Unpack[TupleAny]] In the AsyncSession, the argument is named params [3]. This aligns with the interface of the synchronous ORM Session.execute method [3]. Summary of Key Differences Component | Argument Name for Bind Values | Reference --- | --- | --- AsyncConnection.execute | parameters [1] | [1], [4] AsyncSession.execute | params [3] | [3] Both methods are awaitable and return result objects [1][3]. When using these methods, ensure you use the argument name specific to the object type you are interacting with (Connection vs. Session) to avoid keyword argument errors.
Citations:
Use
parameters=forAsyncConnection.execute().expdb_connectionis anAsyncConnection, so lines 96 and 104 should passparameters=;params=is forAsyncSession.execute()and will raise aTypeErrorhere.🤖 Prompt for AI Agents