Skip to content

Commit 25be901

Browse files
Add in missing memoized decorator calls (#133)
* Add in missing memoized decorator calls * Prob safer to assume that's just a normal property
1 parent 31706fd commit 25be901

20 files changed

+53
-2
lines changed

sqlalchemy-stubs/dialects/mysql/dml.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from typing import Any
22

3+
from ... import util as util
34
from ...sql.dml import Insert as StandardInsert
45
from ...sql.elements import ClauseElement
56

67
class Insert(StandardInsert):
78
stringify_dialect: str = ...
89
@property
910
def inserted(self): ...
11+
@util.memoized_property
1012
def inserted_alias(self): ...
1113
def on_duplicate_key_update(self, *args: Any, **kw: Any) -> None: ...
1214

sqlalchemy-stubs/dialects/mysql/mysqlconnector.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class MySQLDialect_mysqlconnector(MySQLDialect):
3030
def __init__(self, *arg: Any, **kw: Any) -> None: ...
3131
@property
3232
def description_encoding(self): ...
33+
@util.memoized_property
3334
def supports_unicode_statements(self): ...
3435
@classmethod
3536
def dbapi(cls): ...

sqlalchemy-stubs/dialects/mysql/mysqldb.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class MySQLDialect_mysqldb(MySQLDialect):
2727
statement_compiler: Any = ...
2828
preparer: Any = ...
2929
def __init__(self, **kwargs: Any) -> None: ...
30+
@util.memoized_property
3031
def supports_server_side_cursors(self): ...
3132
@classmethod
3233
def dbapi(cls): ...

sqlalchemy-stubs/dialects/mysql/pymysql.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class MySQLDialect_pymysql(MySQLDialect_mysqldb):
1010
description_encoding: Any = ...
1111
supports_unicode_statements: bool = ...
1212
supports_unicode_binds: bool = ...
13+
@langhelpers.memoized_property
1314
def supports_server_side_cursors(self): ...
1415
@classmethod
1516
def dbapi(cls): ...

sqlalchemy-stubs/dialects/postgresql/dml.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
from typing import Any
22
from typing import Optional
33

4+
from ... import util as util
45
from ...sql.dml import Insert as StandardInsert
56
from ...sql.elements import ClauseElement
67

78
class Insert(StandardInsert):
89
stringify_dialect: str = ...
10+
@util.memoized_property
911
def excluded(self): ...
1012
def on_conflict_do_update(
1113
self,

sqlalchemy-stubs/dialects/postgresql/pypostgresql.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class PGDialect_pypostgresql(PGDialect):
2424
colspecs: Any = ...
2525
@classmethod
2626
def dbapi(cls): ...
27+
@util.memoized_property
2728
def dbapi_exception_translation_map(self): ...
2829
def create_connect_args(self, url: Any): ...
2930
def is_disconnect(self, e: Any, connection: Any, cursor: Any): ...

sqlalchemy-stubs/dialects/sqlite/dml.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
from typing import Any
22
from typing import Optional
33

4+
from ... import util as util
45
from ...sql.dml import Insert as StandardInsert
56
from ...sql.elements import ClauseElement
67

78
class Insert(StandardInsert):
89
stringify_dialect: str = ...
10+
@util.memoized_property
911
def excluded(self): ...
1012
def on_conflict_do_update(
1113
self,

sqlalchemy-stubs/engine/cursor.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ from .result import Result
1414
from .result import ResultMetaData
1515
from .result import Row
1616
from .row import LegacyRow
17+
from .. import util as util
1718

1819
_TCursorResult = TypeVar("_TCursorResult", bound=CursorResult)
1920

@@ -176,6 +177,7 @@ class BaseCursorResult:
176177
def prefetch_cols(self) -> bool: ...
177178
def supports_sane_rowcount(self) -> bool: ...
178179
def supports_sane_multi_rowcount(self) -> bool: ...
180+
@util.memoized_property
179181
def rowcount(self) -> int: ...
180182
@property
181183
def lastrowid(self) -> Any: ...

sqlalchemy-stubs/ext/associationproxy.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class AssociationProxyInstance:
6868
def local_attr(self): ...
6969
@property
7070
def attr(self): ...
71+
@util.memoized_property
7172
def scalar(self): ...
7273
@property
7374
def info(self): ...

sqlalchemy-stubs/orm/attributes.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@ class QueryableAttribute(
7070
) -> None: ...
7171
def __reduce__(self): ...
7272
def get_history(self, instance: Any, passive: Any = ...): ...
73+
@util.memoized_property
7374
def info(self): ...
75+
@util.memoized_property
7476
def parent(self): ...
77+
@util.memoized_property
7578
def expression(self): ...
7679
def __clause_element__(self): ...
7780
def adapt_to_entity(self, adapt_to_entity: Any): ...
@@ -82,6 +85,7 @@ class QueryableAttribute(
8285
def reverse_operate(self, op: Any, other: Any, **kwargs: Any): ...
8386
def hasparent(self, state: Any, optimistic: bool = ...): ...
8487
def __getattr__(self, key: Any): ...
88+
@util.memoized_property
8589
def property(self): ...
8690

8791
_T = TypeVar("_T")

0 commit comments

Comments
 (0)