Skip to content
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

Add defaults for third-party stubs Q-T #9959

Merged
merged 4 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class immutabledict(dict[_KT, _VT], Generic[_KT, _VT]):
@overload
def union(self, __dict: dict[_KT2, _VT2]) -> immutabledict[_KT | _KT2, _VT | _VT2]: ...
@overload
def union(self, __dict: None = ..., **kw: SupportsKeysAndGetItem[_KT2, _VT2]) -> immutabledict[_KT | _KT2, _VT | _VT2]: ...
def union(self, __dict: None = None, **kw: SupportsKeysAndGetItem[_KT2, _VT2]) -> immutabledict[_KT | _KT2, _VT | _VT2]: ...
def merge_with(
self, *args: SupportsKeysAndGetItem[_KT | _KT2, _VT2] | Iterable[tuple[_KT2, _VT2]] | None
) -> immutabledict[_KT | _KT2, _VT | _VT2]: ...
4 changes: 2 additions & 2 deletions stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ class MxODBCConnector(Connector):
def on_connect(self): ...
def create_connect_args(self, url): ...
def is_disconnect(self, e, connection, cursor): ...
def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ...
def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ...
def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ...
def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ...
2 changes: 1 addition & 1 deletion stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PyODBCConnector(Connector):
default_paramstyle: str
use_setinputsizes: bool
pyodbc_driver_name: Any
def __init__(self, supports_unicode_binds: Incomplete | None = ..., use_setinputsizes: bool = ..., **kw) -> None: ...
def __init__(self, supports_unicode_binds: Incomplete | None = None, use_setinputsizes: bool = False, **kw) -> None: ...
@classmethod
def dbapi(cls): ...
def create_connect_args(self, url): ...
Expand Down
28 changes: 14 additions & 14 deletions stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ RESERVED_WORDS: Any

class _StringType(sqltypes.String):
charset: Any
def __init__(self, charset: Incomplete | None = ..., **kw) -> None: ...
def __init__(self, charset: Incomplete | None = None, **kw) -> None: ...

class VARCHAR(_StringType, sqltypes.VARCHAR):
__visit_name__: str
def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ...
def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ...

class CHAR(_StringType, sqltypes.CHAR):
__visit_name__: str
def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ...
def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ...

class _FBDateTime(sqltypes.DateTime):
def bind_processor(self, dialect): ...
Expand All @@ -52,7 +52,7 @@ class FBCompiler(sql.compiler.SQLCompiler):
def visit_startswith_op_binary(self, binary, operator, **kw): ...
def visit_not_startswith_op_binary(self, binary, operator, **kw): ...
def visit_mod_binary(self, binary, operator, **kw): ...
def visit_alias(self, alias, asfrom: bool = ..., **kwargs): ... # type: ignore[override]
def visit_alias(self, alias, asfrom: bool = False, **kwargs): ... # type: ignore[override]
def visit_substring_func(self, func, **kw): ...
def visit_length_func(self, function, **kw): ...
visit_char_length_func: Any
Expand Down Expand Up @@ -97,13 +97,13 @@ class FBDialect(default.DefaultDialect):
def __init__(self, *args, **kwargs) -> None: ...
implicit_returning: Any
def initialize(self, connection) -> None: ...
def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override]
def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override]
def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ...
def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ...
def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ...
def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ...
def get_column_sequence(self, connection, table_name, column_name, schema: Incomplete | None = ..., **kw): ...
def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ...
def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ...
def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ...
def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override]
def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None): ... # type: ignore[override]
def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ...
def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ...
def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ...
def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ...
def get_column_sequence(self, connection, table_name, column_name, schema: Incomplete | None = None, **kw): ...
def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ...
def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw): ...
def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw): ...
2 changes: 1 addition & 1 deletion stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ from .kinterbasdb import FBDialect_kinterbasdb

