Open Pull Requests

Public-safe normalized rows for auditability.

Pull RequestBucketScoreLinkedLabelsExcerpt
Pull Request #13421: Fix oracledb async dialect entering cursors synchronouslywaiting on CI/check fix73#13420
`AsyncAdapt_oracledb_cursor._aenter_cursor()` called the synchronous `cursor.__enter__()` instead of awaiting `cursor.__aenter__()`, silently bypassing third-party async cursor wrappers (e.g. instrumentation libraries) that implement only the async context manager protocol. Removed the incorrect override so the curs...
Pull Request #13418: Use identifier preparer for string type collationswaiting on repo-owner test approval70#9693
### Description Fixes #9693. String type collation rendering currently hardcodes quoted collation names, so a PostgreSQL schema-qualified collation such as `schema.collation` is treated as one quoted identifier. This changes string type collation rendering to use the dialect identifier preparer, matching the existi...
Pull Request #13417: Add type annotations to sqlalchemy.ext.serializerwaiting on repo-owner test approval60none
## Summary Adds a small set of inline type annotations to the legacy `sqlalchemy.ext.serializer` extension. ## Details This keeps the change intentionally small and focused. It adds future annotations, removes the module-level mypy ignore marker, and annotates the serializer/deserializer helper methods plus the publ...
Pull Request #13416: Perf/eager collection bulk extendwaiting on repo-owner test approval60none
<!-- Provide a general summary of your proposed changes in the Title field above --> ### Description ## What changed Every eagerly-loaded child paid two wasted Python frames: the generated instrumentation wrapper (`append`/`add`) plus its `__set` no-op shell, even though with `_sa_initiator=False` the wrapper's enti...
Pull Request #13415: scalars/mappings performance improvement.waiting on repo-owner test approval60none
<!-- Provide a general summary of your proposed changes in the Title field above --> ### Description What changed Core .scalars() built a one-column Row per row only to unwrap it with itemgetter(0); .mappings() built a Row plus a second BaseRow (RowMapping) via attrgetter("_mapping"). New class-level _fetch_shape hi...
Pull Request #13405: # Cython batch instance processor — ~10–30% on most loads (collection joinedload −5%)waiting on repo-owner test approval70#13407
<!-- Provide a general summary of your proposed changes in the Title field above --> ### Description Add `orm/_loading_cy.py` with `_InstancesBatch`, a whole-chunk row processor built by `_instance_processor()` for the non-refresh, non-polymorphic load path. It replaces the per-row `[proc(row) for row in fetch]` com...
Pull Request #13404: Subqueryload without per-row Row construction — ~26% on subqueryloadwaiting on repo-owner test approval70#13406
<!-- Provide a general summary of your proposed changes in the Title field above --> ### Description <!-- Describe your changes in detail --> `_SubqCollections._load` iterated the `Query`, which routes through `Query.__iter__ -> result.unique()` and builds a `Row` object (plus runs the uniquing filter) for every row...
Pull Request #13402: Allow inspection registrations from module reloadswaiting on CI/check fix73#10748
### Summary - allow the inspection registry to accept a replacement registrar when it has the same module and name as the existing registration - keep the existing duplicate-registration assertion for conflicting registrars - add regression coverage for module reload style registration and a changelog entry Closes #...
Pull Request #13399: UniqueConstraint and Index withheld from table via attach_to_table flag, and appended to table via append_constraintwaiting on repo-owner test approval70#13048
<!-- Provide a general summary of your proposed changes in the Title field above --> ### Description <!-- Describe your changes in detail --> attach_to_table has been included for UniqueConstraint and Index to allow users to choose whether to include or withhold them from the Table (Table.constraints for UniqueConst...
Pull Request #13398: fix catastrophic backtracking in sqlite inline unique reflection regexwaiting on repo-owner test approval70#13419
Fixes: #13419 ### Description While reflecting a SQLite table, `get_unique_constraints` scans the stored `CREATE TABLE` text (taken verbatim from `sqlite_master.sql`) with an `INLINE_UNIQUE_PATTERN` to spot inline `UNIQUE` columns. The tail of that pattern is `[\t ]+[a-z0-9_ ]+?[\t ]+UNIQUE`, where the lazy middle c...
Pull Request #13368: Document deprecated MySQL (M,D) float syntax and improve error messagewaiting on repo-owner test approval70#11132
### Description Fixes #11132. Per maintainer guidance in the issue, this PR does two things: 1. **Documents the caveat**: adds a `.. warning::` to the MySQL dialect's `DOUBLE`, `REAL` and `FLOAT` datatype docs stating that the `DOUBLE(M,D)` / `REAL(M,D)` / `FLOAT(M,D)` precision/scale syntaxes are non-standard MySQL...
Pull Request #13323: Apply tuple bind expressions to expanding IN valueswaiting on repo-owner test approval62#8992
### Description Tuple-valued expanding parameters now apply each element type's `bind_expression()` when rendering expanded tuples. This matches scalar `IN` behavior for custom types and covers both `render_postcompile` and `literal_binds`. Fixes: #8992 ### Checklist This pull request is: - [ ] A documentation / typ...
Pull Request #13312: test: add coverage for delete with nested alias existswaiting on repo-owner test approval52none
### Description Adds test coverage for compiling a `DELETE` statement with a correlated `EXISTS` subquery that uses an aliased table. This verifies that SQLAlchemy correctly renders the aliased table inside the nested `EXISTS` clause while correlating it against the outer `DELETE` target. ### Checklist This pull req...
Pull Request #13303: Fix PostgreSQL CHECK constraint reflection stripping unrelated parenswaiting on contributor45#13157
Fixes #13157. The second pass over the CHECK constraint body in `get_multi_check_constraints` used a naive ```python re.sub(r"^[\s\n]*\((.+)\)[\s\n]*$", r"\1", m.group(1)) ``` which greedily paired the leading `(` with the trailing `)`. For an expression like ``` (x IS NULL OR y IS NULL) AND (x IS NULL OR y IS NULL)...
Pull Request #13289: fix: raise clear error when default_factory/default passed to WriteOnlyMapped/DynamicMapped relationshipwaiting on contributor45#13227
### Description Fixes: #13227 When `default_factory=list` or `default` is passed to a `WriteOnlyMapped` or `DynamicMapped` relationship, it previously caused cryptic crashes (e.g., `TypeError: LoaderCallableStatus object is not iterable` in `_WriteOnlyAttributeImpl.set()`). This happens because these mapped types ha...
Pull Request #13288: fix(pool): use time.monotonic() instead of time.time() for connection timestampswaiting on contributor45#13169
### Description Replaced all `time.time()` calls in `pool/base.py` with `time.monotonic()` for connection record timestamp tracking. Also updated the comment block that documented the Windows precision caveat. `time.time()` on Windows has approximately 16 ms granularity, which can cause soft invalidation checks to f...
Pull Request #13137: Use _effective_decimal_return_scale in Numeric.result_processorwaiting on repo-owner test approval52none
### Description `Numeric.result_processor` computes the decimal return scale inline, bypassing the `decimal_return_scale` parameter, while `Float.result_processor` correctly uses `_effective_decimal_return_scale`. ### Current behavior ```python # Numeric.result_processor - ignores decimal_return_scale return process...
Pull Request #13051: Added implementations for avg & abswaiting on contributor45#13049
<!-- Provide a general summary of your proposed changes in the Title field above --> ### Description Added the implementations for `func.avg()` and `func.abs()`. Fixes: #13049 ### Checklist <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is sub...
Pull Request #12731: fix(typing): allow DeclarativeBase subclasses in with_for_update(of=...)draft/noise33#12730
This commit updates the `_ForUpdateOfArgument` type alias used in the `with_for_update(of=...)` method to explicitly allow `Type[DeclarativeBase]` subclasses. In SQLAlchemy 2.x, `DeclarativeBase` is the recommended way to define ORM models. While runtime behavior already accepts these classes as valid arguments for...
Pull Request #12698: Handle schema-qualified collation value in collate()draft/noise43none
based on #12697 (and #12510).
Pull Request #12697: Support schema-qualified collation in types for PostgreSQLwaiting on contributor45#9693
We add a `collation_schema` in types supporting `collation`, along with `postgresql.DOMAIN`, allowing to create respective elements with a schema-qualified collation name. Reflection is also handled for both types and domains. Fix #9693.
Pull Request #12645: enable mypy "ignore-without-code" rulewaiting on CI/check fix55none
### Description Enable mypy "ignore-without-code" rule and apply the necessary fixes. Not really a "small typing error fix" but I think that's the closest of the items from the checklist. ### Checklist This pull request is: - [x] A documentation / typographical / small typing error fix - Good to go, no issue or test...
Pull Request #12433: Coerce aliased Select and CompoundSelect to subquerywaiting on contributor35none
Fixes issue #6274 ### Description When `aliased()` is used on a select statement or compound select statement, it currently throws an error. The proposed solution in #6274 was to instead return a subquery and emit a warning to the user that aliases are not supported for these types of statements. ### Checklist <!--...
Pull Request #12401: Make loader strategy error message more verbosewaiting on CI/check fix65#12398
Fixes: #12398 This PR makes the error message on conflicting loader strategies more verbose to help with debugging <!-- Provide a general summary of your proposed changes in the Title field above --> ### Description <!-- Describe your changes in detail --> I changed the omitted error messages and the tests covering...
Pull Request #12297: refactor(MSExecutionContext): improve identity insert handling and va…has linked issue27#11620
Fixes: #11620 ### Description - Refactored method in to improve readability and maintainability: - Extracted identity insert logic into helper methods: - : Determines if identity insert should be enabled. - : Handles warnings or errors based on . - Simplified the method by delegating responsibilities to these helper...
Pull Request #11437: initial commit to update the SQLAlchemy exampleswaiting on contributor35none
* most examples now work on 2.x * examples are mostly typed * README files are added for more instruction * examples now have metadata for automation * a preliminary fabric tool is used for testing and reporting Change-Id: Ib5a12cc59b2ea045c48ea90798b887e3b5d4fbbe ### Description There are quite a bit of things goin...
Pull Request #11297: Optionally include rollback exception in closed transaction invalid request error message when possiblewaiting on contributor35none
Following discussion https://github.com/sqlalchemy/sqlalchemy/discussions/11243 ### Description 1. Exposing private attribute `SessionTransaction._rollback_exception` using public property `rollback_exception` 2. In `TransactionalContext._trans_ctx_check()` when a closed transaction is detected. first checking a tra...
Pull Request #11296: Ability to specify `WITH` when creating a table + fixes `WITH` when creating an indexwaiting on contributor45#11122
<!-- Provide a general summary of your proposed changes in the Title field above --> ### Description Adding the ability to specify storage parameters via with + fix for specifying index storage parameters (should it be split into two different PRs?). Fixes: #11122 ### Checklist <!-- go over following points. check t...
Pull Request #11180: Fix subquerload deprecationstale/low urgency17none
Change-Id: I3d1b844dee6dc29da4a6aaa0c2916e6a1178aaec The deprecation info does not appear in 3 important sections: * The initial overview * API docstrings in 2 places. This PR notes the deprecation in the overview, and adds links/deprecation docstrings to the functions so they should show up in the API docs. ### Des...
Pull Request #11107: migration note on subquerieswaiting on contributor35none
Change-Id: Id33779cb126a700d9adebe5f08f9d6c085589db4 Under 2.0, calls to `in_` and `not_in` no longer accept an explicit `.subquery()`. Passing a `.subquery()` will cause typing issues from MyPy AND will raise runtime warnings. There was no note of this in the migration guide. This may be an effect of another change...
Pull Request #10574: fixes: #2943, allow overriding validates for inheritancewaiting on CI/check fix55none
Applied the patch mentioned in #2943, to allow overriding the validates method of a given Model, Added tests for same in test_validators. If a Child class overrides the parent class validates method only child class validator will be invoked unless child class explicitly invokes parent class validator <!-- Provide a...
Pull Request #8136: Add tools for documentation formatting and validationdraft/noise43none
### Description The goal of this PR is to add tools that help with contributing to documentation, from discussion started on #7659. Goals include: - Automatic formatting of code blocks in .rst documents and in docstrings (blacken-docs) - Flake8 validation of these code blocks (flake8-rst-docstrings, flake8-docstring...