class FBDialect_fdb(FBDialect_kinterbasdb):
supports_statement_cache: bool
def __init__(self, enable_rowcount: bool = ..., retaining: bool = ..., **kwargs) -> None: ...
def __init__(self, enable_rowcount: bool = True, retaining: bool = False, **kwargs) -> None: ...
@classmethod
def dbapi(cls): ...
def create_connect_args(self, url): ...
Expand Down
4 changes: 2 additions & 2 deletions stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class FBDialect_kinterbasdb(FBDialect):
concurrency_level: Any
retaining: Any
def __init__(
self, type_conv: int = ..., concurrency_level: int = ..., enable_rowcount: bool = ..., retaining: bool = ..., **kwargs
self, type_conv: int = 200, concurrency_level: int = 1, enable_rowcount: bool = True, retaining: bool = False, **kwargs
) -> None: ...
@classmethod
def dbapi(cls): ...
def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ...
def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ...
def do_rollback(self, dbapi_connection) -> None: ...
def do_commit(self, dbapi_connection) -> None: ...
def create_connect_args(self, url): ...
Expand Down
32 changes: 16 additions & 16 deletions stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class _MSDate(sqltypes.Date):

class TIME(sqltypes.TIME):
precision: Any
def __init__(self, precision: Incomplete | None = ..., **kwargs) -> None: ...
def __init__(self, precision: Incomplete | None = None, **kwargs) -> None: ...
def bind_processor(self, dialect): ...
def result_processor(self, dialect, coltype): ...

Expand All @@ -67,12 +67,12 @@ class SMALLDATETIME(_DateTimeBase, sqltypes.DateTime):
class DATETIME2(_DateTimeBase, sqltypes.DateTime):
__visit_name__: str
precision: Any
def __init__(self, precision: Incomplete | None = ..., **kw) -> None: ...
def __init__(self, precision: Incomplete | None = None, **kw) -> None: ...

class DATETIMEOFFSET(_DateTimeBase, sqltypes.DateTime):
__visit_name__: str
precision: Any
def __init__(self, precision: Incomplete | None = ..., **kw) -> None: ...
def __init__(self, precision: Incomplete | None = None, **kw) -> None: ...

class _UnicodeLiteral:
def literal_processor(self, dialect): ...
Expand All @@ -84,7 +84,7 @@ class TIMESTAMP(sqltypes._Binary):
__visit_name__: str
length: Any
convert_int: Any
def __init__(self, convert_int: bool = ...) -> None: ...
def __init__(self, convert_int: bool = False) -> None: ...
def result_processor(self, dialect, coltype): ...

class ROWVERSION(TIMESTAMP):
Expand All @@ -101,7 +101,7 @@ class VARBINARY(sqltypes.VARBINARY, sqltypes.LargeBinary):
@overload
def __init__(self, *, filestream: Literal[True]) -> None: ...
@overload
def __init__(self, length: Incomplete | None = ..., filestream: Literal[False] = ...) -> None: ...
def __init__(self, length: Incomplete | None = None, filestream: Literal[False] = False) -> None: ...

class IMAGE(sqltypes.LargeBinary):
__visit_name__: str
Expand Down Expand Up @@ -251,7 +251,7 @@ class MSSQLStrictCompiler(MSSQLCompiler):

class MSDDLCompiler(compiler.DDLCompiler):
def get_column_specification(self, column, **kwargs): ...
def visit_create_index(self, create, include_schema: bool = ...): ... # type: ignore[override]
def visit_create_index(self, create, include_schema: bool = False): ... # type: ignore[override]
def visit_drop_index(self, drop): ...
def visit_primary_key_constraint(self, constraint): ...
def visit_unique_constraint(self, constraint): ...
Expand All @@ -262,7 +262,7 @@ class MSDDLCompiler(compiler.DDLCompiler):
class MSIdentifierPreparer(compiler.IdentifierPreparer):
reserved_words: Any
def __init__(self, dialect) -> None: ...
def quote_schema(self, schema, force: Incomplete | None = ...): ...
def quote_schema(self, schema, force: Incomplete | None = None): ...

class MSDialect(default.DefaultDialect):
name: str
Expand Down Expand Up @@ -296,15 +296,15 @@ class MSDialect(default.DefaultDialect):
isolation_level: Any
def __init__(
self,
query_timeout: Incomplete | None = ...,
use_scope_identity: bool = ...,
schema_name: str = ...,
isolation_level: Incomplete | None = ...,
deprecate_large_types: Incomplete | None = ...,
json_serializer: Incomplete | None = ...,
json_deserializer: Incomplete | None = ...,
legacy_schema_aliasing: Incomplete | None = ...,
ignore_no_transaction_on_rollback: bool = ...,
query_timeout: Incomplete | None = None,
use_scope_identity: bool = True,
schema_name: str = "dbo",
isolation_level: Incomplete | None = None,
deprecate_large_types: Incomplete | None = None,
json_serializer: Incomplete | None = None,
json_deserializer: Incomplete | None = None,
legacy_schema_aliasing: Incomplete | None = None,
ignore_no_transaction_on_rollback: bool = False,
**opts,
) -> None: ...
def do_savepoint(self, connection, name) -> None: ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ class MSDialect_mxodbc(MxODBCConnector, MSDialect):
supports_statement_cache: bool
colspecs: Any
description_encoding: Any
def __init__(self, description_encoding: Incomplete | None = ..., **params) -> None: ...
def __init__(self, description_encoding: Incomplete | None = None, **params) -> None: ...

dialect = MSDialect_mxodbc
4 changes: 2 additions & 2 deletions stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class MSDialect_pyodbc(PyODBCConnector, MSDialect):
description_encoding: Any
use_scope_identity: Any
fast_executemany: Any
def __init__(self, description_encoding: Incomplete | None = ..., fast_executemany: bool = ..., **params) -> None: ...
def __init__(self, description_encoding: Incomplete | None = None, fast_executemany: bool = False, **params) -> None: ...
def on_connect(self): ...
def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ...
def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ...
def is_disconnect(self, e, connection, cursor): ...

dialect = MSDialect_pyodbc
8 changes: 4 additions & 4 deletions stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ class AsyncAdapt_aiomysql_cursor:
@property
def lastrowid(self): ...
def close(self) -> None: ...
def execute(self, operation, parameters: Incomplete | None = ...): ...
def execute(self, operation, parameters: Incomplete | None = None): ...
def executemany(self, operation, seq_of_parameters): ...
def setinputsizes(self, *inputsizes) -> None: ...
def __iter__(self): ...
def fetchone(self): ...
def fetchmany(self, size: Incomplete | None = ...): ...
def fetchmany(self, size: Incomplete | None = None): ...
def fetchall(self): ...

class AsyncAdapt_aiomysql_ss_cursor(AsyncAdapt_aiomysql_cursor):
Expand All @@ -33,7 +33,7 @@ class AsyncAdapt_aiomysql_ss_cursor(AsyncAdapt_aiomysql_cursor):
def __init__(self, adapt_connection) -> None: ...
def close(self) -> None: ...
def fetchone(self): ...
def fetchmany(self, size: Incomplete | None = ...): ...
def fetchmany(self, size: Incomplete | None = None): ...
def fetchall(self): ...

class AsyncAdapt_aiomysql_connection(AdaptedConnection):
Expand All @@ -43,7 +43,7 @@ class AsyncAdapt_aiomysql_connection(AdaptedConnection):
def ping(self, reconnect): ...
def character_set_name(self): ...
def autocommit(self, value) -> None: ...
def cursor(self, server_side: bool = ...): ...
def cursor(self, server_side: bool = False): ...
def rollback(self) -> None: ...
def commit(self) -> None: ...
def close(self) -> None: ...
Expand Down
8 changes: 4 additions & 4 deletions stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ class AsyncAdapt_asyncmy_cursor:
@property
def lastrowid(self): ...
def close(self) -> None: ...
def execute(self, operation, parameters: Incomplete | None = ...): ...
def execute(self, operation, parameters: Incomplete | None = None): ...
def executemany(self, operation, seq_of_parameters): ...
def setinputsizes(self, *inputsizes) -> None: ...
def __iter__(self): ...
def fetchone(self): ...
def fetchmany(self, size: Incomplete | None = ...): ...
def fetchmany(self, size: Incomplete | None = None): ...
def fetchall(self): ...

class AsyncAdapt_asyncmy_ss_cursor(AsyncAdapt_asyncmy_cursor):
Expand All @@ -33,7 +33,7 @@ class AsyncAdapt_asyncmy_ss_cursor(AsyncAdapt_asyncmy_cursor):
def __init__(self, adapt_connection) -> None: ...
def close(self) -> None: ...
def fetchone(self): ...
def fetchmany(self, size: Incomplete | None = ...): ...
def fetchmany(self, size: Incomplete | None = None): ...
def fetchall(self): ...

class AsyncAdapt_asyncmy_connection(AdaptedConnection):
Expand All @@ -43,7 +43,7 @@ class AsyncAdapt_asyncmy_connection(AdaptedConnection):
def ping(self, reconnect): ...
def character_set_name(self): ...
def autocommit(self, value) -> None: ...
def cursor(self, server_side: bool = ...): ...
def cursor(self, server_side: bool = False): ...
def rollback(self) -> None: ...
def commit(self) -> None: ...
def close(self) -> None: ...
Expand Down
46 changes: 23 additions & 23 deletions stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ class MySQLCompiler(compiler.SQLCompiler):
def visit_mysql_match(self, element, **kw): ...
def visit_match_op_binary(self, binary, operator, **kw): ...
def get_from_hint_text(self, table, text): ...
def visit_typeclause(self, typeclause, type_: Incomplete | None = ..., **kw): ...
def visit_typeclause(self, typeclause, type_: Incomplete | None = None, **kw): ...
def visit_cast(self, cast, **kw): ...
def render_literal_value(self, value, type_): ...
def visit_true(self, element, **kw): ...
def visit_false(self, element, **kw): ...
def get_select_precolumns(self, select, **kw): ...
def visit_join(self, join, asfrom: bool = ..., from_linter: Incomplete | None = ..., **kwargs): ...
def visit_join(self, join, asfrom: bool = False, from_linter: Incomplete | None = None, **kwargs): ...
def for_update_clause(self, select, **kw): ...
def limit_clause(self, select, **kw): ...
def update_limit_clause(self, update_stmt): ...
Expand Down Expand Up @@ -161,7 +161,7 @@ class MySQLTypeCompiler(compiler.GenericTypeCompiler):

class MySQLIdentifierPreparer(compiler.IdentifierPreparer):
reserved_words: Any
def __init__(self, dialect, server_ansiquotes: bool = ..., **kw) -> None: ...
def __init__(self, dialect, server_ansiquotes: bool = False, **kw) -> None: ...

class MariaDBIdentifierPreparer(MySQLIdentifierPreparer):
reserved_words: Any
Expand Down Expand Up @@ -199,38 +199,38 @@ class MySQLDialect(default.DefaultDialect):
isolation_level: Any
def __init__(
self,
isolation_level: Incomplete | None = ...,
json_serializer: Incomplete | None = ...,
json_deserializer: Incomplete | None = ...,
is_mariadb: Incomplete | None = ...,
isolation_level: Incomplete | None = None,
json_serializer: Incomplete | None = None,
json_deserializer: Incomplete | None = None,
is_mariadb: Incomplete | None = None,
**kwargs,
) -> None: ...
def on_connect(self): ...
def set_isolation_level(self, connection, level) -> None: ...
def get_isolation_level(self, connection): ...
def do_begin_twophase(self, connection, xid) -> None: ...
def do_prepare_twophase(self, connection, xid) -> None: ...
def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ...
def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ...
def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ...
def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ...
def do_recover_twophase(self, connection): ...
def is_disconnect(self, e, connection, cursor): ...
def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override]
def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override]
def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw): ...
def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override]
def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None): ... # type: ignore[override]
def get_sequence_names(self, connection, schema: Incomplete | None = None, **kw): ...
identifier_preparer: Any
def initialize(self, connection) -> None: ...
def get_schema_names(self, connection, **kw): ...
def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ...
def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ...
def get_table_options(self, connection, table_name, schema: Incomplete | None = ..., **kw): ...
def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ...
def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ...
def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ...
def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ...
def get_table_comment(self, connection, table_name, schema: Incomplete | None = ..., **kw): ...
def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ...
def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ...
def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ...
def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ...
def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ...
def get_table_options(self, connection, table_name, schema: Incomplete | None = None, **kw): ...
def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ...
def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ...
def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw): ...
def get_check_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ...
def get_table_comment(self, connection, table_name, schema: Incomplete | None = None, **kw): ...
def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw): ...
def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ...
def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ...

class _DecodingRow:
rowproxy: Any
Expand Down
Loading