From c1545b78f2570a65be72b4eee0d2df363679cd32 Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 26 Jan 2023 21:47:08 -0500 Subject: [PATCH 01/19] Fix most stubtest_allowlist entries in SQLAlchemy --- .../SQLAlchemy/@tests/stubtest_allowlist.txt | 1174 +---------------- .../sqlalchemy/dialects/mssql/base.pyi | 1 - .../sqlalchemy/dialects/postgresql/base.pyi | 1 + .../sqlalchemy/engine/interfaces.pyi | 1 - stubs/SQLAlchemy/sqlalchemy/event/base.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/collections.pyi | 49 +- .../sqlalchemy/orm/strategy_options.pyi | 145 +- stubs/SQLAlchemy/sqlalchemy/sql/base.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi | 4 +- .../sqlalchemy/testing/provision.pyi | 134 +- stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi | 4 + .../sqlalchemy/util/_collections.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/util/compat.pyi | 40 +- 16 files changed, 322 insertions(+), 1245 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt index 21c09df701a7..7760c23792d6 100644 --- a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt +++ b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt @@ -1,25 +1,7 @@ -# wrong argument name in implementation ("self" instead of "cls") -sqlalchemy.engine.URL.__new__ -sqlalchemy.engine.url.URL.__new__ -sqlalchemy.util.langhelpers._symbol.__new__ - -# unnecessary re-exports -sqlalchemy.util._collections.* -sqlalchemy.util.compat.* - -# forwards arguments to another function +# Expanding keyword arguments in stubs sqlalchemy.ext.declarative.as_declarative - -# stdlib re-exports with stubtest issues -sqlalchemy.orm.collections.InstrumentedList.* -sqlalchemy.orm.collections.InstrumentedSet.* -sqlalchemy.orm.collections.MappedCollection.* -sqlalchemy.util.StringIO.* - -# method arguments starting with double underscores in the implementation -sqlalchemy.testing.resolve_lambda -sqlalchemy.testing.util.resolve_lambda -sqlalchemy.util.WeakSequence.__init__ +sqlalchemy.orm.strategy_options.loader_option.__call__ +sqlalchemy.testing.provision.register.__call__ # not always present sqlalchemy.engine.Engine.logging_name # initialized if not None @@ -27,78 +9,10 @@ sqlalchemy.engine.base.Engine.logging_name # initialized if not None sqlalchemy.sql.lambdas.PyWrapper.__clause_element__ sqlalchemy.testing.util.non_refcount_gc_collect -# replaced at runtime -sqlalchemy.orm.strategy_options.contains_eager -sqlalchemy.orm.strategy_options.load_only -sqlalchemy.orm.strategy_options.joinedload -sqlalchemy.orm.strategy_options.subqueryload -sqlalchemy.orm.strategy_options.selectinload -sqlalchemy.orm.strategy_options.lazyload -sqlalchemy.orm.strategy_options.immediateload -sqlalchemy.orm.strategy_options.noload -sqlalchemy.orm.strategy_options.raiseload -sqlalchemy.orm.strategy_options.defaultload -sqlalchemy.orm.strategy_options.defer -sqlalchemy.orm.strategy_options.undefer -sqlalchemy.orm.strategy_options.undefer_group -sqlalchemy.orm.strategy_options.with_expression -sqlalchemy.orm.strategy_options.selectin_polymorphic -sqlalchemy.testing.provision.configure_follower -sqlalchemy.testing.provision.create_db -sqlalchemy.testing.provision.drop_all_schema_objects_post_tables -sqlalchemy.testing.provision.drop_all_schema_objects_pre_tables -sqlalchemy.testing.provision.drop_db -sqlalchemy.testing.provision.follower_url_from_main -sqlalchemy.testing.provision.generate_driver_url -sqlalchemy.testing.provision.get_temp_table_name -sqlalchemy.testing.provision.post_configure_engine -sqlalchemy.testing.provision.prepare_for_drop_tables -sqlalchemy.testing.provision.run_reap_dbs -sqlalchemy.testing.provision.set_default_schema_on_connection -sqlalchemy.testing.provision.stop_test_class_outside_fixtures -sqlalchemy.testing.provision.temp_table_keyword_args -sqlalchemy.testing.provision.update_db_opts - -# KeyError/AttributeError on import due to dynamic initialization from a different module -sqlalchemy.testing.fixtures -sqlalchemy.testing.pickleable -sqlalchemy.testing.plugin.bootstrap - -# Initialized to bool during __init__() -sqlalchemy.orm.Mapper.single -sqlalchemy.orm.mapper.Mapper.single - -# Dynamically added methods where the first argument is not named "self" -sqlalchemy.orm.Load.contains_eager -sqlalchemy.orm.Load.defaultload -sqlalchemy.orm.Load.defer -sqlalchemy.orm.Load.immediateload -sqlalchemy.orm.Load.joinedload -sqlalchemy.orm.Load.lazyload -sqlalchemy.orm.Load.load_only -sqlalchemy.orm.Load.noload -sqlalchemy.orm.Load.raiseload -sqlalchemy.orm.Load.selectin_polymorphic -sqlalchemy.orm.Load.selectinload -sqlalchemy.orm.Load.subqueryload -sqlalchemy.orm.Load.undefer -sqlalchemy.orm.Load.undefer_group -sqlalchemy.orm.Load.with_expression -sqlalchemy.orm.strategy_options.Load.contains_eager -sqlalchemy.orm.strategy_options.Load.defaultload -sqlalchemy.orm.strategy_options.Load.defer -sqlalchemy.orm.strategy_options.Load.immediateload -sqlalchemy.orm.strategy_options.Load.joinedload -sqlalchemy.orm.strategy_options.Load.lazyload -sqlalchemy.orm.strategy_options.Load.load_only -sqlalchemy.orm.strategy_options.Load.noload -sqlalchemy.orm.strategy_options.Load.raiseload -sqlalchemy.orm.strategy_options.Load.selectin_polymorphic -sqlalchemy.orm.strategy_options.Load.selectinload -sqlalchemy.orm.strategy_options.Load.subqueryload -sqlalchemy.orm.strategy_options.Load.undefer -sqlalchemy.orm.strategy_options.Load.undefer_group -sqlalchemy.orm.strategy_options.Load.with_expression +# wrong argument name in implementation ("self" instead of "cls") +sqlalchemy.engine.URL.__new__ +sqlalchemy.engine.url.URL.__new__ +sqlalchemy.util.langhelpers._symbol.__new__ # abstract fields not present at runtime sqlalchemy.engine.Transaction.connection @@ -106,9 +20,11 @@ sqlalchemy.engine.Transaction.is_active sqlalchemy.engine.base.Transaction.connection sqlalchemy.engine.base.Transaction.is_active -# initialized to None during class construction, but overridden during __init__() -sqlalchemy.engine.Connection.engine +# initialized to None during class construction, but overridden during __init__() or __new__() sqlalchemy.engine.base.Connection.engine +sqlalchemy.engine.Connection.engine +sqlalchemy.orm.Mapper.single +sqlalchemy.orm.mapper.Mapper.single # uses @memoized_property at runtime, but we use @property for compatibility sqlalchemy.engine.URL.normalized_query @@ -126,1067 +42,23 @@ sqlalchemy.sql.annotation.Annotated.__new__ # as having conflicting __new__/__init__ methods sqlalchemy.orm.unitofwork.PostSortRec.__new__ -# unclear problems +# KeyError/AttributeError on import due to dynamic initialization from a different module +sqlalchemy.testing.fixtures +sqlalchemy.testing.pickleable +sqlalchemy.testing.plugin.bootstrap + +# method arguments starting with double underscores in the implementation trips up stubtest +sqlalchemy.testing.resolve_lambda +sqlalchemy.testing.util.resolve_lambda +sqlalchemy.orm.collections.MappedCollection.update + +# stubtest thinks __slots__ are always members +# https://github.com/python/mypy/issues/13906 sqlalchemy.sql.elements.quoted_name.lower sqlalchemy.sql.elements.quoted_name.upper sqlalchemy.sql.expression.quoted_name.lower sqlalchemy.sql.expression.quoted_name.upper sqlalchemy.sql.quoted_name.lower sqlalchemy.sql.quoted_name.upper -sqlalchemy.util.callable - -sqlalchemy.dialects.mssql.base.MSExecutionContext.get_result_cursor_strategy -sqlalchemy.dialects.postgresql.base.PGDDLCompiler.visit_foreign_key_constraint -sqlalchemy.engine.ExecutionContext.get_result_cursor_strategy -sqlalchemy.engine.interfaces.ExecutionContext.get_result_cursor_strategy sqlalchemy.orm.ColumnProperty.Comparator.__clause_element__ sqlalchemy.orm.properties.ColumnProperty.Comparator.__clause_element__ - -# Metaclass differs: -sqlalchemy.ARRAY -sqlalchemy.BIGINT -sqlalchemy.BINARY -sqlalchemy.BLOB -sqlalchemy.BOOLEAN -sqlalchemy.BigInteger -sqlalchemy.Boolean -sqlalchemy.CHAR -sqlalchemy.CLOB -sqlalchemy.CheckConstraint -sqlalchemy.Column -sqlalchemy.ColumnDefault -sqlalchemy.Computed -sqlalchemy.Constraint -sqlalchemy.DATE -sqlalchemy.DATETIME -sqlalchemy.DDL -sqlalchemy.DECIMAL -sqlalchemy.Date -sqlalchemy.DateTime -sqlalchemy.Enum -sqlalchemy.FLOAT -sqlalchemy.Float -sqlalchemy.ForeignKey -sqlalchemy.ForeignKeyConstraint -sqlalchemy.INTEGER -sqlalchemy.Identity -sqlalchemy.Index -sqlalchemy.Integer -sqlalchemy.Interval -sqlalchemy.JSON -sqlalchemy.JSON.JSONElementType -sqlalchemy.JSON.JSONIndexType -sqlalchemy.JSON.JSONIntIndexType -sqlalchemy.JSON.JSONPathType -sqlalchemy.JSON.JSONStrIndexType -sqlalchemy.LargeBinary -sqlalchemy.MetaData -sqlalchemy.NCHAR -sqlalchemy.NUMERIC -sqlalchemy.NVARCHAR -sqlalchemy.Numeric -sqlalchemy.PickleType -sqlalchemy.PrimaryKeyConstraint -sqlalchemy.REAL -sqlalchemy.SMALLINT -sqlalchemy.Sequence -sqlalchemy.SmallInteger -sqlalchemy.String -sqlalchemy.TEXT -sqlalchemy.TIME -sqlalchemy.TIMESTAMP -sqlalchemy.Table -sqlalchemy.Text -sqlalchemy.ThreadLocalMetaData -sqlalchemy.Time -sqlalchemy.TupleType -sqlalchemy.TypeDecorator -sqlalchemy.Unicode -sqlalchemy.UnicodeText -sqlalchemy.UniqueConstraint -sqlalchemy.VARBINARY -sqlalchemy.VARCHAR -sqlalchemy.dialects.firebird.BIGINT -sqlalchemy.dialects.firebird.BLOB -sqlalchemy.dialects.firebird.CHAR -sqlalchemy.dialects.firebird.DATE -sqlalchemy.dialects.firebird.FLOAT -sqlalchemy.dialects.firebird.NUMERIC -sqlalchemy.dialects.firebird.SMALLINT -sqlalchemy.dialects.firebird.TEXT -sqlalchemy.dialects.firebird.TIME -sqlalchemy.dialects.firebird.TIMESTAMP -sqlalchemy.dialects.firebird.VARCHAR -sqlalchemy.dialects.firebird.base.BIGINT -sqlalchemy.dialects.firebird.base.BLOB -sqlalchemy.dialects.firebird.base.CHAR -sqlalchemy.dialects.firebird.base.DATE -sqlalchemy.dialects.firebird.base.FBTypeCompiler -sqlalchemy.dialects.firebird.base.FLOAT -sqlalchemy.dialects.firebird.base.INTEGER -sqlalchemy.dialects.firebird.base.Integer -sqlalchemy.dialects.firebird.base.NUMERIC -sqlalchemy.dialects.firebird.base.SMALLINT -sqlalchemy.dialects.firebird.base.TEXT -sqlalchemy.dialects.firebird.base.TIME -sqlalchemy.dialects.firebird.base.TIMESTAMP -sqlalchemy.dialects.firebird.base.VARCHAR -sqlalchemy.dialects.firebird.base._FBDateTime -sqlalchemy.dialects.firebird.base._StringType -sqlalchemy.dialects.firebird.kinterbasdb._FBFloat_kinterbasdb -sqlalchemy.dialects.firebird.kinterbasdb._FBNumeric_kinterbasdb -sqlalchemy.dialects.mssql.BIGINT -sqlalchemy.dialects.mssql.BINARY -sqlalchemy.dialects.mssql.BIT -sqlalchemy.dialects.mssql.CHAR -sqlalchemy.dialects.mssql.DATE -sqlalchemy.dialects.mssql.DATETIME -sqlalchemy.dialects.mssql.DATETIME2 -sqlalchemy.dialects.mssql.DATETIMEOFFSET -sqlalchemy.dialects.mssql.DECIMAL -sqlalchemy.dialects.mssql.FLOAT -sqlalchemy.dialects.mssql.IMAGE -sqlalchemy.dialects.mssql.INTEGER -sqlalchemy.dialects.mssql.JSON -sqlalchemy.dialects.mssql.MONEY -sqlalchemy.dialects.mssql.NCHAR -sqlalchemy.dialects.mssql.NTEXT -sqlalchemy.dialects.mssql.NUMERIC -sqlalchemy.dialects.mssql.NVARCHAR -sqlalchemy.dialects.mssql.REAL -sqlalchemy.dialects.mssql.ROWVERSION -sqlalchemy.dialects.mssql.SMALLDATETIME -sqlalchemy.dialects.mssql.SMALLINT -sqlalchemy.dialects.mssql.SMALLMONEY -sqlalchemy.dialects.mssql.SQL_VARIANT -sqlalchemy.dialects.mssql.TEXT -sqlalchemy.dialects.mssql.TIME -sqlalchemy.dialects.mssql.TIMESTAMP -sqlalchemy.dialects.mssql.TINYINT -sqlalchemy.dialects.mssql.UNIQUEIDENTIFIER -sqlalchemy.dialects.mssql.VARBINARY -sqlalchemy.dialects.mssql.VARCHAR -sqlalchemy.dialects.mssql.XML -sqlalchemy.dialects.mssql.base.BIGINT -sqlalchemy.dialects.mssql.base.BINARY -sqlalchemy.dialects.mssql.base.BIT -sqlalchemy.dialects.mssql.base.CHAR -sqlalchemy.dialects.mssql.base.DATE -sqlalchemy.dialects.mssql.base.DATETIME -sqlalchemy.dialects.mssql.base.DATETIME2 -sqlalchemy.dialects.mssql.base.DATETIMEOFFSET -sqlalchemy.dialects.mssql.base.DECIMAL -sqlalchemy.dialects.mssql.base.FLOAT -sqlalchemy.dialects.mssql.base.IMAGE -sqlalchemy.dialects.mssql.base.INTEGER -sqlalchemy.dialects.mssql.base.JSON -sqlalchemy.dialects.mssql.base.MONEY -sqlalchemy.dialects.mssql.base.MSTypeCompiler -sqlalchemy.dialects.mssql.base.NCHAR -sqlalchemy.dialects.mssql.base.NTEXT -sqlalchemy.dialects.mssql.base.NUMERIC -sqlalchemy.dialects.mssql.base.NVARCHAR -sqlalchemy.dialects.mssql.base.REAL -sqlalchemy.dialects.mssql.base.ROWVERSION -sqlalchemy.dialects.mssql.base.SMALLDATETIME -sqlalchemy.dialects.mssql.base.SMALLINT -sqlalchemy.dialects.mssql.base.SMALLMONEY -sqlalchemy.dialects.mssql.base.SQL_VARIANT -sqlalchemy.dialects.mssql.base.TEXT -sqlalchemy.dialects.mssql.base.TIME -sqlalchemy.dialects.mssql.base.TIMESTAMP -sqlalchemy.dialects.mssql.base.TINYINT -sqlalchemy.dialects.mssql.base.TryCast -sqlalchemy.dialects.mssql.base.UNIQUEIDENTIFIER -sqlalchemy.dialects.mssql.base.VARBINARY -sqlalchemy.dialects.mssql.base.VARCHAR -sqlalchemy.dialects.mssql.base.XML -sqlalchemy.dialects.mssql.base._BASETIMEIMPL -sqlalchemy.dialects.mssql.base._MSDate -sqlalchemy.dialects.mssql.base._MSDateTime -sqlalchemy.dialects.mssql.base._MSUnicode -sqlalchemy.dialects.mssql.base._MSUnicodeText -sqlalchemy.dialects.mssql.information_schema.CoerceUnicode -sqlalchemy.dialects.mssql.information_schema.IdentitySqlVariant -sqlalchemy.dialects.mssql.information_schema._cast_on_2005 -sqlalchemy.dialects.mssql.json.JSON -sqlalchemy.dialects.mssql.json.JSONIndexType -sqlalchemy.dialects.mssql.json.JSONPathType -sqlalchemy.dialects.mssql.mxodbc._MSDate_mxodbc -sqlalchemy.dialects.mssql.mxodbc._MSNumeric_mxodbc -sqlalchemy.dialects.mssql.mxodbc._MSTime_mxodbc -sqlalchemy.dialects.mssql.mxodbc._VARBINARY_mxodbc -sqlalchemy.dialects.mssql.pymssql._MSNumeric_pymssql -sqlalchemy.dialects.mssql.pyodbc._BINARY_pyodbc -sqlalchemy.dialects.mssql.pyodbc._MSFloat_pyodbc -sqlalchemy.dialects.mssql.pyodbc._MSNumeric_pyodbc -sqlalchemy.dialects.mssql.pyodbc._ODBCDATETIMEOFFSET -sqlalchemy.dialects.mssql.pyodbc._ODBCDateTime -sqlalchemy.dialects.mssql.pyodbc._VARBINARY_pyodbc -sqlalchemy.dialects.mysql.BIGINT -sqlalchemy.dialects.mysql.BINARY -sqlalchemy.dialects.mysql.BIT -sqlalchemy.dialects.mysql.BLOB -sqlalchemy.dialects.mysql.BOOLEAN -sqlalchemy.dialects.mysql.CHAR -sqlalchemy.dialects.mysql.DATE -sqlalchemy.dialects.mysql.DATETIME -sqlalchemy.dialects.mysql.DECIMAL -sqlalchemy.dialects.mysql.DOUBLE -sqlalchemy.dialects.mysql.ENUM -sqlalchemy.dialects.mysql.FLOAT -sqlalchemy.dialects.mysql.INTEGER -sqlalchemy.dialects.mysql.Insert -sqlalchemy.dialects.mysql.JSON -sqlalchemy.dialects.mysql.LONGBLOB -sqlalchemy.dialects.mysql.LONGTEXT -sqlalchemy.dialects.mysql.MEDIUMBLOB -sqlalchemy.dialects.mysql.MEDIUMINT -sqlalchemy.dialects.mysql.MEDIUMTEXT -sqlalchemy.dialects.mysql.NCHAR -sqlalchemy.dialects.mysql.NUMERIC -sqlalchemy.dialects.mysql.NVARCHAR -sqlalchemy.dialects.mysql.REAL -sqlalchemy.dialects.mysql.SET -sqlalchemy.dialects.mysql.SMALLINT -sqlalchemy.dialects.mysql.TEXT -sqlalchemy.dialects.mysql.TIME -sqlalchemy.dialects.mysql.TIMESTAMP -sqlalchemy.dialects.mysql.TINYBLOB -sqlalchemy.dialects.mysql.TINYINT -sqlalchemy.dialects.mysql.TINYTEXT -sqlalchemy.dialects.mysql.VARBINARY -sqlalchemy.dialects.mysql.VARCHAR -sqlalchemy.dialects.mysql.YEAR -sqlalchemy.dialects.mysql.base.BIGINT -sqlalchemy.dialects.mysql.base.BINARY -sqlalchemy.dialects.mysql.base.BIT -sqlalchemy.dialects.mysql.base.BLOB -sqlalchemy.dialects.mysql.base.BOOLEAN -sqlalchemy.dialects.mysql.base.CHAR -sqlalchemy.dialects.mysql.base.DATE -sqlalchemy.dialects.mysql.base.DATETIME -sqlalchemy.dialects.mysql.base.DECIMAL -sqlalchemy.dialects.mysql.base.DOUBLE -sqlalchemy.dialects.mysql.base.ENUM -sqlalchemy.dialects.mysql.base.FLOAT -sqlalchemy.dialects.mysql.base.INTEGER -sqlalchemy.dialects.mysql.base.JSON -sqlalchemy.dialects.mysql.base.LONGBLOB -sqlalchemy.dialects.mysql.base.LONGTEXT -sqlalchemy.dialects.mysql.base.MEDIUMBLOB -sqlalchemy.dialects.mysql.base.MEDIUMINT -sqlalchemy.dialects.mysql.base.MEDIUMTEXT -sqlalchemy.dialects.mysql.base.MySQLTypeCompiler -sqlalchemy.dialects.mysql.base.NCHAR -sqlalchemy.dialects.mysql.base.NUMERIC -sqlalchemy.dialects.mysql.base.NVARCHAR -sqlalchemy.dialects.mysql.base.REAL -sqlalchemy.dialects.mysql.base.SET -sqlalchemy.dialects.mysql.base.SMALLINT -sqlalchemy.dialects.mysql.base.TEXT -sqlalchemy.dialects.mysql.base.TIME -sqlalchemy.dialects.mysql.base.TIMESTAMP -sqlalchemy.dialects.mysql.base.TINYBLOB -sqlalchemy.dialects.mysql.base.TINYINT -sqlalchemy.dialects.mysql.base.TINYTEXT -sqlalchemy.dialects.mysql.base.VARBINARY -sqlalchemy.dialects.mysql.base.VARCHAR -sqlalchemy.dialects.mysql.base.YEAR -sqlalchemy.dialects.mysql.cymysql._cymysqlBIT -sqlalchemy.dialects.mysql.dml.Insert -sqlalchemy.dialects.mysql.dml.OnDuplicateClause -sqlalchemy.dialects.mysql.enumerated.ENUM -sqlalchemy.dialects.mysql.enumerated.SET -sqlalchemy.dialects.mysql.expression.match -sqlalchemy.dialects.mysql.json.JSON -sqlalchemy.dialects.mysql.json.JSONIndexType -sqlalchemy.dialects.mysql.json.JSONPathType -sqlalchemy.dialects.mysql.match -sqlalchemy.dialects.mysql.mysqlconnector._myconnpyBIT -sqlalchemy.dialects.mysql.oursql._oursqlBIT -sqlalchemy.dialects.mysql.pyodbc._pyodbcTIME -sqlalchemy.dialects.mysql.types.BIGINT -sqlalchemy.dialects.mysql.types.BIT -sqlalchemy.dialects.mysql.types.CHAR -sqlalchemy.dialects.mysql.types.DATETIME -sqlalchemy.dialects.mysql.types.DECIMAL -sqlalchemy.dialects.mysql.types.DOUBLE -sqlalchemy.dialects.mysql.types.FLOAT -sqlalchemy.dialects.mysql.types.INTEGER -sqlalchemy.dialects.mysql.types.LONGBLOB -sqlalchemy.dialects.mysql.types.LONGTEXT -sqlalchemy.dialects.mysql.types.MEDIUMBLOB -sqlalchemy.dialects.mysql.types.MEDIUMINT -sqlalchemy.dialects.mysql.types.MEDIUMTEXT -sqlalchemy.dialects.mysql.types.NCHAR -sqlalchemy.dialects.mysql.types.NUMERIC -sqlalchemy.dialects.mysql.types.NVARCHAR -sqlalchemy.dialects.mysql.types.REAL -sqlalchemy.dialects.mysql.types.SMALLINT -sqlalchemy.dialects.mysql.types.TEXT -sqlalchemy.dialects.mysql.types.TIME -sqlalchemy.dialects.mysql.types.TIMESTAMP -sqlalchemy.dialects.mysql.types.TINYBLOB -sqlalchemy.dialects.mysql.types.TINYINT -sqlalchemy.dialects.mysql.types.TINYTEXT -sqlalchemy.dialects.mysql.types.VARCHAR -sqlalchemy.dialects.mysql.types.YEAR -sqlalchemy.dialects.mysql.types._FloatType -sqlalchemy.dialects.mysql.types._IntegerType -sqlalchemy.dialects.mysql.types._MatchType -sqlalchemy.dialects.mysql.types._StringType -sqlalchemy.dialects.oracle.BFILE -sqlalchemy.dialects.oracle.BINARY_DOUBLE -sqlalchemy.dialects.oracle.BINARY_FLOAT -sqlalchemy.dialects.oracle.BLOB -sqlalchemy.dialects.oracle.CHAR -sqlalchemy.dialects.oracle.CLOB -sqlalchemy.dialects.oracle.DATE -sqlalchemy.dialects.oracle.DOUBLE_PRECISION -sqlalchemy.dialects.oracle.FLOAT -sqlalchemy.dialects.oracle.INTERVAL -sqlalchemy.dialects.oracle.LONG -sqlalchemy.dialects.oracle.NCHAR -sqlalchemy.dialects.oracle.NCLOB -sqlalchemy.dialects.oracle.NUMBER -sqlalchemy.dialects.oracle.NVARCHAR -sqlalchemy.dialects.oracle.RAW -sqlalchemy.dialects.oracle.ROWID -sqlalchemy.dialects.oracle.TIMESTAMP -sqlalchemy.dialects.oracle.VARCHAR -sqlalchemy.dialects.oracle.VARCHAR2 -sqlalchemy.dialects.oracle.base.BFILE -sqlalchemy.dialects.oracle.base.BINARY_DOUBLE -sqlalchemy.dialects.oracle.base.BINARY_FLOAT -sqlalchemy.dialects.oracle.base.BLOB -sqlalchemy.dialects.oracle.base.CHAR -sqlalchemy.dialects.oracle.base.CLOB -sqlalchemy.dialects.oracle.base.DATE -sqlalchemy.dialects.oracle.base.DOUBLE_PRECISION -sqlalchemy.dialects.oracle.base.FLOAT -sqlalchemy.dialects.oracle.base.INTEGER -sqlalchemy.dialects.oracle.base.INTERVAL -sqlalchemy.dialects.oracle.base.LONG -sqlalchemy.dialects.oracle.base.NCHAR -sqlalchemy.dialects.oracle.base.NCLOB -sqlalchemy.dialects.oracle.base.NUMBER -sqlalchemy.dialects.oracle.base.NVARCHAR -sqlalchemy.dialects.oracle.base.OracleTypeCompiler -sqlalchemy.dialects.oracle.base.RAW -sqlalchemy.dialects.oracle.base.ROWID -sqlalchemy.dialects.oracle.base.TIMESTAMP -sqlalchemy.dialects.oracle.base.VARCHAR -sqlalchemy.dialects.oracle.base.VARCHAR2 -sqlalchemy.dialects.oracle.base._OracleBoolean -sqlalchemy.dialects.oracle.base._OuterJoinColumn -sqlalchemy.dialects.oracle.cx_oracle._OracleBINARY_DOUBLE -sqlalchemy.dialects.oracle.cx_oracle._OracleBINARY_FLOAT -sqlalchemy.dialects.oracle.cx_oracle._OracleBinary -sqlalchemy.dialects.oracle.cx_oracle._OracleBinaryFloat -sqlalchemy.dialects.oracle.cx_oracle._OracleChar -sqlalchemy.dialects.oracle.cx_oracle._OracleDate -sqlalchemy.dialects.oracle.cx_oracle._OracleEnum -sqlalchemy.dialects.oracle.cx_oracle._OracleInteger -sqlalchemy.dialects.oracle.cx_oracle._OracleInterval -sqlalchemy.dialects.oracle.cx_oracle._OracleLong -sqlalchemy.dialects.oracle.cx_oracle._OracleNChar -sqlalchemy.dialects.oracle.cx_oracle._OracleNUMBER -sqlalchemy.dialects.oracle.cx_oracle._OracleNumeric -sqlalchemy.dialects.oracle.cx_oracle._OracleRaw -sqlalchemy.dialects.oracle.cx_oracle._OracleRowid -sqlalchemy.dialects.oracle.cx_oracle._OracleString -sqlalchemy.dialects.oracle.cx_oracle._OracleText -sqlalchemy.dialects.oracle.cx_oracle._OracleUnicodeStringCHAR -sqlalchemy.dialects.oracle.cx_oracle._OracleUnicodeStringNCHAR -sqlalchemy.dialects.oracle.cx_oracle._OracleUnicodeTextCLOB -sqlalchemy.dialects.oracle.cx_oracle._OracleUnicodeTextNCLOB -sqlalchemy.dialects.postgresql.ARRAY -sqlalchemy.dialects.postgresql.BIGINT -sqlalchemy.dialects.postgresql.BIT -sqlalchemy.dialects.postgresql.BOOLEAN -sqlalchemy.dialects.postgresql.BYTEA -sqlalchemy.dialects.postgresql.CHAR -sqlalchemy.dialects.postgresql.CIDR -sqlalchemy.dialects.postgresql.CreateEnumType -sqlalchemy.dialects.postgresql.DATE -sqlalchemy.dialects.postgresql.DATERANGE -sqlalchemy.dialects.postgresql.DOUBLE_PRECISION -sqlalchemy.dialects.postgresql.DropEnumType -sqlalchemy.dialects.postgresql.ENUM -sqlalchemy.dialects.postgresql.ExcludeConstraint -sqlalchemy.dialects.postgresql.FLOAT -sqlalchemy.dialects.postgresql.HSTORE -sqlalchemy.dialects.postgresql.INET -sqlalchemy.dialects.postgresql.INT4RANGE -sqlalchemy.dialects.postgresql.INT8RANGE -sqlalchemy.dialects.postgresql.INTEGER -sqlalchemy.dialects.postgresql.INTERVAL -sqlalchemy.dialects.postgresql.Insert -sqlalchemy.dialects.postgresql.JSON -sqlalchemy.dialects.postgresql.JSONB -sqlalchemy.dialects.postgresql.MACADDR -sqlalchemy.dialects.postgresql.MACADDR8 -sqlalchemy.dialects.postgresql.MONEY -sqlalchemy.dialects.postgresql.NUMERIC -sqlalchemy.dialects.postgresql.NUMRANGE -sqlalchemy.dialects.postgresql.OID -sqlalchemy.dialects.postgresql.REAL -sqlalchemy.dialects.postgresql.REGCLASS -sqlalchemy.dialects.postgresql.SMALLINT -sqlalchemy.dialects.postgresql.TEXT -sqlalchemy.dialects.postgresql.TIME -sqlalchemy.dialects.postgresql.TIMESTAMP -sqlalchemy.dialects.postgresql.TSRANGE -sqlalchemy.dialects.postgresql.TSTZRANGE -sqlalchemy.dialects.postgresql.TSVECTOR -sqlalchemy.dialects.postgresql.UUID -sqlalchemy.dialects.postgresql.VARCHAR -sqlalchemy.dialects.postgresql.aggregate_order_by -sqlalchemy.dialects.postgresql.array -sqlalchemy.dialects.postgresql.array.ARRAY -sqlalchemy.dialects.postgresql.array.array -sqlalchemy.dialects.postgresql.asyncpg.AsyncPgEnum -sqlalchemy.dialects.postgresql.asyncpg.AsyncPgInterval -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgBigInteger -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgBoolean -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgDate -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgDateTime -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgFloat -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgInteger -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSON -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONB -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONIndexType -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONIntIndexType -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONPathType -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONStrIndexType -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgNumeric -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgOID -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgREGCLASS -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgTime -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgUUID -sqlalchemy.dialects.postgresql.base.BIGINT -sqlalchemy.dialects.postgresql.base.BIT -sqlalchemy.dialects.postgresql.base.BOOLEAN -sqlalchemy.dialects.postgresql.base.BYTEA -sqlalchemy.dialects.postgresql.base.CHAR -sqlalchemy.dialects.postgresql.base.CIDR -sqlalchemy.dialects.postgresql.base.CreateEnumType -sqlalchemy.dialects.postgresql.base.DATE -sqlalchemy.dialects.postgresql.base.DOUBLE_PRECISION -sqlalchemy.dialects.postgresql.base.DropEnumType -sqlalchemy.dialects.postgresql.base.ENUM -sqlalchemy.dialects.postgresql.base.FLOAT -sqlalchemy.dialects.postgresql.base.INET -sqlalchemy.dialects.postgresql.base.INTEGER -sqlalchemy.dialects.postgresql.base.INTERVAL -sqlalchemy.dialects.postgresql.base.MACADDR -sqlalchemy.dialects.postgresql.base.MACADDR8 -sqlalchemy.dialects.postgresql.base.MONEY -sqlalchemy.dialects.postgresql.base.NUMERIC -sqlalchemy.dialects.postgresql.base.OID -sqlalchemy.dialects.postgresql.base.PGTypeCompiler -sqlalchemy.dialects.postgresql.base.REAL -sqlalchemy.dialects.postgresql.base.REGCLASS -sqlalchemy.dialects.postgresql.base.SMALLINT -sqlalchemy.dialects.postgresql.base.TEXT -sqlalchemy.dialects.postgresql.base.TIME -sqlalchemy.dialects.postgresql.base.TIMESTAMP -sqlalchemy.dialects.postgresql.base.TSVECTOR -sqlalchemy.dialects.postgresql.base.UUID -sqlalchemy.dialects.postgresql.base.VARCHAR -sqlalchemy.dialects.postgresql.base._ColonCast -sqlalchemy.dialects.postgresql.dml.Insert -sqlalchemy.dialects.postgresql.dml.OnConflictClause -sqlalchemy.dialects.postgresql.dml.OnConflictDoNothing -sqlalchemy.dialects.postgresql.dml.OnConflictDoUpdate -sqlalchemy.dialects.postgresql.ext.ExcludeConstraint -sqlalchemy.dialects.postgresql.ext.aggregate_order_by -sqlalchemy.dialects.postgresql.hstore -sqlalchemy.dialects.postgresql.hstore.HSTORE -sqlalchemy.dialects.postgresql.hstore._HStoreArrayFunction -sqlalchemy.dialects.postgresql.hstore._HStoreDefinedFunction -sqlalchemy.dialects.postgresql.hstore._HStoreDeleteFunction -sqlalchemy.dialects.postgresql.hstore._HStoreKeysFunction -sqlalchemy.dialects.postgresql.hstore._HStoreMatrixFunction -sqlalchemy.dialects.postgresql.hstore._HStoreSliceFunction -sqlalchemy.dialects.postgresql.hstore._HStoreValsFunction -sqlalchemy.dialects.postgresql.hstore.hstore -sqlalchemy.dialects.postgresql.json.JSON -sqlalchemy.dialects.postgresql.json.JSONB -sqlalchemy.dialects.postgresql.json.JSONPathType -sqlalchemy.dialects.postgresql.pg8000._PGARRAY -sqlalchemy.dialects.postgresql.pg8000._PGBigInteger -sqlalchemy.dialects.postgresql.pg8000._PGBoolean -sqlalchemy.dialects.postgresql.pg8000._PGEnum -sqlalchemy.dialects.postgresql.pg8000._PGInteger -sqlalchemy.dialects.postgresql.pg8000._PGInterval -sqlalchemy.dialects.postgresql.pg8000._PGJSON -sqlalchemy.dialects.postgresql.pg8000._PGJSONB -sqlalchemy.dialects.postgresql.pg8000._PGJSONIndexType -sqlalchemy.dialects.postgresql.pg8000._PGJSONIntIndexType -sqlalchemy.dialects.postgresql.pg8000._PGJSONPathType -sqlalchemy.dialects.postgresql.pg8000._PGJSONStrIndexType -sqlalchemy.dialects.postgresql.pg8000._PGNullType -sqlalchemy.dialects.postgresql.pg8000._PGNumeric -sqlalchemy.dialects.postgresql.pg8000._PGNumericNoBind -sqlalchemy.dialects.postgresql.pg8000._PGSmallInteger -sqlalchemy.dialects.postgresql.pg8000._PGTime -sqlalchemy.dialects.postgresql.pg8000._PGTimeStamp -sqlalchemy.dialects.postgresql.pg8000._PGUUID -sqlalchemy.dialects.postgresql.psycopg2._PGARRAY -sqlalchemy.dialects.postgresql.psycopg2._PGEnum -sqlalchemy.dialects.postgresql.psycopg2._PGHStore -sqlalchemy.dialects.postgresql.psycopg2._PGJSON -sqlalchemy.dialects.postgresql.psycopg2._PGJSONB -sqlalchemy.dialects.postgresql.psycopg2._PGNumeric -sqlalchemy.dialects.postgresql.psycopg2._PGUUID -sqlalchemy.dialects.postgresql.pygresql._PGHStore -sqlalchemy.dialects.postgresql.pygresql._PGJSON -sqlalchemy.dialects.postgresql.pygresql._PGJSONB -sqlalchemy.dialects.postgresql.pygresql._PGNumeric -sqlalchemy.dialects.postgresql.pygresql._PGUUID -sqlalchemy.dialects.postgresql.pypostgresql.PGNumeric -sqlalchemy.dialects.postgresql.ranges.DATERANGE -sqlalchemy.dialects.postgresql.ranges.INT4RANGE -sqlalchemy.dialects.postgresql.ranges.INT8RANGE -sqlalchemy.dialects.postgresql.ranges.NUMRANGE -sqlalchemy.dialects.postgresql.ranges.TSRANGE -sqlalchemy.dialects.postgresql.ranges.TSTZRANGE -sqlalchemy.dialects.sqlite.BLOB -sqlalchemy.dialects.sqlite.BOOLEAN -sqlalchemy.dialects.sqlite.CHAR -sqlalchemy.dialects.sqlite.DATE -sqlalchemy.dialects.sqlite.DATETIME -sqlalchemy.dialects.sqlite.DECIMAL -sqlalchemy.dialects.sqlite.FLOAT -sqlalchemy.dialects.sqlite.INTEGER -sqlalchemy.dialects.sqlite.Insert -sqlalchemy.dialects.sqlite.JSON -sqlalchemy.dialects.sqlite.NUMERIC -sqlalchemy.dialects.sqlite.REAL -sqlalchemy.dialects.sqlite.SMALLINT -sqlalchemy.dialects.sqlite.TEXT -sqlalchemy.dialects.sqlite.TIME -sqlalchemy.dialects.sqlite.TIMESTAMP -sqlalchemy.dialects.sqlite.VARCHAR -sqlalchemy.dialects.sqlite.base.BLOB -sqlalchemy.dialects.sqlite.base.BOOLEAN -sqlalchemy.dialects.sqlite.base.CHAR -sqlalchemy.dialects.sqlite.base.DATE -sqlalchemy.dialects.sqlite.base.DATETIME -sqlalchemy.dialects.sqlite.base.DECIMAL -sqlalchemy.dialects.sqlite.base.FLOAT -sqlalchemy.dialects.sqlite.base.INTEGER -sqlalchemy.dialects.sqlite.base.JSON -sqlalchemy.dialects.sqlite.base.NUMERIC -sqlalchemy.dialects.sqlite.base.REAL -sqlalchemy.dialects.sqlite.base.SMALLINT -sqlalchemy.dialects.sqlite.base.SQLiteTypeCompiler -sqlalchemy.dialects.sqlite.base.TEXT -sqlalchemy.dialects.sqlite.base.TIME -sqlalchemy.dialects.sqlite.base.TIMESTAMP -sqlalchemy.dialects.sqlite.base.VARCHAR -sqlalchemy.dialects.sqlite.base._SQliteJson -sqlalchemy.dialects.sqlite.dml.Insert -sqlalchemy.dialects.sqlite.dml.OnConflictClause -sqlalchemy.dialects.sqlite.dml.OnConflictDoNothing -sqlalchemy.dialects.sqlite.dml.OnConflictDoUpdate -sqlalchemy.dialects.sqlite.json.JSON -sqlalchemy.dialects.sqlite.json.JSONIndexType -sqlalchemy.dialects.sqlite.json.JSONPathType -sqlalchemy.dialects.sqlite.pysqlite._SQLite_pysqliteDate -sqlalchemy.dialects.sqlite.pysqlite._SQLite_pysqliteTimeStamp -sqlalchemy.dialects.sybase.BIGINT -sqlalchemy.dialects.sybase.BINARY -sqlalchemy.dialects.sybase.BIT -sqlalchemy.dialects.sybase.CHAR -sqlalchemy.dialects.sybase.DATE -sqlalchemy.dialects.sybase.DATETIME -sqlalchemy.dialects.sybase.FLOAT -sqlalchemy.dialects.sybase.IMAGE -sqlalchemy.dialects.sybase.INTEGER -sqlalchemy.dialects.sybase.MONEY -sqlalchemy.dialects.sybase.NCHAR -sqlalchemy.dialects.sybase.NUMERIC -sqlalchemy.dialects.sybase.NVARCHAR -sqlalchemy.dialects.sybase.SMALLINT -sqlalchemy.dialects.sybase.SMALLMONEY -sqlalchemy.dialects.sybase.TEXT -sqlalchemy.dialects.sybase.TIME -sqlalchemy.dialects.sybase.TINYINT -sqlalchemy.dialects.sybase.UNICHAR -sqlalchemy.dialects.sybase.UNITEXT -sqlalchemy.dialects.sybase.UNIVARCHAR -sqlalchemy.dialects.sybase.VARBINARY -sqlalchemy.dialects.sybase.VARCHAR -sqlalchemy.dialects.sybase.base.BIGINT -sqlalchemy.dialects.sybase.base.BINARY -sqlalchemy.dialects.sybase.base.BIT -sqlalchemy.dialects.sybase.base.CHAR -sqlalchemy.dialects.sybase.base.DATE -sqlalchemy.dialects.sybase.base.DATETIME -sqlalchemy.dialects.sybase.base.DECIMAL -sqlalchemy.dialects.sybase.base.FLOAT -sqlalchemy.dialects.sybase.base.IMAGE -sqlalchemy.dialects.sybase.base.INTEGER -sqlalchemy.dialects.sybase.base.MONEY -sqlalchemy.dialects.sybase.base.NCHAR -sqlalchemy.dialects.sybase.base.NUMERIC -sqlalchemy.dialects.sybase.base.NVARCHAR -sqlalchemy.dialects.sybase.base.REAL -sqlalchemy.dialects.sybase.base.SMALLINT -sqlalchemy.dialects.sybase.base.SMALLMONEY -sqlalchemy.dialects.sybase.base.SybaseTypeCompiler -sqlalchemy.dialects.sybase.base.TEXT -sqlalchemy.dialects.sybase.base.TIME -sqlalchemy.dialects.sybase.base.TIMESTAMP -sqlalchemy.dialects.sybase.base.TINYINT -sqlalchemy.dialects.sybase.base.UNICHAR -sqlalchemy.dialects.sybase.base.UNIQUEIDENTIFIER -sqlalchemy.dialects.sybase.base.UNITEXT -sqlalchemy.dialects.sybase.base.UNIVARCHAR -sqlalchemy.dialects.sybase.base.Unicode -sqlalchemy.dialects.sybase.base.VARBINARY -sqlalchemy.dialects.sybase.base.VARCHAR -sqlalchemy.dialects.sybase.pyodbc._SybNumeric_pyodbc -sqlalchemy.dialects.sybase.pysybase._SybNumeric -sqlalchemy.engine.TypeCompiler -sqlalchemy.engine.default._StrDate -sqlalchemy.engine.default._StrDateTime -sqlalchemy.engine.default._StrTime -sqlalchemy.engine.events.ConnectionEvents -sqlalchemy.engine.events.DialectEvents -sqlalchemy.engine.interfaces.TypeCompiler -sqlalchemy.event.Events -sqlalchemy.event.base.Events -sqlalchemy.events.ConnectionEvents -sqlalchemy.events.DDLEvents -sqlalchemy.events.DialectEvents -sqlalchemy.events.PoolEvents -sqlalchemy.ext.asyncio.AsyncConnectionEvents -sqlalchemy.ext.asyncio.AsyncSessionEvents -sqlalchemy.ext.asyncio.events.AsyncConnectionEvents -sqlalchemy.ext.asyncio.events.AsyncSessionEvents -sqlalchemy.orm.AttributeEvents -sqlalchemy.orm.FromStatement -sqlalchemy.orm.InstanceEvents -sqlalchemy.orm.InstrumentationEvents -sqlalchemy.orm.MapperEvents -sqlalchemy.orm.QueryContext.default_load_options -sqlalchemy.orm.QueryEvents -sqlalchemy.orm.SessionEvents -sqlalchemy.orm.context.ORMCompileState.default_compile_options -sqlalchemy.orm.context.QueryContext.default_load_options -sqlalchemy.orm.events.AttributeEvents -sqlalchemy.orm.events.InstanceEvents -sqlalchemy.orm.events.InstrumentationEvents -sqlalchemy.orm.events.MapperEvents -sqlalchemy.orm.events.QueryEvents -sqlalchemy.orm.events.SessionEvents -sqlalchemy.orm.events._InstanceEventsHold.HoldInstanceEvents -sqlalchemy.orm.events._MapperEventsHold.HoldMapperEvents -sqlalchemy.orm.persistence.BulkUDCompileState.default_update_options -sqlalchemy.orm.query.FromStatement -sqlalchemy.orm.query.QueryContext.default_load_options -sqlalchemy.orm.util._ORMJoin -sqlalchemy.pool.events.PoolEvents -sqlalchemy.schema.AddConstraint -sqlalchemy.schema.CheckConstraint -sqlalchemy.schema.Column -sqlalchemy.schema.ColumnCollectionConstraint -sqlalchemy.schema.ColumnDefault -sqlalchemy.schema.Computed -sqlalchemy.schema.Constraint -sqlalchemy.schema.CreateColumn -sqlalchemy.schema.CreateIndex -sqlalchemy.schema.CreateSchema -sqlalchemy.schema.CreateSequence -sqlalchemy.schema.CreateTable -sqlalchemy.schema.DDL -sqlalchemy.schema.DDLElement -sqlalchemy.schema.DefaultGenerator -sqlalchemy.schema.DropColumnComment -sqlalchemy.schema.DropConstraint -sqlalchemy.schema.DropIndex -sqlalchemy.schema.DropSchema -sqlalchemy.schema.DropSequence -sqlalchemy.schema.DropTable -sqlalchemy.schema.DropTableComment -sqlalchemy.schema.ForeignKey -sqlalchemy.schema.ForeignKeyConstraint -sqlalchemy.schema.Identity -sqlalchemy.schema.Index -sqlalchemy.schema.MetaData -sqlalchemy.schema.PrimaryKeyConstraint -sqlalchemy.schema.SchemaItem -sqlalchemy.schema.Sequence -sqlalchemy.schema.SetColumnComment -sqlalchemy.schema.SetTableComment -sqlalchemy.schema.Table -sqlalchemy.schema.ThreadLocalMetaData -sqlalchemy.schema.UniqueConstraint -sqlalchemy.schema._CreateDropBase -sqlalchemy.schema._DDLCompiles -sqlalchemy.schema._DropView -sqlalchemy.sql.Alias -sqlalchemy.sql.ClauseElement -sqlalchemy.sql.ColumnElement -sqlalchemy.sql.CompoundSelect -sqlalchemy.sql.Delete -sqlalchemy.sql.False_ -sqlalchemy.sql.FromClause -sqlalchemy.sql.Insert -sqlalchemy.sql.Join -sqlalchemy.sql.LambdaElement -sqlalchemy.sql.Select -sqlalchemy.sql.Selectable -sqlalchemy.sql.StatementLambdaElement -sqlalchemy.sql.Subquery -sqlalchemy.sql.TableClause -sqlalchemy.sql.TableSample -sqlalchemy.sql.True_ -sqlalchemy.sql.Update -sqlalchemy.sql.Values -sqlalchemy.sql.base.CacheableOptions -sqlalchemy.sql.base.Options -sqlalchemy.sql.compiler.GenericTypeCompiler -sqlalchemy.sql.compiler.StrSQLTypeCompiler -sqlalchemy.sql.compiler.TypeCompiler -sqlalchemy.sql.compiler._CompileLabel -sqlalchemy.sql.crud._multiparam_column -sqlalchemy.sql.ddl.AddConstraint -sqlalchemy.sql.ddl.CreateColumn -sqlalchemy.sql.ddl.CreateIndex -sqlalchemy.sql.ddl.CreateSchema -sqlalchemy.sql.ddl.CreateSequence -sqlalchemy.sql.ddl.CreateTable -sqlalchemy.sql.ddl.DDL -sqlalchemy.sql.ddl.DDLElement -sqlalchemy.sql.ddl.DropColumnComment -sqlalchemy.sql.ddl.DropConstraint -sqlalchemy.sql.ddl.DropIndex -sqlalchemy.sql.ddl.DropSchema -sqlalchemy.sql.ddl.DropSequence -sqlalchemy.sql.ddl.DropTable -sqlalchemy.sql.ddl.DropTableComment -sqlalchemy.sql.ddl.SetColumnComment -sqlalchemy.sql.ddl.SetTableComment -sqlalchemy.sql.ddl._CreateDropBase -sqlalchemy.sql.ddl._DDLCompiles -sqlalchemy.sql.ddl._DropView -sqlalchemy.sql.dml.Delete -sqlalchemy.sql.dml.Insert -sqlalchemy.sql.dml.Update -sqlalchemy.sql.dml.UpdateBase -sqlalchemy.sql.dml.ValuesBase -sqlalchemy.sql.elements.AsBoolean -sqlalchemy.sql.elements.BinaryExpression -sqlalchemy.sql.elements.BindParameter -sqlalchemy.sql.elements.BooleanClauseList -sqlalchemy.sql.elements.Case -sqlalchemy.sql.elements.Cast -sqlalchemy.sql.elements.ClauseElement -sqlalchemy.sql.elements.ClauseList -sqlalchemy.sql.elements.CollationClause -sqlalchemy.sql.elements.CollectionAggregate -sqlalchemy.sql.elements.ColumnClause -sqlalchemy.sql.elements.ColumnElement -sqlalchemy.sql.elements.Extract -sqlalchemy.sql.elements.False_ -sqlalchemy.sql.elements.FunctionFilter -sqlalchemy.sql.elements.GroupedElement -sqlalchemy.sql.elements.Grouping -sqlalchemy.sql.elements.IndexExpression -sqlalchemy.sql.elements.Label -sqlalchemy.sql.elements.NamedColumn -sqlalchemy.sql.elements.Null -sqlalchemy.sql.elements.Over -sqlalchemy.sql.elements.ReleaseSavepointClause -sqlalchemy.sql.elements.RollbackToSavepointClause -sqlalchemy.sql.elements.SavepointClause -sqlalchemy.sql.elements.Slice -sqlalchemy.sql.elements.TableValuedColumn -sqlalchemy.sql.elements.TextClause -sqlalchemy.sql.elements.True_ -sqlalchemy.sql.elements.Tuple -sqlalchemy.sql.elements.TypeClause -sqlalchemy.sql.elements.TypeCoerce -sqlalchemy.sql.elements.UnaryExpression -sqlalchemy.sql.elements.WithinGroup -sqlalchemy.sql.elements._IdentifiedClause -sqlalchemy.sql.elements._label_reference -sqlalchemy.sql.elements._textual_label_reference -sqlalchemy.sql.events.DDLEvents -sqlalchemy.sql.expression.Alias -sqlalchemy.sql.expression.AliasedReturnsRows -sqlalchemy.sql.expression.BinaryExpression -sqlalchemy.sql.expression.BindParameter -sqlalchemy.sql.expression.BooleanClauseList -sqlalchemy.sql.expression.CTE -sqlalchemy.sql.expression.Case -sqlalchemy.sql.expression.Cast -sqlalchemy.sql.expression.ClauseElement -sqlalchemy.sql.expression.ClauseList -sqlalchemy.sql.expression.CollectionAggregate -sqlalchemy.sql.expression.ColumnClause -sqlalchemy.sql.expression.ColumnElement -sqlalchemy.sql.expression.CompoundSelect -sqlalchemy.sql.expression.Delete -sqlalchemy.sql.expression.Exists -sqlalchemy.sql.expression.Extract -sqlalchemy.sql.expression.False_ -sqlalchemy.sql.expression.FromClause -sqlalchemy.sql.expression.FromGrouping -sqlalchemy.sql.expression.Function -sqlalchemy.sql.expression.FunctionElement -sqlalchemy.sql.expression.FunctionFilter -sqlalchemy.sql.expression.GenerativeSelect -sqlalchemy.sql.expression.Grouping -sqlalchemy.sql.expression.Insert -sqlalchemy.sql.expression.Join -sqlalchemy.sql.expression.Label -sqlalchemy.sql.expression.LambdaElement -sqlalchemy.sql.expression.Lateral -sqlalchemy.sql.expression.Null -sqlalchemy.sql.expression.Over -sqlalchemy.sql.expression.ReleaseSavepointClause -sqlalchemy.sql.expression.ReturnsRows -sqlalchemy.sql.expression.RollbackToSavepointClause -sqlalchemy.sql.expression.SavepointClause -sqlalchemy.sql.expression.ScalarSelect -sqlalchemy.sql.expression.Select -sqlalchemy.sql.expression.SelectBase -sqlalchemy.sql.expression.Selectable -sqlalchemy.sql.expression.StatementLambdaElement -sqlalchemy.sql.expression.Subquery -sqlalchemy.sql.expression.TableClause -sqlalchemy.sql.expression.TableSample -sqlalchemy.sql.expression.TableValuedAlias -sqlalchemy.sql.expression.TextClause -sqlalchemy.sql.expression.TextualSelect -sqlalchemy.sql.expression.True_ -sqlalchemy.sql.expression.Tuple -sqlalchemy.sql.expression.TypeClause -sqlalchemy.sql.expression.TypeCoerce -sqlalchemy.sql.expression.UnaryExpression -sqlalchemy.sql.expression.Update -sqlalchemy.sql.expression.UpdateBase -sqlalchemy.sql.expression.Values -sqlalchemy.sql.expression.ValuesBase -sqlalchemy.sql.expression.WithinGroup -sqlalchemy.sql.functions.AnsiFunction -sqlalchemy.sql.functions.Function -sqlalchemy.sql.functions.FunctionAsBinary -sqlalchemy.sql.functions.FunctionElement -sqlalchemy.sql.functions.GenericFunction -sqlalchemy.sql.functions.OrderedSetAgg -sqlalchemy.sql.functions.ReturnTypeFromArgs -sqlalchemy.sql.functions.ScalarFunctionColumn -sqlalchemy.sql.functions.array_agg -sqlalchemy.sql.functions.char_length -sqlalchemy.sql.functions.coalesce -sqlalchemy.sql.functions.concat -sqlalchemy.sql.functions.count -sqlalchemy.sql.functions.cube -sqlalchemy.sql.functions.cume_dist -sqlalchemy.sql.functions.current_date -sqlalchemy.sql.functions.current_time -sqlalchemy.sql.functions.current_timestamp -sqlalchemy.sql.functions.current_user -sqlalchemy.sql.functions.dense_rank -sqlalchemy.sql.functions.grouping_sets -sqlalchemy.sql.functions.localtime -sqlalchemy.sql.functions.localtimestamp -sqlalchemy.sql.functions.max -sqlalchemy.sql.functions.min -sqlalchemy.sql.functions.mode -sqlalchemy.sql.functions.next_value -sqlalchemy.sql.functions.now -sqlalchemy.sql.functions.percent_rank -sqlalchemy.sql.functions.percentile_cont -sqlalchemy.sql.functions.percentile_disc -sqlalchemy.sql.functions.random -sqlalchemy.sql.functions.rank -sqlalchemy.sql.functions.rollup -sqlalchemy.sql.functions.session_user -sqlalchemy.sql.functions.sum -sqlalchemy.sql.functions.sysdate -sqlalchemy.sql.functions.user -sqlalchemy.sql.lambdas.DeferredLambdaElement -sqlalchemy.sql.lambdas.LambdaElement -sqlalchemy.sql.lambdas.LambdaOptions -sqlalchemy.sql.lambdas.LinkedLambdaElement -sqlalchemy.sql.lambdas.NullLambdaStatement -sqlalchemy.sql.lambdas.StatementLambdaElement -sqlalchemy.sql.schema.CheckConstraint -sqlalchemy.sql.schema.Column -sqlalchemy.sql.schema.ColumnCollectionConstraint -sqlalchemy.sql.schema.ColumnDefault -sqlalchemy.sql.schema.Computed -sqlalchemy.sql.schema.Constraint -sqlalchemy.sql.schema.DefaultGenerator -sqlalchemy.sql.schema.ForeignKey -sqlalchemy.sql.schema.ForeignKeyConstraint -sqlalchemy.sql.schema.Identity -sqlalchemy.sql.schema.Index -sqlalchemy.sql.schema.MetaData -sqlalchemy.sql.schema.PrimaryKeyConstraint -sqlalchemy.sql.schema.SchemaItem -sqlalchemy.sql.schema.Sequence -sqlalchemy.sql.schema.Table -sqlalchemy.sql.schema.ThreadLocalMetaData -sqlalchemy.sql.schema.UniqueConstraint -sqlalchemy.sql.selectable.Alias -sqlalchemy.sql.selectable.AliasedReturnsRows -sqlalchemy.sql.selectable.BindParameter -sqlalchemy.sql.selectable.BooleanClauseList -sqlalchemy.sql.selectable.CTE -sqlalchemy.sql.selectable.ClauseElement -sqlalchemy.sql.selectable.ClauseList -sqlalchemy.sql.selectable.ColumnClause -sqlalchemy.sql.selectable.CompoundSelect -sqlalchemy.sql.selectable.Exists -sqlalchemy.sql.selectable.ForUpdateArg -sqlalchemy.sql.selectable.FromClause -sqlalchemy.sql.selectable.FromGrouping -sqlalchemy.sql.selectable.GenerativeSelect -sqlalchemy.sql.selectable.GroupedElement -sqlalchemy.sql.selectable.Grouping -sqlalchemy.sql.selectable.Join -sqlalchemy.sql.selectable.Lateral -sqlalchemy.sql.selectable.ReturnsRows -sqlalchemy.sql.selectable.ScalarSelect -sqlalchemy.sql.selectable.Select -sqlalchemy.sql.selectable.SelectBase -sqlalchemy.sql.selectable.SelectState.default_select_compile_options -sqlalchemy.sql.selectable.SelectStatementGrouping -sqlalchemy.sql.selectable.Selectable -sqlalchemy.sql.selectable.Subquery -sqlalchemy.sql.selectable.TableClause -sqlalchemy.sql.selectable.TableSample -sqlalchemy.sql.selectable.TableValuedAlias -sqlalchemy.sql.selectable.TableValuedColumn -sqlalchemy.sql.selectable.TextualSelect -sqlalchemy.sql.selectable.UnaryExpression -sqlalchemy.sql.selectable.Values -sqlalchemy.sql.selectable._MemoizedSelectEntities -sqlalchemy.sql.selectable._OffsetLimitParam -sqlalchemy.sql.sqltypes.ARRAY -sqlalchemy.sql.sqltypes.BIGINT -sqlalchemy.sql.sqltypes.BINARY -sqlalchemy.sql.sqltypes.BLOB -sqlalchemy.sql.sqltypes.BOOLEAN -sqlalchemy.sql.sqltypes.BigInteger -sqlalchemy.sql.sqltypes.Boolean -sqlalchemy.sql.sqltypes.CHAR -sqlalchemy.sql.sqltypes.CLOB -sqlalchemy.sql.sqltypes.DATE -sqlalchemy.sql.sqltypes.DATETIME -sqlalchemy.sql.sqltypes.DECIMAL -sqlalchemy.sql.sqltypes.Date -sqlalchemy.sql.sqltypes.DateTime -sqlalchemy.sql.sqltypes.Enum -sqlalchemy.sql.sqltypes.FLOAT -sqlalchemy.sql.sqltypes.Float -sqlalchemy.sql.sqltypes.INTEGER -sqlalchemy.sql.sqltypes.Integer -sqlalchemy.sql.sqltypes.Interval -sqlalchemy.sql.sqltypes.JSON -sqlalchemy.sql.sqltypes.JSON.JSONElementType -sqlalchemy.sql.sqltypes.JSON.JSONIndexType -sqlalchemy.sql.sqltypes.JSON.JSONIntIndexType -sqlalchemy.sql.sqltypes.JSON.JSONPathType -sqlalchemy.sql.sqltypes.JSON.JSONStrIndexType -sqlalchemy.sql.sqltypes.LargeBinary -sqlalchemy.sql.sqltypes.MatchType -sqlalchemy.sql.sqltypes.NCHAR -sqlalchemy.sql.sqltypes.NUMERIC -sqlalchemy.sql.sqltypes.NVARCHAR -sqlalchemy.sql.sqltypes.NullType -sqlalchemy.sql.sqltypes.Numeric -sqlalchemy.sql.sqltypes.PickleType -sqlalchemy.sql.sqltypes.REAL -sqlalchemy.sql.sqltypes.SMALLINT -sqlalchemy.sql.sqltypes.SmallInteger -sqlalchemy.sql.sqltypes.String -sqlalchemy.sql.sqltypes.TEXT -sqlalchemy.sql.sqltypes.TIME -sqlalchemy.sql.sqltypes.TIMESTAMP -sqlalchemy.sql.sqltypes.TableValueType -sqlalchemy.sql.sqltypes.Text -sqlalchemy.sql.sqltypes.Time -sqlalchemy.sql.sqltypes.TupleType -sqlalchemy.sql.sqltypes.TypeDecorator -sqlalchemy.sql.sqltypes.TypeEngine -sqlalchemy.sql.sqltypes.Unicode -sqlalchemy.sql.sqltypes.UnicodeText -sqlalchemy.sql.sqltypes.VARBINARY -sqlalchemy.sql.sqltypes.VARCHAR -sqlalchemy.sql.sqltypes.Variant -sqlalchemy.sql.sqltypes._AbstractInterval -sqlalchemy.sql.sqltypes._Binary -sqlalchemy.sql.traversals.ColIdentityComparatorStrategy -sqlalchemy.sql.traversals.TraversalComparatorStrategy -sqlalchemy.sql.traversals._CacheKey -sqlalchemy.sql.traversals._CopyInternals -sqlalchemy.sql.traversals._GetChildren -sqlalchemy.sql.type_api.TypeDecorator -sqlalchemy.sql.type_api.TypeEngine -sqlalchemy.sql.type_api.UserDefinedType -sqlalchemy.sql.type_api.Variant -sqlalchemy.sql.visitors.ExtendedInternalTraversal -sqlalchemy.sql.visitors.InternalTraversal -sqlalchemy.sql.visitors.Traversible -sqlalchemy.types.ARRAY -sqlalchemy.types.BIGINT -sqlalchemy.types.BINARY -sqlalchemy.types.BLOB -sqlalchemy.types.BOOLEAN -sqlalchemy.types.BigInteger -sqlalchemy.types.Boolean -sqlalchemy.types.CHAR -sqlalchemy.types.CLOB -sqlalchemy.types.DATE -sqlalchemy.types.DATETIME -sqlalchemy.types.DECIMAL -sqlalchemy.types.Date -sqlalchemy.types.DateTime -sqlalchemy.types.Enum -sqlalchemy.types.FLOAT -sqlalchemy.types.Float -sqlalchemy.types.INTEGER -sqlalchemy.types.Integer -sqlalchemy.types.Interval -sqlalchemy.types.JSON -sqlalchemy.types.JSON.JSONElementType -sqlalchemy.types.JSON.JSONIndexType -sqlalchemy.types.JSON.JSONIntIndexType -sqlalchemy.types.JSON.JSONPathType -sqlalchemy.types.JSON.JSONStrIndexType -sqlalchemy.types.LargeBinary -sqlalchemy.types.MatchType -sqlalchemy.types.NCHAR -sqlalchemy.types.NUMERIC -sqlalchemy.types.NVARCHAR -sqlalchemy.types.NullType -sqlalchemy.types.Numeric -sqlalchemy.types.PickleType -sqlalchemy.types.REAL -sqlalchemy.types.SMALLINT -sqlalchemy.types.SmallInteger -sqlalchemy.types.String -sqlalchemy.types.TEXT -sqlalchemy.types.TIME -sqlalchemy.types.TIMESTAMP -sqlalchemy.types.Text -sqlalchemy.types.Time -sqlalchemy.types.TupleType -sqlalchemy.types.TypeDecorator -sqlalchemy.types.TypeEngine -sqlalchemy.types.Unicode -sqlalchemy.types.UnicodeText -sqlalchemy.types.UserDefinedType -sqlalchemy.types.VARBINARY -sqlalchemy.types.VARCHAR -sqlalchemy.types._Binary diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi index 47b9703ad3d3..59d9d16fbc12 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi @@ -197,7 +197,6 @@ class MSExecutionContext(default.DefaultExecutionContext): @property def rowcount(self): ... def handle_dbapi_exception(self, e) -> None: ... - def get_result_cursor_strategy(self, result): ... def fire_sequence(self, seq, type_): ... def get_insert_default(self, column): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi index d72b1ed8d387..683ada3fc5fb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -163,6 +163,7 @@ class PGCompiler(compiler.SQLCompiler): class PGDDLCompiler(compiler.DDLCompiler): def get_column_specification(self, column, **kwargs): ... def visit_check_constraint(self, constraint): ... + def visit_foreign_key_constraint(self, constraint) -> str: ... # type: ignore[override] # Different params def visit_drop_table_comment(self, drop): ... def visit_create_enum_type(self, create): ... def visit_drop_enum_type(self, drop): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi index 7b6eac7d8ff0..afe46eb46e85 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi @@ -116,7 +116,6 @@ class ExecutionContext: def pre_exec(self) -> None: ... def get_out_parameter_values(self, out_param_names) -> None: ... def post_exec(self) -> None: ... - def get_result_cursor_strategy(self, result) -> None: ... def handle_dbapi_exception(self, e) -> None: ... def should_autocommit_text(self, statement) -> None: ... def lastrow_has_defaults(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/event/base.pyi b/stubs/SQLAlchemy/sqlalchemy/event/base.pyi index 9b1341c166e8..d968c86e5ddd 100644 --- a/stubs/SQLAlchemy/sqlalchemy/event/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/event/base.pyi @@ -12,7 +12,7 @@ class _Dispatch: class _EventMeta(type): def __init__(cls, classname, bases, dict_) -> None: ... -class Events: +class Events(metaclass=_EventMeta): dispatch: Any class _JoinedDispatcher: diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi index 0160b4919214..fbce15f4bf6a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -1,5 +1,14 @@ from _typeshed import Incomplete -from typing import Any +from collections.abc import Iterable, Mapping +from typing import Any, TypeVar, overload +from typing_extensions import Literal, SupportsIndex + +from ..orm.attributes import Event +from ..util.langhelpers import _symbol, symbol + +_T = TypeVar("_T") +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") class _PlainColumnGetter: cols: Any @@ -81,12 +90,38 @@ class CollectionAdapter: def fire_remove_event(self, item, initiator: Incomplete | None = ...) -> None: ... def fire_pre_remove_event(self, initiator: Incomplete | None = ...) -> None: ... -class InstrumentedList(list[Any]): ... -class InstrumentedSet(set[Any]): ... -class InstrumentedDict(dict[Any, Any]): ... +class InstrumentedList(list[_T]): + def append(self, item, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def clear(self, index: SupportsIndex = -1) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def insert(self, index: SupportsIndex, value: _T) -> None: ... + def pop(self, index: SupportsIndex = -1) -> _T: ... + def remove(self, value: _T, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + +class InstrumentedSet(set[_T]): + def add(self, value: _T, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def difference_update(self, value: Iterable[_T]) -> None: ... # type: ignore[override] + def discard(self, value: _T, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def intersection_update(self, other: Iterable[_T]) -> None: ... # type: ignore[override] + def remove(self, value: _T, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def symmetric_difference_update(self, other: Iterable[_T]) -> None: ... + def update(self, value: Iterable[_T]) -> None: ... # type: ignore[override] + +class InstrumentedDict(dict[_KT, _VT]): ... -class MappedCollection(dict[Any, Any]): +class MappedCollection(dict[_KT, _VT]): keyfunc: Any def __init__(self, keyfunc) -> None: ... - def set(self, value, _sa_initiator: Incomplete | None = ...) -> None: ... - def remove(self, value, _sa_initiator: Incomplete | None = ...) -> None: ... + def set(self, value: _VT, _sa_initiator: Event | Literal[False] | None = ...) -> None: ... + def remove(self, value: _VT, _sa_initiator: Event | Literal[False] | None = ...) -> None: ... + def __delitem__(self, key: _KT, _sa_initiatorEvent: Event | Literal[False] | None = None) -> None: ... + def __setitem__(self, key: _KT, value: _VT, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + @overload + def pop(self, key: _KT) -> _VT: ... + @overload + def pop(self, key: _KT, default: _VT | _T | _symbol | symbol = ...) -> _VT | _T: ... + @overload # type: ignore[override] + def setdefault(self, key: _KT, default: _T) -> _VT | _T: ... + @overload + def setdefault(self, key: _KT, default: None = None) -> _VT | None: ... + def update(self, __other: Mapping[_KT, _VT] = ..., **kw: _VT) -> None: ... # type: ignore[override] diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index 5422cfffb5c5..1b14062cce36 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -1,5 +1,6 @@ from _typeshed import Incomplete -from typing import Any +from collections import Callable +from typing import Any, Generic, Protocol, TypeVar from ..sql.base import Generative from .interfaces import LoaderOption @@ -23,44 +24,116 @@ class Load(Generative, LoaderOption): def set_generic_strategy(self, attrs, strategy) -> None: ... def set_class_strategy(self, strategy, opts) -> None: ... # added dynamically at runtime - def contains_eager(self, attr, alias: Incomplete | None = ...): ... - def load_only(self, *attrs): ... - def joinedload(self, attr, innerjoin: Incomplete | None = ...): ... - def subqueryload(self, attr): ... - def selectinload(self, attr): ... - def lazyload(self, attr): ... - def immediateload(self, attr): ... - def noload(self, attr): ... - def raiseload(self, attr, sql_only: bool = ...): ... - def defaultload(self, attr): ... - def defer(self, key, raiseload: bool = ...): ... - def undefer(self, key): ... - def undefer_group(self, name): ... - def with_expression(self, key, expression): ... - def selectin_polymorphic(self, classes): ... + def contains_eager(loadopt, attr, alias: Incomplete | None = ...): ... + def load_only(loadopt, *attrs): ... + def joinedload(loadopt, attr, innerjoin: Incomplete | None = ...): ... + def subqueryload(loadopt, attr): ... + def selectinload(loadopt, attr): ... + def lazyload(loadopt, attr): ... + def immediateload(loadopt, attr): ... + def noload(loadopt, attr): ... + def raiseload(loadopt, attr, sql_only: bool = ...): ... + def defaultload(loadopt, attr): ... + def defer(loadopt, key, raiseload: bool = ...): ... + def undefer(loadopt, key): ... + def undefer_group(loadopt, name): ... + def with_expression(loadopt, key, expression): ... + def selectin_polymorphic(loadopt, classes): ... class _UnboundLoad(Load): path: Any local_opts: Any def __init__(self) -> None: ... -class loader_option: - name: Any - fn: Any - def __call__(self, fn): ... - -def contains_eager(loadopt, attr, alias: Incomplete | None = ...): ... -def load_only(loadopt, *attrs): ... -def joinedload(loadopt, attr, innerjoin: Incomplete | None = ...): ... -def subqueryload(loadopt, attr): ... -def selectinload(loadopt, attr): ... -def lazyload(loadopt, attr): ... -def immediateload(loadopt, attr): ... -def noload(loadopt, attr): ... -def raiseload(loadopt, attr, sql_only: bool = ...): ... -def defaultload(loadopt, attr): ... -def defer(loadopt, key, raiseload: bool = ...): ... -def undefer(loadopt, key): ... -def undefer_group(loadopt, name): ... -def with_expression(loadopt, key, expression): ... -def selectin_polymorphic(loadopt, classes): ... +### +# The methods below are decorated with the class loader_option +# They dynamically become instances of loader_option, +# wich is callable with their original parameters. +# +# While both mypy and pyright's validation work, Pylance is unable to +# show the parameters and return types. +# +# There is a workaround (define the method for Pylance, then reassign +# an instance of loader_option to it for mypy, and add pyright+Flake8 +# suppressions), but it is too hacky and relies on some unsupported quirks. +# +# Asking Pylance to add support for these generic callables might be preferable. +### + +_F = TypeVar("_F", bound=Callable[..., loader_option[Any]]) + +class loader_option(Generic[_F]): + name: str + _dynamic: _F + fn: _F + __call__: _F # Cheesy "__call__" definition to use the dynamic methods instead + +class _contains_eager(Protocol): + def __call__(self, loadopt, attr, alias: Incomplete | None = ...) -> loader_option[_contains_eager]: ... + +contains_eager: loader_option[_contains_eager] + +class _load_only(Protocol): + def __call__(self, loadopt, *attrs) -> loader_option[_load_only]: ... + +load_only: loader_option[_load_only] + +class _subqueryload(Protocol): + def __call__(self, loadopt, attr) -> loader_option[_subqueryload]: ... + +subqueryload: loader_option[_subqueryload] + +class _selectinload(Protocol): + def __call__(self, loadopt, attr) -> loader_option[_selectinload]: ... + +selectinload: loader_option[_selectinload] + +class _lazyload(Protocol): + def __call__(self, loadopt, attr) -> loader_option[_lazyload]: ... + +lazyload: loader_option[_lazyload] + +class _immediateload(Protocol): + def __call__(self, loadopt, attr) -> loader_option[_immediateload]: ... + +immediateload: loader_option[_immediateload] + +class _noload(Protocol): + def __call__(self, loadopt, attr) -> loader_option[_noload]: ... + +noload: loader_option[_noload] + +class _raiseload(Protocol): + def __call__(self, loadopt, attr, sql_only: bool = ...) -> loader_option[_raiseload]: ... + +raiseload: loader_option[_raiseload] + +class _defaultload(Protocol): + def __call__(self, loadopt, attr) -> loader_option[_defaultload]: ... + +defaultload: loader_option[_defaultload] + +class _defer(Protocol): + def __call__(self, loadopt, attr, sql_only: bool = ...) -> loader_option[_defer]: ... + +defer: loader_option[_defer] + +class _undefer(Protocol): + def __call__(self, loadopt, key) -> loader_option[_undefer]: ... + +undefer: loader_option[_undefer] + +class _undefer_group(Protocol): + def __call__(self, loadopt, name) -> loader_option[_undefer_group]: ... + +undefer_group: loader_option[_undefer_group] + +class _with_expression(Protocol): + def __call__(self, loadopt, key, expression) -> loader_option[_with_expression]: ... + +with_expression: loader_option[_with_expression] + +class _selectin_polymorphic(Protocol): + def __call__(self, loadopt, classes) -> loader_option[_selectin_polymorphic]: ... + +selectin_polymorphic: loader_option[_selectin_polymorphic] diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi index 54b1d90ee954..2f7be1fbf26f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi @@ -72,7 +72,7 @@ class _MetaOptions(type): def __init__(cls, classname, bases, dict_) -> None: ... def __add__(self, other): ... -class Options: +class Options(metaclass=_MetaOptions): def __init__(self, **kw) -> None: ... def __add__(self, other): ... def __eq__(self, other): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi index 44178d7f6de8..bd521727bdfa 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi @@ -1,6 +1,8 @@ from _typeshed import Incomplete from typing import NamedTuple +from sqlalchemy.util.langhelpers import EnsureKWArgType + from ..util import memoized_property from . import elements @@ -67,7 +69,7 @@ class Compiled: @property def params(self): ... -class TypeCompiler: +class TypeCompiler(metaclass=EnsureKWArgType): ensure_kwarg: str dialect: Incomplete def __init__(self, dialect) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi index c1a0d1ec43ae..d5180c37d9bf 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi @@ -87,7 +87,7 @@ class Function(FunctionElement): class _GenericMeta(TraversibleType): def __init__(cls, clsname, bases, clsdict) -> None: ... -class GenericFunction: +class GenericFunction(Function, metaclass=_GenericMeta): name: Incomplete identifier: Incomplete coerce_arguments: bool diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi index dd3f84929967..af91551597c6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi @@ -55,7 +55,7 @@ class VisitableCheckKWArg(util.EnsureKWArgType, TraversibleType): ... class ExternalType: cache_ok: Any -class UserDefinedType: +class UserDefinedType(ExternalType, TypeEngine, metaclass=VisitableCheckKWArg): __visit_name__: str ensure_kwarg: str def coerce_compared_value(self, op, value): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi index c3dd44793e24..398dee26ef9a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi @@ -3,14 +3,14 @@ from typing import Any class TraversibleType(type): def __init__(cls, clsname, bases, clsdict) -> None: ... -class Traversible: +class Traversible(metaclass=TraversibleType): def __class_getitem__(cls, key): ... def get_children(self, omit_attrs=..., **kw): ... class _InternalTraversalType(type): def __init__(cls, clsname, bases, clsdict) -> None: ... -class InternalTraversal: +class InternalTraversal(metaclass=_InternalTraversalType): def dispatch(self, visit_symbol): ... def run_generated_dispatch(self, target, internal_dispatch, generate_dispatcher_name): ... def generate_dispatch(self, target_cls, internal_dispatch, generate_dispatcher_name): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index a6c48328be1f..0fc5ecb899b9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,33 +1,117 @@ -from typing import Any +from _typeshed import Incomplete, Self +from collections.abc import Callable +from logging import Logger +from typing import Generic, Protocol, TypeVar -log: Any -FOLLOWER_IDENT: Any +from sqlalchemy.engine.url import URL +from sqlalchemy.testing.config import Config -class register: - fns: Any - @classmethod - def init(cls, fn): ... - def for_db(self, *dbnames): ... - def __call__(self, cfg, *arg): ... +log: Logger +FOLLOWER_IDENT: Incomplete | None def create_follower_db(follower_ident) -> None: ... -def setup_config(db_url, options, file_config, follower_ident): ... +def setup_config(db_url, options, file_config, follower_ident) -> Config: ... def drop_follower_db(follower_ident) -> None: ... def generate_db_urls(db_urls, extra_drivers) -> None: ... -def generate_driver_url(url, driver, query_str): ... -def drop_all_schema_objects_pre_tables(cfg, eng) -> None: ... -def drop_all_schema_objects_post_tables(cfg, eng) -> None: ... def drop_all_schema_objects(cfg, eng) -> None: ... -def create_db(cfg, eng, ident) -> None: ... -def drop_db(cfg, eng, ident) -> None: ... -def update_db_opts(cfg, db_opts) -> None: ... -def post_configure_engine(url, engine, follower_ident) -> None: ... -def follower_url_from_main(url, ident): ... -def configure_follower(cfg, ident) -> None: ... -def run_reap_dbs(url, ident) -> None: ... def reap_dbs(idents_file) -> None: ... -def temp_table_keyword_args(cfg, eng) -> None: ... -def prepare_for_drop_tables(config, connection) -> None: ... -def stop_test_class_outside_fixtures(config, db, testcls) -> None: ... -def get_temp_table_name(cfg, eng, base_name): ... -def set_default_schema_on_connection(cfg, dbapi_connection, schema_name) -> None: ... + +### +# The methods below are decorated with the method register.init +# They dynamically become instances of register, +# wich is callable with their original parameters. +# +# While both mypy and pyright's validation work, Pylance is unable to +# show the parameters and return types. +# +# There is a workaround (define the method for Pylance, then reassign +# an instance of register to it for mypy, and add pyright+Flake8 +# suppressions), but it is too hacky and relies on some unsupported quirks. +# +# Asking Pylance to add support for these generic callables might be preferable. +### + +_F = TypeVar("_F", bound=Callable[..., str | URL | None]) +_S = TypeVar("_S", bound=str) + +class register(Generic[_F]): + fns: dict[str, _F] + @classmethod + def init(cls: type[Self], fn: _F) -> Self: ... + def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... + __call__: _F + +class _generate_driver_url(Protocol): + def __call__(self, url: URL, driver, query_str) -> URL | None: ... + +generate_driver_url: register[_generate_driver_url] + +class _drop_all_schema_objects_pre_tables(Protocol): + def __call__(self, cfg, eng) -> None: ... + +drop_all_schema_objects_pre_tables: register[_drop_all_schema_objects_pre_tables] + +class _drop_all_schema_objects_post_tables(Protocol): + def __call__(self, cfg, eng) -> None: ... + +drop_all_schema_objects_post_tables: register[_drop_all_schema_objects_post_tables] + +class _create_db(Protocol): + def __call__(self, cfg, eng, ident) -> None: ... + +create_db: register[_create_db] + +class _drop_db(Protocol): + def __call__(self, cfg, eng, ident) -> None: ... + +drop_db: register[_drop_db] + +class _update_db_opts(Protocol): + def __call__(self, cfg, db_opts) -> None: ... + +update_db_opts: register[_update_db_opts] + +class _post_configure_engine(Protocol): + def __call__(self, url: URL, engine, follower_ident) -> None: ... + +post_configure_engine: register[_post_configure_engine] + +class _follower_url_from_main(Protocol): + def __call__(self, url: URL, ident) -> URL: ... + +follower_url_from_main: register[_follower_url_from_main] + +class _configure_follower(Protocol): + def __call__(self, cfg, ident) -> None: ... + +configure_follower: register[_configure_follower] + +class _run_reap_dbs(Protocol): + def __call__(self, url: URL, ident) -> None: ... + +run_reap_dbs: register[_run_reap_dbs] + +class _temp_table_keyword_args(Protocol): + def __call__(self, cfg, eng) -> None: ... + +temp_table_keyword_args: register[_temp_table_keyword_args] + +class _prepare_for_drop_tables(Protocol): + def __call__(self, config, connection) -> None: ... + +prepare_for_drop_tables: register[_prepare_for_drop_tables] + +class _stop_test_class_outside_fixtures(Protocol): + def __call__(self, config, db, testcls) -> None: ... + +stop_test_class_outside_fixtures: register[_stop_test_class_outside_fixtures] + +class _get_temp_table_name(Protocol): + def __call__(self, cfg, eng, base_name: _S) -> _S: ... + +get_temp_table_name: register[_get_temp_table_name] # type: ignore[type-var] # _S is bound to string + +class _set_default_schema_on_connection(Protocol): + def __call__(self, cfg, dbapi_connection, schema_name) -> None: ... + +set_default_schema_on_connection: register[_set_default_schema_on_connection] diff --git a/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi b/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi index d569a665dcd9..ae064446a2b3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi @@ -59,6 +59,7 @@ from .compat import ( has_refcount_gc as has_refcount_gc, inspect_getfullargspec as inspect_getfullargspec, int_types as int_types, + is64bit as is64bit, iterbytes as iterbytes, itertools_filter as itertools_filter, itertools_filterfalse as itertools_filterfalse, @@ -76,6 +77,9 @@ from .compat import ( py37 as py37, py38 as py38, py39 as py39, + py310 as py310, + py311 as py311, + py312 as py312, pypy as pypy, quote_plus as quote_plus, raise_ as raise_, diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index c345cfd901fb..631fcce3bda3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -139,7 +139,7 @@ class IdentitySet: def __hash__(self) -> int: ... class WeakSequence: - def __init__(self, __elements=...) -> None: ... + def __init__(self, _WeakSequence__elements: Iterable[Incomplete] = ...) -> None: ... def append(self, item) -> None: ... def __len__(self) -> int: ... def __iter__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi index b329ffe40c6e..68bb936f3bdd 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi @@ -1,19 +1,20 @@ -import builtins -import collections -import contextlib import itertools import operator import pickle as pickle +import sys import threading as threading from _typeshed import Incomplete from abc import ABC as ABC +from builtins import callable as callable, next as next +from collections import namedtuple as namedtuple # noqa: Y024 # Actual import +from contextlib import contextmanager as contextmanager from datetime import timezone as timezone from functools import reduce as reduce -from io import BytesIO as BytesIO, StringIO as StringIO +from io import BytesIO, StringIO as _StringIO from itertools import zip_longest as zip_longest from time import perf_counter as perf_counter from typing import TYPE_CHECKING as TYPE_CHECKING, Any, NamedTuple -from typing_extensions import Literal +from typing_extensions import Final from urllib.parse import ( parse_qsl as parse_qsl, quote as quote, @@ -24,21 +25,32 @@ from urllib.parse import ( byte_buffer = BytesIO +py312: bool +py311: bool +py310: bool py39: bool py38: bool py37: bool -py3k: Literal[True] -py2k: Literal[False] +py3k: Final = True +py2k: Final = False pypy: bool cpython: bool -win32: bool -osx: bool +if sys.platform == "win32": + win32: Final = True +else: + win32: Final = False +if sys.platform == "darwin": + osx: Final = True +else: + osx: Final = False arm: bool +is64bit: bool has_refcount_gc: bool -contextmanager = contextlib.contextmanager dottedgetter = operator.attrgetter -namedtuple = collections.namedtuple # noqa: Y024 -next = builtins.next + +class StringIO(_StringIO): + def seek(self, __pos: int, __whence: int = 0) -> int: ... + def truncate(self, __pos: int | None = None) -> int: ... class FullArgSpec(NamedTuple): args: Any @@ -82,10 +94,6 @@ def raise_( ) -> None: ... def u(s): ... def ue(s): ... - -callable = builtins.callable - -def safe_bytestring(text): ... def inspect_formatargspec( args, varargs: Incomplete | None = ..., From 0c2003b987b32b57eb5cef14744a02860911504e Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 26 Jan 2023 21:53:54 -0500 Subject: [PATCH 02/19] Import typo --- stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index 1b14062cce36..43538eedef88 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -from collections import Callable +from collections.abc import Callable from typing import Any, Generic, Protocol, TypeVar from ..sql.base import Generative From 50190e169e2d4e29e5a6c16d754d90ab9f8e3eff Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 28 Jan 2023 22:21:39 -0500 Subject: [PATCH 03/19] Address some PR comments --- stubs/SQLAlchemy/@tests/stubtest_allowlist.txt | 11 ++++++----- stubs/SQLAlchemy/sqlalchemy/engine/url.pyi | 1 + stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi | 7 +++++-- stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi | 8 +------- stubs/SQLAlchemy/sqlalchemy/testing/config.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi | 8 +------- stubs/SQLAlchemy/sqlalchemy/util/compat.pyi | 6 +----- stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi | 10 +++++++--- 8 files changed, 23 insertions(+), 30 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt index 7760c23792d6..8249c56d663c 100644 --- a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt +++ b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt @@ -9,11 +9,6 @@ sqlalchemy.engine.base.Engine.logging_name # initialized if not None sqlalchemy.sql.lambdas.PyWrapper.__clause_element__ sqlalchemy.testing.util.non_refcount_gc_collect -# wrong argument name in implementation ("self" instead of "cls") -sqlalchemy.engine.URL.__new__ -sqlalchemy.engine.url.URL.__new__ -sqlalchemy.util.langhelpers._symbol.__new__ - # abstract fields not present at runtime sqlalchemy.engine.Transaction.connection sqlalchemy.engine.Transaction.is_active @@ -62,3 +57,9 @@ sqlalchemy.sql.quoted_name.lower sqlalchemy.sql.quoted_name.upper sqlalchemy.orm.ColumnProperty.Comparator.__clause_element__ sqlalchemy.orm.properties.ColumnProperty.Comparator.__clause_element__ + +# Same error as in stdlib due to it being re-erported +sqlalchemy.util.compat.StringIO.seek +sqlalchemy.util.compat.StringIO.truncate +sqlalchemy.util.StringIO.seek +sqlalchemy.util.StringIO.truncate diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index 30625dfcec8a..04a8ab923ae8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -19,6 +19,7 @@ class _URLTuple(NamedTuple): _Query: TypeAlias = Mapping[str, str | Sequence[str]] | Sequence[tuple[str, str | Sequence[str]]] class URL(_URLTuple): + def __new__(self: type[Self], *arg, **kw) -> Self | URL: ... @classmethod def create( cls, diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi index fbce15f4bf6a..3e50992ec0ba 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, SupportsKeysAndGetItem from collections.abc import Iterable, Mapping from typing import Any, TypeVar, overload from typing_extensions import Literal, SupportsIndex @@ -124,4 +124,7 @@ class MappedCollection(dict[_KT, _VT]): def setdefault(self, key: _KT, default: _T) -> _VT | _T: ... @overload def setdefault(self, key: _KT, default: None = None) -> _VT | None: ... - def update(self, __other: Mapping[_KT, _VT] = ..., **kw: _VT) -> None: ... # type: ignore[override] + @overload + def update(self, __other: SupportsKeysAndGetItem[_KT, _VT] = ..., **kwargs: _VT) -> None: ... + @overload + def update(self, __other: Iterable[tuple[_KT, _VT]] = ..., **kwargs: _VT) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index 43538eedef88..fdccd161c3fc 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -51,13 +51,7 @@ class _UnboundLoad(Load): # wich is callable with their original parameters. # # While both mypy and pyright's validation work, Pylance is unable to -# show the parameters and return types. -# -# There is a workaround (define the method for Pylance, then reassign -# an instance of loader_option to it for mypy, and add pyright+Flake8 -# suppressions), but it is too hacky and relies on some unsupported quirks. -# -# Asking Pylance to add support for these generic callables might be preferable. +# show the parameters and return types without a hacky workaround. ### _F = TypeVar("_F", bound=Callable[..., loader_option[Any]]) diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi index db67aa9cbe9d..dca81e31185f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi @@ -26,7 +26,7 @@ class Config: is_async: Any def __init__(self, db, db_opts, options, file_config) -> None: ... @classmethod - def register(cls, db, db_opts, options, file_config): ... + def register(cls, db, db_opts, options, file_config) -> Config: ... @classmethod def set_as_current(cls, config, namespace) -> None: ... @classmethod diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index 0fc5ecb899b9..bec851be3da1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -22,13 +22,7 @@ def reap_dbs(idents_file) -> None: ... # wich is callable with their original parameters. # # While both mypy and pyright's validation work, Pylance is unable to -# show the parameters and return types. -# -# There is a workaround (define the method for Pylance, then reassign -# an instance of register to it for mypy, and add pyright+Flake8 -# suppressions), but it is too hacky and relies on some unsupported quirks. -# -# Asking Pylance to add support for these generic callables might be preferable. +# show the parameters and return types without a hacky workaround. ### _F = TypeVar("_F", bound=Callable[..., str | URL | None]) diff --git a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi index 68bb936f3bdd..eae66bce00e1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi @@ -10,7 +10,7 @@ from collections import namedtuple as namedtuple # noqa: Y024 # Actual import from contextlib import contextmanager as contextmanager from datetime import timezone as timezone from functools import reduce as reduce -from io import BytesIO, StringIO as _StringIO +from io import BytesIO, StringIO as StringIO from itertools import zip_longest as zip_longest from time import perf_counter as perf_counter from typing import TYPE_CHECKING as TYPE_CHECKING, Any, NamedTuple @@ -48,10 +48,6 @@ is64bit: bool has_refcount_gc: bool dottedgetter = operator.attrgetter -class StringIO(_StringIO): - def seek(self, __pos: int, __whence: int = 0) -> int: ... - def truncate(self, __pos: int | None = None) -> int: ... - class FullArgSpec(NamedTuple): args: Any varargs: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index 4c3949000381..3f0e7c564753 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -30,7 +30,7 @@ class PluginLoader: def __init__(self, group, auto_fn: Incomplete | None = ...) -> None: ... def clear(self) -> None: ... def load(self, name): ... - def register(self, name, modulepath, objname): ... + def register(self, name, modulepath, objname) -> None: ... def get_cls_kwargs(cls, _set: Incomplete | None = ...): ... def get_func_kwargs(func): ... @@ -129,12 +129,16 @@ class hybridmethod: def classlevel(self, func): ... class _symbol(int): - def __new__(cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ...): ... + def __new__( # noqa: Y034 # Excplicitely instanciates _symbol + self, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ... + ) -> _symbol: ... def __reduce__(self): ... class symbol: symbols: Any - def __new__(cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ...): ... + def __new__( # type: ignore[misc] # Excplicitely instanciates _symbol + cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ... + ) -> _symbol: ... @classmethod def parse_user_argument(cls, arg, choices, name, resolve_symbol_names: bool = ...): ... From 125c2ddd92cdeb66b4ac9b8cc57aef07aaf385b3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 29 Jan 2023 03:22:51 +0000 Subject: [PATCH 04/19] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi index 3e50992ec0ba..8efe02c952a0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete, SupportsKeysAndGetItem -from collections.abc import Iterable, Mapping +from collections.abc import Iterable from typing import Any, TypeVar, overload from typing_extensions import Literal, SupportsIndex From 9d9647f7f59c4281acf5cb38e0c3b11877dfe12b Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 30 Jan 2023 07:08:14 -0500 Subject: [PATCH 05/19] Simplified loader_option and register --- .../SQLAlchemy/@tests/stubtest_allowlist.txt | 2 - .../sqlalchemy/orm/strategy_options.pyi | 167 +++++++----------- .../sqlalchemy/testing/provision.pyi | 130 +++++--------- 3 files changed, 100 insertions(+), 199 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt index 8249c56d663c..d2716d1ab5eb 100644 --- a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt +++ b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt @@ -1,7 +1,5 @@ # Expanding keyword arguments in stubs sqlalchemy.ext.declarative.as_declarative -sqlalchemy.orm.strategy_options.loader_option.__call__ -sqlalchemy.testing.provision.register.__call__ # not always present sqlalchemy.engine.Engine.logging_name # initialized if not None diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index fdccd161c3fc..c83a4c9dab9b 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -1,6 +1,6 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Self from collections.abc import Callable -from typing import Any, Generic, Protocol, TypeVar +from typing import Any from ..sql.base import Generative from .interfaces import LoaderOption @@ -18,116 +18,67 @@ class Load(Generative, LoaderOption): propagate_to_loaders: bool def process_compile_state_replaced_entities(self, compile_state, mapper_entities) -> None: ... def process_compile_state(self, compile_state) -> None: ... - def options(self, *opts) -> None: ... - def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = ...) -> None: ... - def set_column_strategy(self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> None: ... - def set_generic_strategy(self, attrs, strategy) -> None: ... - def set_class_strategy(self, strategy, opts) -> None: ... - # added dynamically at runtime - def contains_eager(loadopt, attr, alias: Incomplete | None = ...): ... - def load_only(loadopt, *attrs): ... - def joinedload(loadopt, attr, innerjoin: Incomplete | None = ...): ... - def subqueryload(loadopt, attr): ... - def selectinload(loadopt, attr): ... - def lazyload(loadopt, attr): ... - def immediateload(loadopt, attr): ... - def noload(loadopt, attr): ... - def raiseload(loadopt, attr, sql_only: bool = ...): ... - def defaultload(loadopt, attr): ... - def defer(loadopt, key, raiseload: bool = ...): ... - def undefer(loadopt, key): ... - def undefer_group(loadopt, name): ... - def with_expression(loadopt, key, expression): ... - def selectin_polymorphic(loadopt, classes): ... + def options(self: Self, *opts) -> Self: ... + def set_relationship_strategy(self: Self, attr, strategy, propagate_to_loaders: bool = ...) -> Self: ... + def set_column_strategy(self: Self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> Self: ... + def set_generic_strategy(self: Self, attrs, strategy) -> Self: ... + def set_class_strategy(self: Self, strategy, opts) -> Self: ... + # Added dynamically at runtime + def contains_eager(loadopt: Self, attr, alias: Incomplete | None = ...) -> Self: ... + def load_only(loadopt: Self, *attrs) -> Self: ... + def joinedload(loadopt: Self, attr, innerjoin: Incomplete | None = ...) -> Self: ... + def subqueryload(loadopt: Self, attr) -> Self: ... + def selectinload(loadopt: Self, attr) -> Self: ... + def lazyload(loadopt: Self, attr) -> Self: ... + def immediateload(loadopt: Self, attr) -> Self: ... + def noload(loadopt: Self, attr) -> Self: ... + def raiseload(loadopt: Self, attr, sql_only: bool = ...) -> Self: ... + def defaultload(loadopt: Self, attr) -> Self: ... + def defer(loadopt: Self, key, raiseload: bool = ...) -> Self: ... + def undefer(loadopt: Self, key) -> Self: ... + def undefer_group(loadopt: Self, name) -> Self: ... + def with_expression(loadopt: Self, key, expression) -> Self: ... + def selectin_polymorphic(loadopt: Self, classes) -> Self: ... class _UnboundLoad(Load): path: Any local_opts: Any def __init__(self) -> None: ... -### -# The methods below are decorated with the class loader_option -# They dynamically become instances of loader_option, -# wich is callable with their original parameters. -# -# While both mypy and pyright's validation work, Pylance is unable to -# show the parameters and return types without a hacky workaround. -### - -_F = TypeVar("_F", bound=Callable[..., loader_option[Any]]) - -class loader_option(Generic[_F]): +class loader_option: name: str - _dynamic: _F - fn: _F - __call__: _F # Cheesy "__call__" definition to use the dynamic methods instead - -class _contains_eager(Protocol): - def __call__(self, loadopt, attr, alias: Incomplete | None = ...) -> loader_option[_contains_eager]: ... - -contains_eager: loader_option[_contains_eager] - -class _load_only(Protocol): - def __call__(self, loadopt, *attrs) -> loader_option[_load_only]: ... - -load_only: loader_option[_load_only] - -class _subqueryload(Protocol): - def __call__(self, loadopt, attr) -> loader_option[_subqueryload]: ... - -subqueryload: loader_option[_subqueryload] - -class _selectinload(Protocol): - def __call__(self, loadopt, attr) -> loader_option[_selectinload]: ... - -selectinload: loader_option[_selectinload] - -class _lazyload(Protocol): - def __call__(self, loadopt, attr) -> loader_option[_lazyload]: ... - -lazyload: loader_option[_lazyload] - -class _immediateload(Protocol): - def __call__(self, loadopt, attr) -> loader_option[_immediateload]: ... - -immediateload: loader_option[_immediateload] - -class _noload(Protocol): - def __call__(self, loadopt, attr) -> loader_option[_noload]: ... - -noload: loader_option[_noload] - -class _raiseload(Protocol): - def __call__(self, loadopt, attr, sql_only: bool = ...) -> loader_option[_raiseload]: ... - -raiseload: loader_option[_raiseload] - -class _defaultload(Protocol): - def __call__(self, loadopt, attr) -> loader_option[_defaultload]: ... - -defaultload: loader_option[_defaultload] - -class _defer(Protocol): - def __call__(self, loadopt, attr, sql_only: bool = ...) -> loader_option[_defer]: ... - -defer: loader_option[_defer] - -class _undefer(Protocol): - def __call__(self, loadopt, key) -> loader_option[_undefer]: ... - -undefer: loader_option[_undefer] - -class _undefer_group(Protocol): - def __call__(self, loadopt, name) -> loader_option[_undefer_group]: ... - -undefer_group: loader_option[_undefer_group] - -class _with_expression(Protocol): - def __call__(self, loadopt, key, expression) -> loader_option[_with_expression]: ... - -with_expression: loader_option[_with_expression] - -class _selectin_polymorphic(Protocol): - def __call__(self, loadopt, classes) -> loader_option[_selectin_polymorphic]: ... - -selectin_polymorphic: loader_option[_selectin_polymorphic] + # The first parameter of this Callable should always be `loadopt: Load` + fn: Callable[..., loader_option] + def __call__(self: Self, fn: Callable[..., loader_option]) -> Self: ... + +# loader_option instances that can be used to dynamically add methods to Load at runtime +@loader_option() +def contains_eager(loadopt: Load, attr, alias: Incomplete | None = ...) -> loader_option: ... +@loader_option() +def load_only(loadopt: Load, *attrs) -> loader_option: ... +@loader_option() +def joinedload(loadopt, attr, innerjoin=None): ... +@loader_option() +def subqueryload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def selectinload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def lazyload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def immediateload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def noload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def raiseload(loadopt: Load, attr, sql_only: bool = ...) -> loader_option: ... +@loader_option() +def defaultload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def defer(loadopt: Load, key, raiseload: bool = ...) -> loader_option: ... +@loader_option() +def undefer(loadopt: Load, key) -> loader_option: ... +@loader_option() +def undefer_group(loadopt: Load, name) -> loader_option: ... +@loader_option() +def with_expression(loadopt: Load, key) -> loader_option: ... +@loader_option() +def selectin_polymorphic(loadopt: Load, classes) -> loader_option: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index bec851be3da1..fa82409a6acb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,11 +1,18 @@ from _typeshed import Incomplete, Self from collections.abc import Callable from logging import Logger -from typing import Generic, Protocol, TypeVar +from typing import Any, Generic, NoReturn, TypeVar +from typing_extensions import TypeAlias +from sqlalchemy.engine.interfaces import Connectable from sqlalchemy.engine.url import URL from sqlalchemy.testing.config import Config +_Unused: TypeAlias = object +_S = TypeVar("_S", bound=str) +_U = TypeVar("_U", bound=URL) +_F = TypeVar("_F", bound=Callable[..., str | URL | None]) + log: Logger FOLLOWER_IDENT: Incomplete | None @@ -16,96 +23,41 @@ def generate_db_urls(db_urls, extra_drivers) -> None: ... def drop_all_schema_objects(cfg, eng) -> None: ... def reap_dbs(idents_file) -> None: ... -### -# The methods below are decorated with the method register.init -# They dynamically become instances of register, -# wich is callable with their original parameters. -# -# While both mypy and pyright's validation work, Pylance is unable to -# show the parameters and return types without a hacky workaround. -### - -_F = TypeVar("_F", bound=Callable[..., str | URL | None]) -_S = TypeVar("_S", bound=str) - class register(Generic[_F]): fns: dict[str, _F] @classmethod def init(cls: type[Self], fn: _F) -> Self: ... def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... - __call__: _F - -class _generate_driver_url(Protocol): - def __call__(self, url: URL, driver, query_str) -> URL | None: ... - -generate_driver_url: register[_generate_driver_url] - -class _drop_all_schema_objects_pre_tables(Protocol): - def __call__(self, cfg, eng) -> None: ... - -drop_all_schema_objects_pre_tables: register[_drop_all_schema_objects_pre_tables] - -class _drop_all_schema_objects_post_tables(Protocol): - def __call__(self, cfg, eng) -> None: ... - -drop_all_schema_objects_post_tables: register[_drop_all_schema_objects_post_tables] - -class _create_db(Protocol): - def __call__(self, cfg, eng, ident) -> None: ... - -create_db: register[_create_db] - -class _drop_db(Protocol): - def __call__(self, cfg, eng, ident) -> None: ... - -drop_db: register[_drop_db] - -class _update_db_opts(Protocol): - def __call__(self, cfg, db_opts) -> None: ... - -update_db_opts: register[_update_db_opts] - -class _post_configure_engine(Protocol): - def __call__(self, url: URL, engine, follower_ident) -> None: ... - -post_configure_engine: register[_post_configure_engine] - -class _follower_url_from_main(Protocol): - def __call__(self, url: URL, ident) -> URL: ... - -follower_url_from_main: register[_follower_url_from_main] - -class _configure_follower(Protocol): - def __call__(self, cfg, ident) -> None: ... - -configure_follower: register[_configure_follower] - -class _run_reap_dbs(Protocol): - def __call__(self, url: URL, ident) -> None: ... - -run_reap_dbs: register[_run_reap_dbs] - -class _temp_table_keyword_args(Protocol): - def __call__(self, cfg, eng) -> None: ... - -temp_table_keyword_args: register[_temp_table_keyword_args] - -class _prepare_for_drop_tables(Protocol): - def __call__(self, config, connection) -> None: ... - -prepare_for_drop_tables: register[_prepare_for_drop_tables] - -class _stop_test_class_outside_fixtures(Protocol): - def __call__(self, config, db, testcls) -> None: ... - -stop_test_class_outside_fixtures: register[_stop_test_class_outside_fixtures] - -class _get_temp_table_name(Protocol): - def __call__(self, cfg, eng, base_name: _S) -> _S: ... - -get_temp_table_name: register[_get_temp_table_name] # type: ignore[type-var] # _S is bound to string - -class _set_default_schema_on_connection(Protocol): - def __call__(self, cfg, dbapi_connection, schema_name) -> None: ... - -set_default_schema_on_connection: register[_set_default_schema_on_connection] + # Impossible to specify the args from the generic Callable in the current type system + def __call__(self, cfg: str | URL, *arg: Any) -> str | URL | None: ... + +@register.init +def generate_driver_url(url: _U, driver: str, query_str: str) -> _U | None: ... +@register.init +def drop_all_schema_objects_pre_tables(cfg: _Unused, eng: _Unused) -> None: ... +@register.init +def drop_all_schema_objects_post_tables(cfg: _Unused, eng: _Unused) -> None: ... +@register.init +def create_db(cfg: _Unused, eng: Connectable, ident: _Unused) -> NoReturn: ... +@register.init +def drop_db(cfg: _Unused, eng: Connectable, ident: _Unused) -> NoReturn: ... +@register.init +def update_db_opts(db_url: _Unused, db_opts: _Unused) -> None: ... +@register.init +def post_configure_engine(url: _Unused, engine: _Unused, follower_ident: _Unused) -> None: ... +@register.init +def follower_url_from_main(url: _U, ident) -> _U: ... +@register.init +def configure_follower(cfg: _Unused, ident: _Unused) -> None: ... +@register.init +def run_reap_dbs(url: _Unused, ident: _Unused) -> None: ... +@register.init +def temp_table_keyword_args(cfg: _Unused, eng: Connectable) -> NoReturn: ... +@register.init +def prepare_for_drop_tables(config: _Unused, connection: _Unused) -> None: ... +@register.init +def stop_test_class_outside_fixtures(config: _Unused, db: _Unused, testcls: _Unused) -> None: ... +@register.init # type: ignore[type-var] # False-positive, _S is bound to str +def get_temp_table_name(cfg: _Unused, eng: _Unused, base_name: _S) -> _S: ... +@register.init +def set_default_schema_on_connection(cfg, dbapi_connection: _Unused, schema_name: _Unused) -> NoReturn: ... From 597d925b688596940623898a3527b221ffaf1764 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 30 Jan 2023 10:30:49 -0500 Subject: [PATCH 06/19] Tests with showing limitaitons --- .../@tests/test_cases/check_loader_option.py | 58 +++++++++++ .../@tests/test_cases/check_register.py | 96 +++++++++++++++++++ stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi | 2 +- .../sqlalchemy/testing/provision.pyi | 12 +-- 4 files changed, 161 insertions(+), 7 deletions(-) create mode 100644 stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py create mode 100644 stubs/SQLAlchemy/@tests/test_cases/check_register.py diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py b/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py new file mode 100644 index 000000000000..43444ac00974 --- /dev/null +++ b/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py @@ -0,0 +1,58 @@ +from typing_extensions import assert_type + +from sqlalchemy.orm.strategy_options import ( + Load, + contains_eager, + defaultload, + defer, + immediateload, + joinedload, + lazyload, + load_only, + loader_option, + noload, + raiseload, + selectin_polymorphic, + selectinload, + subqueryload, + undefer, + undefer_group, + with_expression, +) + + +def fn(loadopt: Load, *args: object) -> loader_option: + return loader_option() + + +# Testing that the function and return type of function are actually all instances of "loader_option" +assert_type(contains_eager, loader_option) +assert_type(contains_eager(fn), loader_option) +assert_type(load_only, loader_option) +assert_type(load_only(fn), loader_option) +assert_type(joinedload, loader_option) +assert_type(joinedload(fn), loader_option) +assert_type(subqueryload, loader_option) +assert_type(subqueryload(fn), loader_option) +assert_type(selectinload, loader_option) +assert_type(selectinload(fn), loader_option) +assert_type(lazyload, loader_option) +assert_type(lazyload(fn), loader_option) +assert_type(immediateload, loader_option) +assert_type(immediateload(fn), loader_option) +assert_type(noload, loader_option) +assert_type(noload(fn), loader_option) +assert_type(raiseload, loader_option) +assert_type(raiseload(fn), loader_option) +assert_type(defaultload, loader_option) +assert_type(defaultload(fn), loader_option) +assert_type(defer, loader_option) +assert_type(defer(fn), loader_option) +assert_type(undefer, loader_option) +assert_type(undefer(fn), loader_option) +assert_type(undefer_group, loader_option) +assert_type(undefer_group(fn), loader_option) +assert_type(with_expression, loader_option) +assert_type(with_expression(fn), loader_option) +assert_type(selectin_polymorphic, loader_option) +assert_type(selectin_polymorphic(fn), loader_option) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py new file mode 100644 index 000000000000..63d630717ac6 --- /dev/null +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections import Callable +from typing import NoReturn, Optional, Union +from typing_extensions import assert_type + +from sqlalchemy.engine.base import Connection +from sqlalchemy.engine.interfaces import Connectable +from sqlalchemy.engine.url import URL +from sqlalchemy.testing.config import Config +from sqlalchemy.testing.provision import ( + _S, + _U, + configure_follower, + create_db, + drop_all_schema_objects_post_tables, + drop_all_schema_objects_pre_tables, + drop_db, + follower_url_from_main, + generate_driver_url, + get_temp_table_name, + post_configure_engine, + prepare_for_drop_tables, + register, + run_reap_dbs, + set_default_schema_on_connection, + stop_test_class_outside_fixtures, + temp_table_keyword_args, + update_db_opts, +) + +config: Config +url: URL +engine: Connectable +connection: Connection + +# # Expression is of type "register[Callable[[object, object], None]]", not "register[Callable[[object, object], None]]" [assert-type] + +# Testing that the functions are actually all instances of "register" +assert_type(generate_driver_url, register[Callable[[_U, str, str], Optional[_U]]]) +assert_type(drop_all_schema_objects_pre_tables, register[Callable[[object, object], None]]) +assert_type(drop_all_schema_objects_post_tables, register[Callable[[object, object], None]]) +assert_type(create_db, register[Callable[[object, Connectable, object], NoReturn]]) +assert_type(drop_db, register[Callable[[object, Connectable, object], NoReturn]]) +assert_type(update_db_opts, register) +assert_type(post_configure_engine, register) +assert_type(follower_url_from_main, register) +assert_type(configure_follower, register) +assert_type(run_reap_dbs, register) +assert_type(temp_table_keyword_args, register) +assert_type(prepare_for_drop_tables, register) +assert_type(stop_test_class_outside_fixtures, register) +assert_type(get_temp_table_name, register) +assert_type(set_default_schema_on_connection, register) + +# Because it's impossible to define register.__call__ return type through the use of a decorator, +# we can't use assert_type to test that teh right type would be returned, (it always expects Union[str, URL, None]) + +assert_type(generate_driver_url(url, ""), Optional[URL]) # type: ignore[assert-type] +assert_type(drop_all_schema_objects_pre_tables(url, engine), None) +assert_type(drop_all_schema_objects_post_tables(url, engine), None) +assert_type(create_db(url, engine, ""), NoReturn) +assert_type(drop_db(url, engine, ""), NoReturn) +assert_type(update_db_opts(url, {}), None) +assert_type(post_configure_engine(url, engine, ""), None) +assert_type(follower_url_from_main(url, ""), URL) +assert_type(configure_follower(url, ""), None) +assert_type(run_reap_dbs(url, ""), None) +assert_type(temp_table_keyword_args(url, engine), NoReturn) +assert_type(prepare_for_drop_tables(url, connection), None) +assert_type(stop_test_class_outside_fixtures(url, connection, type), None) +assert_type(get_temp_table_name(url, engine, ""), str) +assert_type(set_default_schema_on_connection(url, connection, ""), NoReturn) + +# The decorator changes the first parameter to "cfg: str | URL" +@register.init +def no_args(foo: int) -> None: + pass + + +no_args(cfg=url) +generate_driver_url(url, "") +drop_all_schema_objects_pre_tables(url, engine) +drop_all_schema_objects_post_tables(url, engine) +create_db(url, engine, "") +drop_db(url, engine, "") +update_db_opts(url, {}) +post_configure_engine(url, engine, "") +follower_url_from_main(url, "") +configure_follower(url, "") +run_reap_dbs(url, "") +temp_table_keyword_args(url, engine) +prepare_for_drop_tables(url, connection) +stop_test_class_outside_fixtures(url, connection, type) +get_temp_table_name(url, engine, "") +set_default_schema_on_connection(url, connection, "") diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi index 8938a45ad691..c54ea44d0485 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi @@ -13,7 +13,7 @@ _DeclT = TypeVar("_DeclT", bound=type[_DeclarativeBase]) # Dynamic class as created by registry.generate_base() via DeclarativeMeta # or another metaclass. This class does not exist at runtime. -class _DeclarativeBase(Any): # super classes are dynamic +class _DeclarativeBase(Any): # type: ignore[misc] # super classes are dynamic registry: ClassVar[registry] metadata: ClassVar[MetaData] __abstract__: ClassVar[bool] diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index fa82409a6acb..d6784e405e9f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -2,11 +2,11 @@ from _typeshed import Incomplete, Self from collections.abc import Callable from logging import Logger from typing import Any, Generic, NoReturn, TypeVar -from typing_extensions import TypeAlias +from typing_extensions import TypeAlias, reveal_type -from sqlalchemy.engine.interfaces import Connectable -from sqlalchemy.engine.url import URL -from sqlalchemy.testing.config import Config +from ..engine.interfaces import Connectable +from ..engine.url import URL +from ..testing.config import Config _Unused: TypeAlias = object _S = TypeVar("_S", bound=str) @@ -29,7 +29,7 @@ class register(Generic[_F]): def init(cls: type[Self], fn: _F) -> Self: ... def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... # Impossible to specify the args from the generic Callable in the current type system - def __call__(self, cfg: str | URL, *arg: Any) -> str | URL | None: ... + def __call__(self, cfg: str | URL, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] @register.init def generate_driver_url(url: _U, driver: str, query_str: str) -> _U | None: ... @@ -46,7 +46,7 @@ def update_db_opts(db_url: _Unused, db_opts: _Unused) -> None: ... @register.init def post_configure_engine(url: _Unused, engine: _Unused, follower_ident: _Unused) -> None: ... @register.init -def follower_url_from_main(url: _U, ident) -> _U: ... +def follower_url_from_main(url: _U, ident: str) -> _U: ... @register.init def configure_follower(cfg: _Unused, ident: _Unused) -> None: ... @register.init From 6a5ca2c9166d7629dc33eaae85f0f77f599d0c8d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:32:22 +0000 Subject: [PATCH 07/19] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/SQLAlchemy/@tests/test_cases/check_register.py | 3 +-- stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index 63d630717ac6..98dc046420ef 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections import Callable -from typing import NoReturn, Optional, Union +from typing import NoReturn, Optional from typing_extensions import assert_type from sqlalchemy.engine.base import Connection @@ -9,7 +9,6 @@ from sqlalchemy.engine.url import URL from sqlalchemy.testing.config import Config from sqlalchemy.testing.provision import ( - _S, _U, configure_follower, create_db, diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index d6784e405e9f..e32fec0eaee4 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete, Self from collections.abc import Callable from logging import Logger from typing import Any, Generic, NoReturn, TypeVar -from typing_extensions import TypeAlias, reveal_type +from typing_extensions import TypeAlias from ..engine.interfaces import Connectable from ..engine.url import URL From 5d35846c0c378ce183820eea67f14a76ae5ad6bc Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 30 Jan 2023 10:40:11 -0500 Subject: [PATCH 08/19] Remove test limitation demo --- .../@tests/test_cases/check_register.py | 48 ------------------- 1 file changed, 48 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index 63d630717ac6..ab585fc81f67 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -1,16 +1,7 @@ -from __future__ import annotations - -from collections import Callable -from typing import NoReturn, Optional, Union -from typing_extensions import assert_type - from sqlalchemy.engine.base import Connection from sqlalchemy.engine.interfaces import Connectable from sqlalchemy.engine.url import URL -from sqlalchemy.testing.config import Config from sqlalchemy.testing.provision import ( - _S, - _U, configure_follower, create_db, drop_all_schema_objects_post_tables, @@ -29,49 +20,10 @@ update_db_opts, ) -config: Config url: URL engine: Connectable connection: Connection -# # Expression is of type "register[Callable[[object, object], None]]", not "register[Callable[[object, object], None]]" [assert-type] - -# Testing that the functions are actually all instances of "register" -assert_type(generate_driver_url, register[Callable[[_U, str, str], Optional[_U]]]) -assert_type(drop_all_schema_objects_pre_tables, register[Callable[[object, object], None]]) -assert_type(drop_all_schema_objects_post_tables, register[Callable[[object, object], None]]) -assert_type(create_db, register[Callable[[object, Connectable, object], NoReturn]]) -assert_type(drop_db, register[Callable[[object, Connectable, object], NoReturn]]) -assert_type(update_db_opts, register) -assert_type(post_configure_engine, register) -assert_type(follower_url_from_main, register) -assert_type(configure_follower, register) -assert_type(run_reap_dbs, register) -assert_type(temp_table_keyword_args, register) -assert_type(prepare_for_drop_tables, register) -assert_type(stop_test_class_outside_fixtures, register) -assert_type(get_temp_table_name, register) -assert_type(set_default_schema_on_connection, register) - -# Because it's impossible to define register.__call__ return type through the use of a decorator, -# we can't use assert_type to test that teh right type would be returned, (it always expects Union[str, URL, None]) - -assert_type(generate_driver_url(url, ""), Optional[URL]) # type: ignore[assert-type] -assert_type(drop_all_schema_objects_pre_tables(url, engine), None) -assert_type(drop_all_schema_objects_post_tables(url, engine), None) -assert_type(create_db(url, engine, ""), NoReturn) -assert_type(drop_db(url, engine, ""), NoReturn) -assert_type(update_db_opts(url, {}), None) -assert_type(post_configure_engine(url, engine, ""), None) -assert_type(follower_url_from_main(url, ""), URL) -assert_type(configure_follower(url, ""), None) -assert_type(run_reap_dbs(url, ""), None) -assert_type(temp_table_keyword_args(url, engine), NoReturn) -assert_type(prepare_for_drop_tables(url, connection), None) -assert_type(stop_test_class_outside_fixtures(url, connection, type), None) -assert_type(get_temp_table_name(url, engine, ""), str) -assert_type(set_default_schema_on_connection(url, connection, ""), NoReturn) - # The decorator changes the first parameter to "cfg: str | URL" @register.init def no_args(foo: int) -> None: From 36952cd9fc2c4cdd8183a0ba5bd103c48f3b651d Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 30 Jan 2023 10:43:38 -0500 Subject: [PATCH 09/19] Ensure modern syntax --- stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py | 2 ++ stubs/SQLAlchemy/@tests/test_cases/check_register.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py b/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py index 43444ac00974..1f596af83356 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing_extensions import assert_type from sqlalchemy.orm.strategy_options import ( diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index ab585fc81f67..2cc2b423aa02 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from sqlalchemy.engine.base import Connection from sqlalchemy.engine.interfaces import Connectable from sqlalchemy.engine.url import URL From 952f8a7cfd2eab70cc8dd764ae8e3f414bcefa2c Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 30 Jan 2023 11:29:55 -0500 Subject: [PATCH 10/19] fix pyrigth test_cases --- .../@tests/test_cases/check_register.py | 41 +++++++++++-------- stubs/SQLAlchemy/sqlalchemy/pool/base.pyi | 4 +- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index 2cc2b423aa02..57498c44ea44 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -1,8 +1,12 @@ from __future__ import annotations -from sqlalchemy.engine.base import Connection -from sqlalchemy.engine.interfaces import Connectable +from _typeshed.dbapi import DBAPIConnection +from typing import cast + +from sqlalchemy.engine.base import Engine +from sqlalchemy.engine.default import DefaultDialect from sqlalchemy.engine.url import URL +from sqlalchemy.pool.base import Pool from sqlalchemy.testing.provision import ( configure_follower, create_db, @@ -21,10 +25,11 @@ temp_table_keyword_args, update_db_opts, ) +from sqlalchemy.util import immutabledict -url: URL -engine: Connectable -connection: Connection +url = URL("", "", "", "", 0, "", immutabledict()) +engine = Engine(Pool(lambda: cast(DBAPIConnection, object())), DefaultDialect(), "") +unused = None # The decorator changes the first parameter to "cfg: str | URL" @register.init @@ -33,18 +38,18 @@ def no_args(foo: int) -> None: no_args(cfg=url) -generate_driver_url(url, "") -drop_all_schema_objects_pre_tables(url, engine) -drop_all_schema_objects_post_tables(url, engine) -create_db(url, engine, "") -drop_db(url, engine, "") -update_db_opts(url, {}) -post_configure_engine(url, engine, "") +generate_driver_url(url, "", "") +drop_all_schema_objects_pre_tables(url, unused) +drop_all_schema_objects_post_tables(url, unused) +create_db(url, engine, unused) +drop_db(url, engine, unused) +update_db_opts(url, unused) +post_configure_engine(url, unused, unused) follower_url_from_main(url, "") -configure_follower(url, "") -run_reap_dbs(url, "") +configure_follower(url, unused) +run_reap_dbs(url, unused) temp_table_keyword_args(url, engine) -prepare_for_drop_tables(url, connection) -stop_test_class_outside_fixtures(url, connection, type) -get_temp_table_name(url, engine, "") -set_default_schema_on_connection(url, connection, "") +prepare_for_drop_tables(url, unused) +stop_test_class_outside_fixtures(url, unused, type) +get_temp_table_name(url, unused, "") +set_default_schema_on_connection(url, unused, unused) diff --git a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi index b169e6d8e166..14e6e99b8afc 100644 --- a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi @@ -1,4 +1,6 @@ from _typeshed import Incomplete +from _typeshed.dbapi import DBAPIConnection +from collections.abc import Callable from typing import Any from .. import log @@ -24,7 +26,7 @@ class Pool(log.Identified): echo: Any def __init__( self, - creator, + creator: Callable[[], DBAPIConnection], recycle: int = ..., echo: Incomplete | None = ..., logging_name: Incomplete | None = ..., From 724e24851985f07c3938d08156c8461dbdf136ac Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 30 Jan 2023 11:38:05 -0500 Subject: [PATCH 11/19] Even better first arg check --- stubs/SQLAlchemy/@tests/test_cases/check_register.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index 57498c44ea44..41ad1f1d1ae5 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -31,9 +31,14 @@ engine = Engine(Pool(lambda: cast(DBAPIConnection, object())), DefaultDialect(), "") unused = None + +class Foo: + pass + + # The decorator changes the first parameter to "cfg: str | URL" @register.init -def no_args(foo: int) -> None: +def no_args(__foo: Foo) -> None: pass From 710ee2a874c1751f7c3cadadb04d3019f20deadd Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 7 Feb 2023 19:48:53 -0500 Subject: [PATCH 12/19] Fix new pyright error --- stubs/SQLAlchemy/@tests/test_cases/check_register.py | 3 ++- stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index 41ad1f1d1ae5..fa732b72566a 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -7,6 +7,7 @@ from sqlalchemy.engine.default import DefaultDialect from sqlalchemy.engine.url import URL from sqlalchemy.pool.base import Pool +from sqlalchemy.testing import config from sqlalchemy.testing.provision import ( configure_follower, create_db, @@ -57,4 +58,4 @@ def no_args(__foo: Foo) -> None: prepare_for_drop_tables(url, unused) stop_test_class_outside_fixtures(url, unused, type) get_temp_table_name(url, unused, "") -set_default_schema_on_connection(url, unused, unused) +set_default_schema_on_connection(config, unused, unused) diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index e32fec0eaee4..cfb5939c123d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,12 +1,13 @@ from _typeshed import Incomplete, Self from collections.abc import Callable from logging import Logger +from types import ModuleType from typing import Any, Generic, NoReturn, TypeVar from typing_extensions import TypeAlias from ..engine.interfaces import Connectable from ..engine.url import URL -from ..testing.config import Config +from .config import Config _Unused: TypeAlias = object _S = TypeVar("_S", bound=str) @@ -29,7 +30,7 @@ class register(Generic[_F]): def init(cls: type[Self], fn: _F) -> Self: ... def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... # Impossible to specify the args from the generic Callable in the current type system - def __call__(self, cfg: str | URL, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] + def __call__(self, cfg: str | URL | ModuleType, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] @register.init def generate_driver_url(url: _U, driver: str, query_str: str) -> _U | None: ... @@ -59,5 +60,7 @@ def prepare_for_drop_tables(config: _Unused, connection: _Unused) -> None: ... def stop_test_class_outside_fixtures(config: _Unused, db: _Unused, testcls: _Unused) -> None: ... @register.init # type: ignore[type-var] # False-positive, _S is bound to str def get_temp_table_name(cfg: _Unused, eng: _Unused, base_name: _S) -> _S: ... + +# Expects the "sqlalchemy.testing.provision.config" module @register.init -def set_default_schema_on_connection(cfg, dbapi_connection: _Unused, schema_name: _Unused) -> NoReturn: ... +def set_default_schema_on_connection(cfg: ModuleType, dbapi_connection: _Unused, schema_name: _Unused) -> NoReturn: ... From 63e819ff84fb930f67af259dd8b6f6ab83968882 Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 7 Feb 2023 20:09:42 -0500 Subject: [PATCH 13/19] Use a module protocol --- .../@tests/test_cases/check_register.py | 10 ++++++++-- stubs/SQLAlchemy/sqlalchemy/testing/config.pyi | 15 ++++++++++++--- stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi | 9 +++------ 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index fa732b72566a..5f76ccd454b7 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -7,7 +7,7 @@ from sqlalchemy.engine.default import DefaultDialect from sqlalchemy.engine.url import URL from sqlalchemy.pool.base import Pool -from sqlalchemy.testing import config +from sqlalchemy.testing import config as ConfigModule from sqlalchemy.testing.provision import ( configure_follower, create_db, @@ -30,6 +30,7 @@ url = URL("", "", "", "", 0, "", immutabledict()) engine = Engine(Pool(lambda: cast(DBAPIConnection, object())), DefaultDialect(), "") +config = cast(ConfigModule.Config, object()) unused = None @@ -37,13 +38,17 @@ class Foo: pass -# The decorator changes the first parameter to "cfg: str | URL" +# The decorator changes the first parameter to "cfg: str | URL | _ConfigProtocol" @register.init def no_args(__foo: Foo) -> None: pass +no_args(cfg="") no_args(cfg=url) +no_args(cfg=config) + +# Test pre-decorated functions generate_driver_url(url, "", "") drop_all_schema_objects_pre_tables(url, unused) drop_all_schema_objects_post_tables(url, unused) @@ -58,4 +63,5 @@ def no_args(__foo: Foo) -> None: prepare_for_drop_tables(url, unused) stop_test_class_outside_fixtures(url, unused, type) get_temp_table_name(url, unused, "") +set_default_schema_on_connection(ConfigModule, unused, unused) set_default_schema_on_connection(config, unused, unused) diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi index dca81e31185f..38193d6fd3ea 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi @@ -1,12 +1,12 @@ -from typing import Any +from typing import Any, Protocol requirements: Any db: Any db_url: Any db_opts: Any file_config: Any -test_schema: Any -test_schema_2: Any +test_schema: str +test_schema_2: str any_async: bool ident: str @@ -16,6 +16,15 @@ def fixture(*arg, **kw): ... def get_current_test_name(): ... def mark_base_test_class(): ... +# Matches the intersection of the config module and the Config class +class _ConfigProtocol(Protocol): # noqa: Y046 + db: Any + db_opts: Any + file_config: Any + test_schema: str + test_schema_2: str + def skip_test(self, msg) -> None: ... + class Config: db: Any db_opts: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index cfb5939c123d..2e2049d36844 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,13 +1,12 @@ from _typeshed import Incomplete, Self from collections.abc import Callable from logging import Logger -from types import ModuleType from typing import Any, Generic, NoReturn, TypeVar from typing_extensions import TypeAlias from ..engine.interfaces import Connectable from ..engine.url import URL -from .config import Config +from .config import Config, _ConfigProtocol _Unused: TypeAlias = object _S = TypeVar("_S", bound=str) @@ -30,7 +29,7 @@ class register(Generic[_F]): def init(cls: type[Self], fn: _F) -> Self: ... def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... # Impossible to specify the args from the generic Callable in the current type system - def __call__(self, cfg: str | URL | ModuleType, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] + def __call__(self, cfg: str | URL | _ConfigProtocol, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] @register.init def generate_driver_url(url: _U, driver: str, query_str: str) -> _U | None: ... @@ -60,7 +59,5 @@ def prepare_for_drop_tables(config: _Unused, connection: _Unused) -> None: ... def stop_test_class_outside_fixtures(config: _Unused, db: _Unused, testcls: _Unused) -> None: ... @register.init # type: ignore[type-var] # False-positive, _S is bound to str def get_temp_table_name(cfg: _Unused, eng: _Unused, base_name: _S) -> _S: ... - -# Expects the "sqlalchemy.testing.provision.config" module @register.init -def set_default_schema_on_connection(cfg: ModuleType, dbapi_connection: _Unused, schema_name: _Unused) -> NoReturn: ... +def set_default_schema_on_connection(cfg: _ConfigProtocol, dbapi_connection: _Unused, schema_name: _Unused) -> NoReturn: ... From 7f99f3a8010453a73c53666eaf84f9bc9ad0111f Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 7 Feb 2023 20:24:04 -0500 Subject: [PATCH 14/19] Fix stubtest --- .../SQLAlchemy/sqlalchemy/testing/config.pyi | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi index 38193d6fd3ea..c787b8c731fe 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi @@ -1,12 +1,13 @@ +from _typeshed import Incomplete from typing import Any, Protocol -requirements: Any -db: Any -db_url: Any -db_opts: Any -file_config: Any -test_schema: str -test_schema_2: str +requirements: Incomplete | None +db: Incomplete | None +db_url: Incomplete | None +db_opts: Incomplete | None +file_config: Incomplete | None +test_schema: str | None +test_schema_2: str | None any_async: bool ident: str @@ -18,21 +19,21 @@ def mark_base_test_class(): ... # Matches the intersection of the config module and the Config class class _ConfigProtocol(Protocol): # noqa: Y046 - db: Any - db_opts: Any - file_config: Any - test_schema: str - test_schema_2: str + db: Incomplete + db_opts: Incomplete + file_config: Incomplete + test_schema: Any # AnyOf[str, None] + test_schema_2: Any # AnyOf[str, None] def skip_test(self, msg) -> None: ... class Config: - db: Any - db_opts: Any - options: Any - file_config: Any + db: Incomplete + db_opts: Incomplete + options: Incomplete + file_config: Incomplete test_schema: str test_schema_2: str - is_async: Any + is_async: Incomplete def __init__(self, db, db_opts, options, file_config) -> None: ... @classmethod def register(cls, db, db_opts, options, file_config) -> Config: ... From e96e15c252d54c514885d021495ed97cb8d1dc18 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 16 Mar 2023 15:29:49 +0000 Subject: [PATCH 15/19] Update stubs/SQLAlchemy/sqlalchemy/engine/url.pyi --- stubs/SQLAlchemy/sqlalchemy/engine/url.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index 86ca63294a9b..0a4c48a085ea 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -22,7 +22,7 @@ class _URLTuple(NamedTuple): _Query: TypeAlias = Mapping[str, str | Sequence[str]] | Sequence[tuple[str, str | Sequence[str]]] class URL(_URLTuple): - def __new__(self: type[Self], *arg, **kw) -> Self | URL: ... + def __new__(self, *arg, **kw) -> Self | URL: ... @classmethod def create( cls, From 6e7f6cc8b7c1923419bfc8b520c93b3a77abeffe Mon Sep 17 00:00:00 2001 From: Avasam Date: Wed, 22 Mar 2023 13:12:57 -0400 Subject: [PATCH 16/19] Update usage of Self --- .../@tests/test_cases/check_register.py | 2 +- .../sqlalchemy/orm/strategy_options.pyi | 45 ++++++++++--------- .../sqlalchemy/testing/provision.pyi | 8 ++-- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index 5f76ccd454b7..28503f022216 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -38,7 +38,7 @@ class Foo: pass -# The decorator changes the first parameter to "cfg: str | URL | _ConfigProtocol" +# Test that the decorator changes the first parameter to "cfg: str | URL | _ConfigProtocol" @register.init def no_args(__foo: Foo) -> None: pass diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index c83a4c9dab9b..cf9761cfb3ee 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable from typing import Any +from typing_extensions import Self from ..sql.base import Generative from .interfaces import LoaderOption @@ -18,27 +19,27 @@ class Load(Generative, LoaderOption): propagate_to_loaders: bool def process_compile_state_replaced_entities(self, compile_state, mapper_entities) -> None: ... def process_compile_state(self, compile_state) -> None: ... - def options(self: Self, *opts) -> Self: ... - def set_relationship_strategy(self: Self, attr, strategy, propagate_to_loaders: bool = ...) -> Self: ... - def set_column_strategy(self: Self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> Self: ... - def set_generic_strategy(self: Self, attrs, strategy) -> Self: ... - def set_class_strategy(self: Self, strategy, opts) -> Self: ... + def options(self, *opts) -> Self: ... + def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = ...) -> Self: ... + def set_column_strategy(self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> Self: ... + def set_generic_strategy(self, attrs, strategy) -> Self: ... + def set_class_strategy(self, strategy, opts) -> Self: ... # Added dynamically at runtime - def contains_eager(loadopt: Self, attr, alias: Incomplete | None = ...) -> Self: ... - def load_only(loadopt: Self, *attrs) -> Self: ... - def joinedload(loadopt: Self, attr, innerjoin: Incomplete | None = ...) -> Self: ... - def subqueryload(loadopt: Self, attr) -> Self: ... - def selectinload(loadopt: Self, attr) -> Self: ... - def lazyload(loadopt: Self, attr) -> Self: ... - def immediateload(loadopt: Self, attr) -> Self: ... - def noload(loadopt: Self, attr) -> Self: ... - def raiseload(loadopt: Self, attr, sql_only: bool = ...) -> Self: ... - def defaultload(loadopt: Self, attr) -> Self: ... - def defer(loadopt: Self, key, raiseload: bool = ...) -> Self: ... - def undefer(loadopt: Self, key) -> Self: ... - def undefer_group(loadopt: Self, name) -> Self: ... - def with_expression(loadopt: Self, key, expression) -> Self: ... - def selectin_polymorphic(loadopt: Self, classes) -> Self: ... + def contains_eager(loadopt, attr, alias: Incomplete | None = ...) -> Self: ... + def load_only(loadopt, *attrs) -> Self: ... + def joinedload(loadopt, attr, innerjoin: Incomplete | None = ...) -> Self: ... + def subqueryload(loadopt, attr) -> Self: ... + def selectinload(loadopt, attr) -> Self: ... + def lazyload(loadopt, attr) -> Self: ... + def immediateload(loadopt, attr) -> Self: ... + def noload(loadopt, attr) -> Self: ... + def raiseload(loadopt, attr, sql_only: bool = ...) -> Self: ... + def defaultload(loadopt, attr) -> Self: ... + def defer(loadopt, key, raiseload: bool = ...) -> Self: ... + def undefer(loadopt, key) -> Self: ... + def undefer_group(loadopt, name) -> Self: ... + def with_expression(loadopt, key, expression) -> Self: ... + def selectin_polymorphic(loadopt, classes) -> Self: ... class _UnboundLoad(Load): path: Any @@ -49,7 +50,7 @@ class loader_option: name: str # The first parameter of this Callable should always be `loadopt: Load` fn: Callable[..., loader_option] - def __call__(self: Self, fn: Callable[..., loader_option]) -> Self: ... + def __call__(self, fn: Callable[..., loader_option]) -> Self: ... # loader_option instances that can be used to dynamically add methods to Load at runtime @loader_option() diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index 2e2049d36844..8029cd4e9851 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,8 +1,8 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable from logging import Logger from typing import Any, Generic, NoReturn, TypeVar -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from ..engine.interfaces import Connectable from ..engine.url import URL @@ -26,8 +26,8 @@ def reap_dbs(idents_file) -> None: ... class register(Generic[_F]): fns: dict[str, _F] @classmethod - def init(cls: type[Self], fn: _F) -> Self: ... - def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... + def init(cls, fn: _F) -> Self: ... + def for_db(self, *dbnames: str) -> Callable[[_F], Self]: ... # Impossible to specify the args from the generic Callable in the current type system def __call__(self, cfg: str | URL | _ConfigProtocol, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] From e266ef7f401e5f9ed23462f3d6a8e984293317d5 Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 31 Mar 2023 15:17:44 -0400 Subject: [PATCH 17/19] Ran stubdefaulter before merge --- .../SQLAlchemy/sqlalchemy/cimmutabledict.pyi | 2 +- .../sqlalchemy/connectors/mxodbc.pyi | 4 +- .../sqlalchemy/connectors/pyodbc.pyi | 2 +- .../sqlalchemy/dialects/firebird/base.pyi | 28 +-- .../sqlalchemy/dialects/firebird/fdb.pyi | 2 +- .../dialects/firebird/kinterbasdb.pyi | 4 +- .../sqlalchemy/dialects/mssql/base.pyi | 32 +-- .../sqlalchemy/dialects/mssql/mxodbc.pyi | 2 +- .../sqlalchemy/dialects/mssql/pyodbc.pyi | 4 +- .../sqlalchemy/dialects/mysql/aiomysql.pyi | 8 +- .../sqlalchemy/dialects/mysql/asyncmy.pyi | 8 +- .../sqlalchemy/dialects/mysql/base.pyi | 46 ++-- .../dialects/mysql/mariadbconnector.pyi | 4 +- .../sqlalchemy/dialects/mysql/mysqldb.pyi | 4 +- .../sqlalchemy/dialects/mysql/oursql.pyi | 16 +- .../sqlalchemy/dialects/mysql/pymysql.pyi | 2 +- .../sqlalchemy/dialects/mysql/types.pyi | 58 ++--- .../sqlalchemy/dialects/oracle/base.pyi | 48 ++-- .../sqlalchemy/dialects/oracle/cx_oracle.pyi | 18 +- .../sqlalchemy/dialects/postgresql/array.pyi | 4 +- .../dialects/postgresql/asyncpg.pyi | 10 +- .../sqlalchemy/dialects/postgresql/base.pyi | 74 +++--- .../sqlalchemy/dialects/postgresql/dml.pyi | 30 ++- .../sqlalchemy/dialects/postgresql/ext.pyi | 2 +- .../sqlalchemy/dialects/postgresql/hstore.pyi | 2 +- .../sqlalchemy/dialects/postgresql/json.pyi | 2 +- .../sqlalchemy/dialects/postgresql/pg8000.pyi | 12 +- .../dialects/postgresql/psycopg2.pyi | 16 +- .../sqlalchemy/dialects/sqlite/aiosqlite.pyi | 8 +- .../sqlalchemy/dialects/sqlite/base.pyi | 36 +-- .../sqlalchemy/dialects/sqlite/dml.pyi | 20 +- .../sqlalchemy/dialects/sybase/base.pyi | 20 +- .../sqlalchemy/dialects/sybase/pysybase.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/engine/base.pyi | 48 ++-- stubs/SQLAlchemy/sqlalchemy/engine/create.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi | 24 +- .../SQLAlchemy/sqlalchemy/engine/default.pyi | 32 +-- .../sqlalchemy/engine/interfaces.pyi | 42 ++-- .../sqlalchemy/engine/reflection.pyi | 32 +-- stubs/SQLAlchemy/sqlalchemy/engine/result.pyi | 42 ++-- stubs/SQLAlchemy/sqlalchemy/engine/url.pyi | 32 +-- stubs/SQLAlchemy/sqlalchemy/event/base.pyi | 2 +- .../SQLAlchemy/sqlalchemy/event/registry.pyi | 9 +- stubs/SQLAlchemy/sqlalchemy/exc.pyi | 26 +-- .../sqlalchemy/ext/associationproxy.pyi | 28 +-- .../sqlalchemy/ext/asyncio/base.pyi | 2 +- .../sqlalchemy/ext/asyncio/engine.pyi | 24 +- .../sqlalchemy/ext/asyncio/result.pyi | 20 +- .../sqlalchemy/ext/asyncio/scoping.pyi | 34 +-- .../sqlalchemy/ext/asyncio/session.pyi | 40 ++-- stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi | 20 +- stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi | 6 +- .../sqlalchemy/ext/horizontal_shard.pyi | 8 +- stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi | 12 +- stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi | 2 +- .../sqlalchemy/ext/instrumentation.pyi | 6 +- .../sqlalchemy/ext/orderinglist.pyi | 6 +- .../SQLAlchemy/sqlalchemy/ext/serializer.pyi | 8 +- stubs/SQLAlchemy/sqlalchemy/future/engine.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/inspection.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/log.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/attributes.pyi | 72 +++--- stubs/SQLAlchemy/sqlalchemy/orm/base.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/clsregistry.pyi | 4 +- .../SQLAlchemy/sqlalchemy/orm/collections.pyi | 18 +- stubs/SQLAlchemy/sqlalchemy/orm/context.pyi | 12 +- stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi | 42 ++-- stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi | 2 +- .../sqlalchemy/orm/descriptor_props.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi | 18 +- stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi | 6 +- stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi | 4 +- .../sqlalchemy/orm/instrumentation.pyi | 24 +- .../SQLAlchemy/sqlalchemy/orm/interfaces.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi | 26 +-- stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi | 62 +++--- .../sqlalchemy/orm/path_registry.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/persistence.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/query.pyi | 29 ++- .../sqlalchemy/orm/relationships.pyi | 106 ++++----- stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi | 60 ++--- stubs/SQLAlchemy/sqlalchemy/orm/session.pyi | 104 ++++----- .../SQLAlchemy/sqlalchemy/orm/strategies.pyi | 14 +- .../sqlalchemy/orm/strategy_options.pyi | 12 +- .../SQLAlchemy/sqlalchemy/orm/unitofwork.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/orm/util.pyi | 89 ++++---- stubs/SQLAlchemy/sqlalchemy/pool/base.pyi | 24 +- stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/processors.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/sql/base.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi | 6 +- stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi | 186 ++++++++-------- stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi | 56 ++--- stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi | 40 ++-- stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi | 108 ++++----- stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi | 22 +- stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi | 30 +-- stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi | 62 +++--- stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi | 210 +++++++++--------- .../SQLAlchemy/sqlalchemy/sql/selectable.pyi | 114 +++++----- stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi | 70 +++--- .../SQLAlchemy/sqlalchemy/sql/traversals.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/sql/util.pyi | 52 ++--- stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi | 2 +- .../sqlalchemy/testing/assertions.pyi | 76 +++---- .../sqlalchemy/testing/assertsql.pyi | 6 +- .../SQLAlchemy/sqlalchemy/testing/engines.pyi | 30 +-- .../sqlalchemy/testing/exclusions.pyi | 30 +-- .../sqlalchemy/testing/profiling.pyi | 6 +- stubs/SQLAlchemy/sqlalchemy/testing/util.pyi | 8 +- .../sqlalchemy/testing/warnings.pyi | 2 +- .../sqlalchemy/util/_collections.pyi | 22 +- .../sqlalchemy/util/_concurrency_py3k.pyi | 2 +- .../SQLAlchemy/sqlalchemy/util/_preloaded.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/util/compat.pyi | 20 +- .../sqlalchemy/util/deprecations.pyi | 22 +- .../sqlalchemy/util/langhelpers.pyi | 48 ++-- stubs/SQLAlchemy/sqlalchemy/util/queue.pyi | 12 +- .../sqlalchemy/util/topological.pyi | 2 +- 122 files changed, 1569 insertions(+), 1516 deletions(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi b/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi index 9883315dce8d..1a1a3006afc3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi @@ -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]: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi index 350b3df4aa52..3bf803352a7f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi @@ -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: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi index b0b7ce25d32e..7210734f90c5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi @@ -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): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi index 564282e8ec1a..a0d8dd01b5d2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi @@ -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): ... @@ -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 @@ -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): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi index 4bc56c5a6659..c2c7a025a351 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi @@ -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): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi index 09d3dabd6262..7f957f3ceb5e 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi @@ -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): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi index 59d9d16fbc12..2e0acfccc1e8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi @@ -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): ... @@ -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): ... @@ -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): @@ -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 @@ -250,7 +250,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): ... @@ -261,7 +261,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 @@ -295,15 +295,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: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi index ee58d3dec742..2f0a14ffaab6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi @@ -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 diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi index 0ee156b64f52..50d53b123f38 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi @@ -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 diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi index 3dc245d014bb..a91b28976d81 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi @@ -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): @@ -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): @@ -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: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi index 69a9d5576155..16180d5820d1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi @@ -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): @@ -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): @@ -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: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi index 129de51ebaf6..8a36027eb101 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi @@ -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): ... @@ -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 @@ -199,10 +199,10 @@ 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): ... @@ -210,27 +210,27 @@ class MySQLDialect(default.DefaultDialect): 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 diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi index 0735fb75a28e..b4ab06a53fea 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi @@ -30,7 +30,7 @@ class MySQLDialect_mariadbconnector(MySQLDialect): def create_connect_args(self, url): ... 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: ... dialect = MySQLDialect_mariadbconnector diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi index a8479ad8bf33..8daaf59a611f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi @@ -27,7 +27,7 @@ class MySQLDialect_mysqldb(MySQLDialect): def dbapi(cls): ... def on_connect(self): ... def do_ping(self, dbapi_connection): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def create_connect_args(self, url, _translate_args: Incomplete | None = ...): ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def create_connect_args(self, url, _translate_args: Incomplete | None = None): ... dialect = MySQLDialect_mysqldb diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi index 1bc65d97b235..fa7ea6fbe59d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi @@ -21,17 +21,17 @@ class MySQLDialect_oursql(MySQLDialect): colspecs: Any @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_begin(self, connection) -> None: ... 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 has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - 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_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + 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 has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + 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_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... def get_schema_names(self, connection, **kw): ... def initialize(self, connection): ... def is_disconnect(self, e, connection, cursor): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi index fa7a490882a7..f91c2119fcb7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi @@ -14,7 +14,7 @@ class MySQLDialect_pymysql(MySQLDialect_mysqldb): def supports_server_side_cursors(self): ... @classmethod def dbapi(cls): ... - def create_connect_args(self, url, _translate_args: Incomplete | None = ...): ... + def create_connect_args(self, url, _translate_args: Incomplete | None = None): ... def is_disconnect(self, e, connection, cursor): ... dialect = MySQLDialect_pymysql diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi index 5db2c9257995..80e81e150e0f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi @@ -6,17 +6,17 @@ import sqlalchemy.types as sqltypes class _NumericType: unsigned: Any zerofill: Any - def __init__(self, unsigned: bool = ..., zerofill: bool = ..., **kw) -> None: ... + def __init__(self, unsigned: bool = False, zerofill: bool = False, **kw) -> None: ... class _FloatType(_NumericType, sqltypes.Float): scale: Any def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class _IntegerType(_NumericType, sqltypes.Integer): display_width: Any - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class _StringType(sqltypes.String): charset: Any @@ -26,12 +26,12 @@ class _StringType(sqltypes.String): national: Any def __init__( self, - charset: Incomplete | None = ..., - collation: Incomplete | None = ..., - ascii: bool = ..., - binary: bool = ..., - unicode: bool = ..., - national: bool = ..., + charset: Incomplete | None = None, + collation: Incomplete | None = None, + ascii: bool = False, + binary: bool = False, + unicode: bool = False, + national: bool = False, **kw, ) -> None: ... @@ -41,84 +41,84 @@ class _MatchType(sqltypes.Float, sqltypes.MatchType): # type: ignore[misc] # i class NUMERIC(_NumericType, sqltypes.NUMERIC): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class DECIMAL(_NumericType, sqltypes.DECIMAL): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class DOUBLE(_FloatType): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class REAL(_FloatType, sqltypes.REAL): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class FLOAT(_FloatType, sqltypes.FLOAT): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = False, **kw ) -> None: ... def bind_processor(self, dialect) -> None: ... class INTEGER(_IntegerType, sqltypes.INTEGER): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class BIGINT(_IntegerType, sqltypes.BIGINT): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class MEDIUMINT(_IntegerType): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class TINYINT(_IntegerType): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class SMALLINT(_IntegerType, sqltypes.SMALLINT): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class BIT(sqltypes.TypeEngine): __visit_name__: str length: Any - def __init__(self, length: Incomplete | None = ...) -> None: ... + def __init__(self, length: Incomplete | None = None) -> None: ... def result_processor(self, dialect, coltype): ... class TIME(sqltypes.TIME): __visit_name__: str fsp: Any - def __init__(self, timezone: bool = ..., fsp: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, fsp: Incomplete | None = None) -> None: ... def result_processor(self, dialect, coltype): ... class TIMESTAMP(sqltypes.TIMESTAMP): __visit_name__: str fsp: Any - def __init__(self, timezone: bool = ..., fsp: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, fsp: Incomplete | None = None) -> None: ... class DATETIME(sqltypes.DATETIME): __visit_name__: str fsp: Any - def __init__(self, timezone: bool = ..., fsp: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, fsp: Incomplete | None = None) -> None: ... class YEAR(sqltypes.TypeEngine): __visit_name__: str display_width: Any - def __init__(self, display_width: Incomplete | None = ...) -> None: ... + def __init__(self, display_width: Incomplete | None = None) -> None: ... class TEXT(_StringType, sqltypes.TEXT): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, length: Incomplete | None = None, **kw) -> None: ... class TINYTEXT(_StringType): __visit_name__: str @@ -134,19 +134,19 @@ class LONGTEXT(_StringType): 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 NVARCHAR(_StringType, sqltypes.NVARCHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class NCHAR(_StringType, sqltypes.NCHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class TINYBLOB(sqltypes._Binary): __visit_name__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi index 9b41e88b2f2e..cd2bdf53f841 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi @@ -36,7 +36,7 @@ NVARCHAR2 = NVARCHAR class NUMBER(sqltypes.Numeric, sqltypes.Integer): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: Incomplete | None = ... + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: Incomplete | None = None ) -> None: ... def adapt(self, impltype): ... @@ -62,8 +62,8 @@ class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): __visit_name__: str day_precision: Any second_precision: Any - def __init__(self, day_precision: Incomplete | None = ..., second_precision: Incomplete | None = ...) -> None: ... - def as_generic(self, allow_nulltype: bool = ...): ... + def __init__(self, day_precision: Incomplete | None = None, second_precision: Incomplete | None = None) -> None: ... + def as_generic(self, allow_nulltype: bool = False): ... def coerce_compared_value(self, op, value): ... class ROWID(sqltypes.TypeEngine): @@ -115,7 +115,7 @@ class OracleCompiler(compiler.SQLCompiler): def visit_function(self, func, **kw): ... def visit_table_valued_column(self, element, **kw): ... def default_from(self): ... - def visit_join(self, join, from_linter: Incomplete | None = ..., **kwargs): ... # type: ignore[override] + def visit_join(self, join, from_linter: Incomplete | None = None, **kwargs): ... # type: ignore[override] def visit_outer_join_column(self, vc, **kw): ... def visit_sequence(self, seq, **kw): ... def get_render_as_alias_suffix(self, alias_name_text): ... @@ -180,11 +180,11 @@ class OracleDialect(default.DefaultDialect): exclude_tablespaces: Any def __init__( self, - use_ansi: bool = ..., - optimize_limits: bool = ..., - use_binds_for_limits: Incomplete | None = ..., - use_nchar_for_unicode: bool = ..., - exclude_tablespaces=..., + use_ansi: bool = True, + optimize_limits: bool = False, + use_binds_for_limits: Incomplete | None = None, + use_nchar_for_unicode: bool = False, + exclude_tablespaces=("SYSTEM", "SYSAUX"), **kwargs, ) -> None: ... implicit_returning: Any @@ -193,28 +193,30 @@ class OracleDialect(default.DefaultDialect): def get_isolation_level(self, connection) -> None: ... def get_default_isolation_level(self, dbapi_conn): ... def set_isolation_level(self, connection, level) -> 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 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_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... def get_temp_table_names(self, connection, **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_sequence_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_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_sequence_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_table_comment( - self, connection, table_name, schema: Incomplete | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + self, connection, table_name, schema: Incomplete | None = None, resolve_synonyms: bool = False, dblink: str = "", **kw ): ... def get_indexes( - self, connection, table_name, schema: Incomplete | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + self, connection, table_name, schema: Incomplete | None = None, resolve_synonyms: bool = False, dblink: str = "", **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_unique_constraints(self, connection, table_name, schema: Incomplete | 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_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... def get_view_definition( - self, connection, view_name, schema: Incomplete | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + self, connection, view_name, schema: Incomplete | None = None, resolve_synonyms: bool = False, dblink: str = "", **kw + ): ... + def get_check_constraints( + self, connection, table_name, schema: Incomplete | None = None, include_all: bool = False, **kw ): ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., include_all: bool = ..., **kw): ... class _OuterJoinColumn(ClauseElement): __visit_name__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi index 3484c83e073d..1b755370b817 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi @@ -100,12 +100,12 @@ class OracleDialect_cx_oracle(OracleDialect): cx_oracle_ver: Any def __init__( self, - auto_convert_lobs: bool = ..., - coerce_to_unicode: bool = ..., - coerce_to_decimal: bool = ..., - arraysize: int = ..., - encoding_errors: Incomplete | None = ..., - threaded: Incomplete | None = ..., + auto_convert_lobs: bool = True, + coerce_to_unicode: bool = True, + coerce_to_decimal: bool = True, + arraysize: int = 50, + encoding_errors: Incomplete | None = None, + threaded: Incomplete | None = None, **kwargs, ): ... @classmethod @@ -117,11 +117,11 @@ class OracleDialect_cx_oracle(OracleDialect): def create_connect_args(self, url): ... def is_disconnect(self, e, connection, cursor): ... def create_xid(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 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_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ... def do_recover_twophase(self, connection) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi index fe7c0e8bcb1d..834619c956c2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi @@ -14,7 +14,7 @@ class array(expression.ClauseList, expression.ColumnElement[_Any]): inherit_cache: bool type: _Any def __init__(self, clauses, **kw) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... CONTAINS: _Any CONTAINED_BY: _Any @@ -31,7 +31,7 @@ class ARRAY(sqltypes.ARRAY): dimensions: _Any zero_indexes: _Any def __init__( - self, item_type, as_tuple: bool = ..., dimensions: Incomplete | None = ..., zero_indexes: bool = ... + self, item_type, as_tuple: bool = False, dimensions: Incomplete | None = None, zero_indexes: bool = False ) -> None: ... @property def hashable(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi index dfe48e376662..a2894f2dc208 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi @@ -87,12 +87,12 @@ class AsyncAdapt_asyncpg_cursor: rowcount: int def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... - def execute(self, operation, parameters: Incomplete | None = ...) -> None: ... + def execute(self, operation, parameters: Incomplete | None = 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_asyncpg_ss_cursor(AsyncAdapt_asyncpg_cursor): @@ -102,7 +102,7 @@ class AsyncAdapt_asyncpg_ss_cursor(AsyncAdapt_asyncpg_cursor): def __aiter__(self): ... async def __anext__(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... def executemany(self, operation, seq_of_parameters) -> None: ... @@ -112,13 +112,13 @@ class AsyncAdapt_asyncpg_connection(AdaptedConnection): isolation_level: str readonly: bool deferrable: bool - def __init__(self, dbapi, connection, prepared_statement_cache_size: int = ...) -> None: ... + def __init__(self, dbapi, connection, prepared_statement_cache_size: int = 100) -> None: ... @property def autocommit(self): ... @autocommit.setter def autocommit(self, value) -> None: ... def set_isolation_level(self, level) -> 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: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi index 683ada3fc5fb..1a04cd3d0b52 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -60,21 +60,21 @@ class REGCLASS(sqltypes.TypeEngine): class TIMESTAMP(sqltypes.TIMESTAMP): precision: Any - def __init__(self, timezone: bool = ..., precision: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, precision: Incomplete | None = None) -> None: ... class TIME(sqltypes.TIME): precision: Any - def __init__(self, timezone: bool = ..., precision: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, precision: Incomplete | None = None) -> None: ... class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): __visit_name__: str native: bool precision: Any fields: Any - def __init__(self, precision: Incomplete | None = ..., fields: Incomplete | None = ...) -> None: ... + def __init__(self, precision: Incomplete | None = None, fields: Incomplete | None = None) -> None: ... @classmethod def adapt_emulated_to_native(cls, interval, **kw): ... - def as_generic(self, allow_nulltype: bool = ...): ... + def as_generic(self, allow_nulltype: bool = False): ... @property def python_type(self): ... def coerce_compared_value(self, op, value): ... @@ -85,14 +85,14 @@ class BIT(sqltypes.TypeEngine): __visit_name__: str length: Any varying: Any - def __init__(self, length: Incomplete | None = ..., varying: bool = ...) -> None: ... + def __init__(self, length: Incomplete | None = None, varying: bool = False) -> None: ... PGBit = BIT class UUID(sqltypes.TypeEngine): __visit_name__: str as_uuid: Any - def __init__(self, as_uuid: bool = ...) -> None: ... + def __init__(self, as_uuid: bool = False) -> None: ... def coerce_compared_value(self, op, value): ... def bind_processor(self, dialect): ... def result_processor(self, dialect, coltype): ... @@ -108,17 +108,17 @@ class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): # type: ignore[misc] # def __init__(self, *enums, **kw) -> None: ... @classmethod def adapt_emulated_to_native(cls, impl, **kw): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = True) -> None: ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = True) -> None: ... class EnumGenerator(DDLBase): checkfirst: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = False, **kwargs) -> None: ... def visit_enum(self, enum) -> None: ... class EnumDropper(DDLBase): checkfirst: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = False, **kwargs) -> None: ... def visit_enum(self, enum) -> None: ... class _ColonCast(elements.Cast): @@ -135,8 +135,8 @@ class PGCompiler(compiler.SQLCompiler): def visit_colon_cast(self, element, **kw): ... def visit_array(self, element, **kw): ... def visit_slice(self, element, **kw): ... - def visit_json_getitem_op_binary(self, binary, operator, _cast_applied: bool = ..., **kw): ... - def visit_json_path_getitem_op_binary(self, binary, operator, _cast_applied: bool = ..., **kw): ... + def visit_json_getitem_op_binary(self, binary, operator, _cast_applied: bool = False, **kw): ... + def visit_json_path_getitem_op_binary(self, binary, operator, _cast_applied: bool = False, **kw): ... def visit_getitem_binary(self, binary, operator, **kw): ... def visit_aggregate_order_by(self, element, **kw): ... def visit_match_op_binary(self, binary, operator, **kw): ... @@ -196,7 +196,7 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): def visit_TSTZRANGE(self, type_, **kw): ... def visit_datetime(self, type_, **kw): ... def visit_enum(self, type_, **kw): ... - def visit_ENUM(self, type_, identifier_preparer: Incomplete | None = ..., **kw): ... + def visit_ENUM(self, type_, identifier_preparer: Incomplete | None = None, **kw): ... def visit_TIMESTAMP(self, type_, **kw): ... def visit_TIME(self, type_, **kw): ... def visit_INTERVAL(self, type_, **kw): ... @@ -208,13 +208,13 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): class PGIdentifierPreparer(compiler.IdentifierPreparer): reserved_words: Any - def format_type(self, type_, use_schema: bool = ...): ... + def format_type(self, type_, use_schema: bool = True): ... class PGInspector(reflection.Inspector): - def get_table_oid(self, table_name, schema: Incomplete | None = ...): ... - def get_enums(self, schema: Incomplete | None = ...): ... - def get_foreign_table_names(self, schema: Incomplete | None = ...): ... - def get_view_names(self, schema: Incomplete | None = ..., include=...): ... + def get_table_oid(self, table_name, schema: Incomplete | None = None): ... + def get_enums(self, schema: Incomplete | None = None): ... + def get_foreign_table_names(self, schema: Incomplete | None = None): ... + def get_view_names(self, schema: Incomplete | None = None, include=("plain", "materialized")): ... class CreateEnumType(_CreateDropBase): __visit_name__: str @@ -274,9 +274,9 @@ class PGDialect(default.DefaultDialect): reflection_options: Any def __init__( self, - isolation_level: Incomplete | None = ..., - json_serializer: Incomplete | None = ..., - json_deserializer: Incomplete | None = ..., + isolation_level: Incomplete | None = None, + json_serializer: Incomplete | None = None, + json_deserializer: Incomplete | None = None, **kwargs, ) -> None: ... def initialize(self, connection) -> None: ... @@ -289,25 +289,25 @@ class PGDialect(default.DefaultDialect): def get_deferrable(self, connection) -> None: ... 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 has_schema(self, connection, schema): ... - 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 has_type(self, connection, type_name, schema: Incomplete | None = ...): ... - def get_table_oid(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 has_type(self, connection, type_name, schema: Incomplete | None = None): ... + def get_table_oid(self, connection, table_name, schema: Incomplete | None = None, **kw): ... 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 = ..., include=..., **kw): ... - def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_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_table_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, include=("plain", "materialized"), **kw): ... + def get_sequence_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_definition(self, connection, view_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 = ..., postgresql_ignore_search_path: bool = ..., **kw + self, connection, table_name, schema: Incomplete | None = None, postgresql_ignore_search_path: bool = False, **kw ): ... def get_indexes(self, connection, table_name, schema, **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_table_comment(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_unique_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_check_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi index 9ddcfcce27dd..3a59fcef649c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi @@ -12,14 +12,17 @@ class Insert(StandardInsert): def excluded(self): ... def on_conflict_do_update( self, - constraint: Incomplete | None = ..., - index_elements: Incomplete | None = ..., - index_where: Incomplete | None = ..., - set_: Incomplete | None = ..., - where: Incomplete | None = ..., + constraint: Incomplete | None = None, + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, + set_: Incomplete | None = None, + where: Incomplete | None = None, ) -> None: ... def on_conflict_do_nothing( - self, constraint: Incomplete | None = ..., index_elements: Incomplete | None = ..., index_where: Incomplete | None = ... + self, + constraint: Incomplete | None = None, + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, ) -> None: ... insert: Any @@ -30,7 +33,10 @@ class OnConflictClause(ClauseElement): inferred_target_elements: Any inferred_target_whereclause: Any def __init__( - self, constraint: Incomplete | None = ..., index_elements: Incomplete | None = ..., index_where: Incomplete | None = ... + self, + constraint: Incomplete | None = None, + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, ) -> None: ... class OnConflictDoNothing(OnConflictClause): @@ -42,9 +48,9 @@ class OnConflictDoUpdate(OnConflictClause): update_whereclause: Any def __init__( self, - constraint: Incomplete | None = ..., - index_elements: Incomplete | None = ..., - index_where: Incomplete | None = ..., - set_: Incomplete | None = ..., - where: Incomplete | None = ..., + constraint: Incomplete | None = None, + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, + set_: Incomplete | None = None, + where: Incomplete | None = None, ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi index c9e682f0cf83..834e86264141 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi @@ -11,7 +11,7 @@ class aggregate_order_by(expression.ColumnElement[Any]): type: Any order_by: Any def __init__(self, target, *order_by) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... def get_children(self, **kwargs): ... class ExcludeConstraint(ColumnCollectionConstraint): diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi index 3f37cdef1ac2..afb34111704a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi @@ -9,7 +9,7 @@ class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine): __visit_name__: str hashable: bool text_type: Any - def __init__(self, text_type: Incomplete | None = ...) -> None: ... + def __init__(self, text_type: Incomplete | None = None) -> None: ... class Comparator(sqltypes.Indexable.Comparator[Any], sqltypes.Concatenable.Comparator[Any]): def has_key(self, other): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi index 728842b883ea..7898fd46f203 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi @@ -9,7 +9,7 @@ class JSONPathType(sqltypes.JSON.JSONPathType): class JSON(sqltypes.JSON): astext_type: Any - def __init__(self, none_as_null: bool = ..., astext_type: Incomplete | None = ...) -> None: ... + def __init__(self, none_as_null: bool = False, astext_type: Incomplete | None = None) -> None: ... class Comparator(sqltypes.JSON.Comparator): @property diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi index d87f2c0b5725..dd8b31441599 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi @@ -84,14 +84,14 @@ class ServerSideCursor: def rowcount(self): ... @property def description(self): ... - def execute(self, operation, args=..., stream: Incomplete | None = ...): ... + def execute(self, operation, args=(), stream: Incomplete | None = None): ... def executemany(self, operation, param_sets): ... def fetchone(self): ... - def fetchmany(self, num: Incomplete | None = ...): ... + def fetchmany(self, num: Incomplete | None = None): ... def fetchall(self): ... def close(self) -> None: ... def setinputsizes(self, *sizes) -> None: ... - def setoutputsize(self, size, column: Incomplete | None = ...) -> None: ... + def setoutputsize(self, size, column: Incomplete | None = None) -> None: ... class PGCompiler_pg8000(PGCompiler): def visit_mod_binary(self, binary, operator, **kw): ... @@ -113,7 +113,7 @@ class PGDialect_pg8000(PGDialect): description_encoding: Any colspecs: Any client_encoding: Any - def __init__(self, client_encoding: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, client_encoding: Incomplete | None = None, **kwargs) -> None: ... @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... @@ -127,8 +127,8 @@ class PGDialect_pg8000(PGDialect): def do_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ... 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 on_connect(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi index e94fb3e02e4b..a64d86f6d415 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi @@ -70,13 +70,13 @@ class PGDialect_psycopg2(PGDialect): executemany_values_page_size: Any def __init__( self, - use_native_unicode: bool = ..., - client_encoding: Incomplete | None = ..., - use_native_hstore: bool = ..., - use_native_uuid: bool = ..., - executemany_mode: str = ..., - executemany_batch_page_size: int = ..., - executemany_values_page_size: int = ..., + use_native_unicode: bool = True, + client_encoding: Incomplete | None = None, + use_native_hstore: bool = True, + use_native_uuid: bool = True, + executemany_mode: str = "values_only", + executemany_batch_page_size: int = 100, + executemany_values_page_size: int = 1000, **kwargs, ) -> None: ... def initialize(self, connection) -> None: ... @@ -89,7 +89,7 @@ class PGDialect_psycopg2(PGDialect): def get_deferrable(self, connection): ... def do_ping(self, dbapi_connection): ... 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 create_connect_args(self, url): ... def is_disconnect(self, e, connection, cursor): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi index 8d48580c102a..a4c15cb91385 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi @@ -14,12 +14,12 @@ class AsyncAdapt_aiosqlite_cursor: def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... lastrowid: int - def execute(self, operation, parameters: Incomplete | None = ...) -> None: ... + def execute(self, operation, parameters: Incomplete | None = None) -> None: ... def executemany(self, operation, seq_of_parameters) -> None: ... 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_aiosqlite_ss_cursor(AsyncAdapt_aiosqlite_cursor): @@ -27,7 +27,7 @@ class AsyncAdapt_aiosqlite_ss_cursor(AsyncAdapt_aiosqlite_cursor): def __init__(self, *arg, **kw) -> 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_aiosqlite_connection(AdaptedConnection): @@ -39,7 +39,7 @@ class AsyncAdapt_aiosqlite_connection(AdaptedConnection): @isolation_level.setter def isolation_level(self, value) -> None: ... def create_function(self, *args, **kw) -> None: ... - def cursor(self, server_side: bool = ...): ... + def cursor(self, server_side: bool = False): ... def execute(self, *args, **kw): ... def rollback(self) -> None: ... def commit(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi index bb7d0c25efd7..3ade0d400569 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi @@ -25,7 +25,7 @@ class _SQliteJson(JSON): def result_processor(self, dialect, coltype): ... class _DateTimeMixin: - def __init__(self, storage_format: Incomplete | None = ..., regexp: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, storage_format: Incomplete | None = None, regexp: Incomplete | None = None, **kw) -> None: ... @property def format_is_text_affinity(self): ... def adapt(self, cls, **kw): ... @@ -78,7 +78,7 @@ class SQLiteDDLCompiler(compiler.DDLCompiler): def visit_column_check_constraint(self, constraint): ... def visit_foreign_key_constraint(self, constraint): ... def define_constraint_remote_table(self, constraint, table, preparer): ... - def visit_create_index(self, create, include_schema: bool = ..., include_table_schema: bool = ...): ... # type: ignore[override] + def visit_create_index(self, create, include_schema: bool = False, include_table_schema: bool = True): ... # type: ignore[override] def post_create_table(self, table): ... class SQLiteTypeCompiler(compiler.GenericTypeCompiler): @@ -117,27 +117,27 @@ class SQLiteDialect(default.DefaultDialect): native_datetime: Any def __init__( self, - isolation_level: Incomplete | None = ..., - native_datetime: bool = ..., - json_serializer: Incomplete | None = ..., - json_deserializer: Incomplete | None = ..., - _json_serializer: Incomplete | None = ..., - _json_deserializer: Incomplete | None = ..., + isolation_level: Incomplete | None = None, + native_datetime: bool = False, + json_serializer: Incomplete | None = None, + json_deserializer: Incomplete | None = None, + _json_serializer: Incomplete | None = None, + _json_deserializer: Incomplete | None = None, **kwargs, ) -> None: ... def set_isolation_level(self, connection, level) -> None: ... def get_isolation_level(self, connection): ... def on_connect(self): ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... def get_temp_table_names(self, connection, **kw): ... def get_temp_view_names(self, connection, **kw): ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_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_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_check_constraints(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 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_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_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi index da20b23ada4c..cfd505042a58 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi @@ -12,12 +12,12 @@ class Insert(StandardInsert): def excluded(self): ... def on_conflict_do_update( self, - index_elements: Incomplete | None = ..., - index_where: Incomplete | None = ..., - set_: Incomplete | None = ..., - where: Incomplete | None = ..., + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, + set_: Incomplete | None = None, + where: Incomplete | None = None, ) -> None: ... - def on_conflict_do_nothing(self, index_elements: Incomplete | None = ..., index_where: Incomplete | None = ...) -> None: ... + def on_conflict_do_nothing(self, index_elements: Incomplete | None = None, index_where: Incomplete | None = None) -> None: ... insert: Any @@ -26,7 +26,7 @@ class OnConflictClause(ClauseElement): constraint_target: Any inferred_target_elements: Any inferred_target_whereclause: Any - def __init__(self, index_elements: Incomplete | None = ..., index_where: Incomplete | None = ...) -> None: ... + def __init__(self, index_elements: Incomplete | None = None, index_where: Incomplete | None = None) -> None: ... class OnConflictDoNothing(OnConflictClause): __visit_name__: str @@ -37,8 +37,8 @@ class OnConflictDoUpdate(OnConflictClause): update_whereclause: Any def __init__( self, - index_elements: Incomplete | None = ..., - index_where: Incomplete | None = ..., - set_: Incomplete | None = ..., - where: Incomplete | None = ..., + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, + set_: Incomplete | None = None, + where: Incomplete | None = None, ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi index f6a90151b558..cb1e7c17c800 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi @@ -77,7 +77,7 @@ ischema_names: Any class SybaseInspector(reflection.Inspector): def __init__(self, conn) -> None: ... - def get_table_id(self, table_name, schema: Incomplete | None = ...): ... + def get_table_id(self, table_name, schema: Incomplete | None = None): ... class SybaseExecutionContext(default.DefaultExecutionContext): def set_ddl_autocommit(self, connection, value) -> None: ... @@ -124,13 +124,13 @@ class SybaseDialect(default.DefaultDialect): def __init__(self, *args, **kwargs) -> None: ... max_identifier_length: int def initialize(self, connection) -> None: ... - def get_table_id(self, connection, table_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 get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_table_id(self, connection, table_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): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi index d0a7a81aa869..e88d8e6cef88 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi @@ -22,7 +22,7 @@ class SybaseDialect_pysybase(SybaseDialect): @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... - 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 = SybaseDialect_pysybase diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi index 9d7376520a9f..2b69e99d3378 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi @@ -31,13 +31,13 @@ class Connection(Connectable): def __init__( self, engine: Engine, - connection: DBAPIConnection | None = ..., - close_with_result: bool = ..., - _branch_from: Incomplete | None = ..., - _execution_options: Incomplete | None = ..., - _dispatch: Incomplete | None = ..., - _has_events: Incomplete | None = ..., - _allow_revalidate: bool = ..., + connection: DBAPIConnection | None = None, + close_with_result: bool = False, + _branch_from: Incomplete | None = None, + _execution_options: Incomplete | None = None, + _dispatch: Incomplete | None = None, + _has_events: Incomplete | None = None, + _allow_revalidate: bool = True, ) -> None: ... def schema_for_object(self, obj) -> str | None: ... def __enter__(self) -> Self: ... @@ -57,15 +57,15 @@ class Connection(Connectable): def default_isolation_level(self): ... @property def info(self): ... - def connect(self, close_with_result: bool = ...): ... # type: ignore[override] - def invalidate(self, exception: Exception | None = ...) -> None: ... + def connect(self, close_with_result: bool = False): ... # type: ignore[override] + def invalidate(self, exception: Exception | None = None) -> None: ... def detach(self) -> None: ... def begin(self) -> Transaction: ... def begin_nested(self) -> Transaction | None: ... - def begin_twophase(self, xid: Incomplete | None = ...) -> TwoPhaseTransaction: ... + def begin_twophase(self, xid: Incomplete | None = None) -> TwoPhaseTransaction: ... def recover_twophase(self): ... - def rollback_prepared(self, xid, recover: bool = ...) -> None: ... - def commit_prepared(self, xid, recover: bool = ...) -> None: ... + def rollback_prepared(self, xid, recover: bool = False) -> None: ... + def commit_prepared(self, xid, recover: bool = False) -> None: ... def in_transaction(self) -> bool: ... def in_nested_transaction(self) -> bool: ... def get_transaction(self) -> Transaction | None: ... @@ -81,7 +81,7 @@ class Connection(Connectable): @overload def execute(self, statement: str, *multiparams: Any | tuple[Any, ...] | Mapping[str, Any], **params) -> CursorResult: ... def exec_driver_sql( - self, statement: str, parameters: Incomplete | None = ..., execution_options: Incomplete | None = ... + self, statement: str, parameters: Incomplete | None = None, execution_options: Incomplete | None = None ): ... def transaction(self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ... def run_callable(self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ... @@ -156,11 +156,11 @@ class Engine(Connectable, Identified): pool: Pool, dialect: Dialect, url: str | URL, - logging_name: str | None = ..., - echo: _EchoFlag = ..., - query_cache_size: int = ..., - execution_options: Mapping[str, Any] | None = ..., - hide_parameters: bool = ..., + logging_name: str | None = None, + echo: _EchoFlag = None, + query_cache_size: int = 500, + execution_options: Mapping[str, Any] | None = None, + hide_parameters: bool = False, ) -> None: ... @property def engine(self) -> Engine: ... @@ -172,7 +172,7 @@ class Engine(Connectable, Identified): def name(self) -> str: ... @property def driver(self): ... - def dispose(self, close: bool = ...) -> None: ... + def dispose(self, close: bool = True) -> None: ... class _trans_ctx: conn: Connection @@ -184,7 +184,7 @@ class Engine(Connectable, Identified): self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... - def begin(self, close_with_result: bool = ...) -> _trans_ctx: ... + def begin(self, close_with_result: bool = False) -> _trans_ctx: ... def transaction( self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs ) -> _T | None: ... @@ -197,10 +197,10 @@ class Engine(Connectable, Identified): def scalar(self, statement: _Executable, *multiparams: Mapping[str, Any], **params: Any) -> Any: ... @overload def scalar(self, statement: str, *multiparams: Any | tuple[Any, ...] | Mapping[str, Any], **params: Any) -> Any: ... - def connect(self, close_with_result: bool = ...) -> Connection: ... # type: ignore[override] - def table_names(self, schema: Incomplete | None = ..., connection: Connection | None = ...): ... - def has_table(self, table_name: str, schema: Incomplete | None = ...) -> bool: ... - def raw_connection(self, _connection: Connection | None = ...) -> DBAPIConnection: ... + def connect(self, close_with_result: bool = False) -> Connection: ... # type: ignore[override] + def table_names(self, schema: Incomplete | None = None, connection: Connection | None = None): ... + def has_table(self, table_name: str, schema: Incomplete | None = None) -> bool: ... + def raw_connection(self, _connection: Connection | None = None) -> DBAPIConnection: ... class OptionEngineMixin: url: URL diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi index 97070a374a09..ae20f2002a80 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi @@ -17,6 +17,6 @@ def create_engine( ) -> FutureEngine: ... @overload def create_engine( - url: URL | str, *, module: Incomplete | None = ..., enable_from_linting: bool = ..., future: Literal[False] = ..., **kwargs + url: URL | str, *, module: Incomplete | None = ..., enable_from_linting: bool = ..., future: Literal[False] = False, **kwargs ) -> Engine: ... -def engine_from_config(configuration: Mapping[str, Any], prefix: str = ..., **kwargs) -> Engine: ... +def engine_from_config(configuration: Mapping[str, Any], prefix: str = "sqlalchemy.", **kwargs) -> Engine: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi index 76d0d369d6f7..7b67eba1f0a8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi @@ -26,16 +26,16 @@ class ResultFetchStrategy: def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... def yield_per(self, result, dbapi_cursor, num) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...) -> None: ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...) -> None: ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False) -> None: ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None) -> None: ... def fetchall(self, result) -> None: ... def handle_exception(self, result, dbapi_cursor, err) -> None: ... class NoCursorFetchStrategy(ResultFetchStrategy): def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None): ... def fetchall(self, result, dbapi_cursor): ... class NoCursorDQLFetchStrategy(NoCursorFetchStrategy): ... @@ -46,33 +46,33 @@ class CursorFetchStrategy(ResultFetchStrategy): def hard_close(self, result, dbapi_cursor) -> None: ... def handle_exception(self, result, dbapi_cursor, err) -> None: ... def yield_per(self, result, dbapi_cursor, num) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None): ... def fetchall(self, result, dbapi_cursor): ... class BufferedRowCursorFetchStrategy(CursorFetchStrategy): def __init__( - self, dbapi_cursor, execution_options, growth_factor: int = ..., initial_buffer: Incomplete | None = ... + self, dbapi_cursor, execution_options, growth_factor: int = 5, initial_buffer: Incomplete | None = None ) -> None: ... @classmethod def create(cls, result): ... def yield_per(self, result, dbapi_cursor, num) -> None: ... def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None): ... def fetchall(self, result, dbapi_cursor): ... class FullyBufferedCursorFetchStrategy(CursorFetchStrategy): alternate_cursor_description: Any def __init__( - self, dbapi_cursor, alternate_description: Incomplete | None = ..., initial_buffer: Incomplete | None = ... + self, dbapi_cursor, alternate_description: Incomplete | None = None, initial_buffer: Incomplete | None = None ) -> None: ... def yield_per(self, result, dbapi_cursor, num) -> None: ... def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None): ... def fetchall(self, result, dbapi_cursor): ... class _NoResultMetaData(ResultMetaData): diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi index fa725cb70d93..e7784485a074 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi @@ -89,17 +89,17 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] compiler_linting: Any def __init__( self, - convert_unicode: bool = ..., - encoding: str = ..., - paramstyle: Incomplete | None = ..., - dbapi: Incomplete | None = ..., - implicit_returning: Incomplete | None = ..., - case_sensitive: bool = ..., - supports_native_boolean: Incomplete | None = ..., - max_identifier_length: Incomplete | None = ..., - label_length: Incomplete | None = ..., - compiler_linting=..., - server_side_cursors: bool = ..., + convert_unicode: bool = False, + encoding: str = "utf-8", + paramstyle: Incomplete | None = None, + dbapi: Incomplete | None = None, + implicit_returning: Incomplete | None = None, + case_sensitive: bool = True, + supports_native_boolean: Incomplete | None = None, + max_identifier_length: Incomplete | None = None, + label_length: Incomplete | None = None, + compiler_linting=0, + server_side_cursors: bool = False, **kwargs, ) -> None: ... @property @@ -116,7 +116,7 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] def on_connect(self) -> None: ... def get_default_isolation_level(self, dbapi_conn): ... def type_descriptor(self, typeobj): ... - def has_index(self, connection, table_name, index_name, schema: Incomplete | None = ...): ... + def has_index(self, connection, table_name, index_name, schema: Incomplete | None = None): ... def validate_identifier(self, ident) -> None: ... def connect(self, *cargs, **cparams): ... def create_connect_args(self, url): ... @@ -131,9 +131,9 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] def do_savepoint(self, connection, name) -> None: ... def do_rollback_to_savepoint(self, connection, name) -> None: ... def do_release_savepoint(self, connection, name) -> None: ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute_no_params(self, cursor, statement, context: Incomplete | None = ...) -> None: ... # type: ignore[override] + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def do_execute_no_params(self, cursor, statement, context: Incomplete | None = None) -> None: ... # type: ignore[override] def is_disconnect(self, e, connection, cursor): ... def reset_isolation_level(self, dbapi_conn) -> None: ... def normalize_name(self, name): ... @@ -216,6 +216,6 @@ class DefaultExecutionContext(interfaces.ExecutionContext): def inserted_primary_key_rows(self): ... def lastrow_has_defaults(self): ... current_parameters: Any - def get_current_parameters(self, isolate_multiinsert_groups: bool = ...): ... + def get_current_parameters(self, isolate_multiinsert_groups: bool = True): ... def get_insert_default(self, column): ... def get_update_default(self, column): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi index afe46eb46e85..a621216264cd 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi @@ -54,24 +54,24 @@ class Dialect: # as abstract. @classmethod def type_descriptor(cls, typeobj) -> None: ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_temp_table_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_temp_view_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_table_comment(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_temp_table_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_sequence_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_temp_view_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_table_comment(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... def normalize_name(self, name) -> None: ... def denormalize_name(self, name) -> None: ... - def has_table(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def has_index(self, connection, table_name, index_name, schema: Incomplete | None = ...) -> None: ... - def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ..., **kw) -> None: ... + def has_table(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def has_index(self, connection, table_name, index_name, schema: Incomplete | None = None) -> None: ... + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None, **kw) -> None: ... def do_begin(self, dbapi_connection) -> None: ... def do_rollback(self, dbapi_connection) -> None: ... def do_commit(self, dbapi_connection) -> None: ... @@ -83,12 +83,12 @@ class Dialect: def do_release_savepoint(self, connection, name) -> None: ... 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) -> None: ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute_no_params(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: ... + def do_execute_no_params(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def is_disconnect(self, e, connection, cursor) -> None: ... def connect(self, *cargs, **cparams) -> DBAPIConnection: ... def reset_isolation_level(self, dbapi_conn) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi index 350ba42ee0df..242cf7868d78 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi @@ -9,24 +9,24 @@ class Inspector: @property def default_schema_name(self): ... def get_schema_names(self): ... - def get_table_names(self, schema: Incomplete | None = ...): ... - def has_table(self, table_name, schema: Incomplete | None = ...): ... - def has_sequence(self, sequence_name, schema: Incomplete | None = ...): ... - def get_sorted_table_and_fkc_names(self, schema: Incomplete | None = ...): ... + def get_table_names(self, schema: Incomplete | None = None): ... + def has_table(self, table_name, schema: Incomplete | None = None): ... + def has_sequence(self, sequence_name, schema: Incomplete | None = None): ... + def get_sorted_table_and_fkc_names(self, schema: Incomplete | None = None): ... def get_temp_table_names(self): ... def get_temp_view_names(self): ... - def get_table_options(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, schema: Incomplete | None = ...): ... - def get_sequence_names(self, schema: Incomplete | None = ...): ... - def get_view_definition(self, view_name, schema: Incomplete | None = ...): ... - def get_columns(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_indexes(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_unique_constraints(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_table_comment(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_check_constraints(self, table_name, schema: Incomplete | None = ..., **kw): ... + def get_table_options(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, schema: Incomplete | None = None): ... + def get_sequence_names(self, schema: Incomplete | None = None): ... + def get_view_definition(self, view_name, schema: Incomplete | None = None): ... + def get_columns(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_indexes(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_unique_constraints(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_table_comment(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_check_constraints(self, table_name, schema: Incomplete | None = None, **kw): ... def reflecttable(self, *args, **kwargs): ... def reflect_table( - self, table, include_columns, exclude_columns=..., resolve_fks: bool = ..., _extend_on: Incomplete | None = ... + self, table, include_columns, exclude_columns=(), resolve_fks: bool = True, _extend_on: Incomplete | None = None ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi index 7328eb5e2f4f..9500d7a11231 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi @@ -22,14 +22,14 @@ class SimpleResultMetaData(ResultMetaData): def __init__( self, keys, - extra: Incomplete | None = ..., - _processors: Incomplete | None = ..., - _tuplefilter: Incomplete | None = ..., - _translated_indexes: Incomplete | None = ..., - _unique_filters: Incomplete | None = ..., + extra: Incomplete | None = None, + _processors: Incomplete | None = None, + _tuplefilter: Incomplete | None = None, + _translated_indexes: Incomplete | None = None, + _unique_filters: Incomplete | None = None, ) -> None: ... -def result_tuple(fields, extra: Incomplete | None = ...): ... +def result_tuple(fields, extra: Incomplete | None = None): ... class ResultInternal(InPlaceGenerative): ... @@ -40,16 +40,16 @@ class Result(_WithKeys, ResultInternal): def __init__(self, cursor_metadata) -> None: ... def close(self) -> None: ... def yield_per(self, num: int) -> Self: ... - def unique(self, strategy: Incomplete | None = ...) -> Self: ... + def unique(self, strategy: Incomplete | None = None) -> Self: ... def columns(self, *col_expressions): ... - def scalars(self, index: int = ...) -> ScalarResult: ... + def scalars(self, index: int = 0) -> ScalarResult: ... def mappings(self) -> MappingResult: ... def __iter__(self): ... def __next__(self): ... - def partitions(self, size: int | None = ...) -> Generator[list[Row], None, None]: ... + def partitions(self, size: int | None = None) -> Generator[list[Row], None, None]: ... def fetchall(self) -> list[Row]: ... def fetchone(self) -> Row | None: ... - def fetchmany(self, size: int | None = ...) -> list[Row]: ... + def fetchmany(self, size: int | None = None) -> list[Row]: ... def all(self) -> list[Row]: ... def first(self) -> Row | None: ... def one_or_none(self) -> Row | None: ... @@ -64,10 +64,10 @@ class FilterResult(ResultInternal): ... class ScalarResult(FilterResult): def __init__(self, real_result, index) -> None: ... - def unique(self, strategy: Incomplete | None = ...): ... - def partitions(self, size: Incomplete | None = ...) -> None: ... + def unique(self, strategy: Incomplete | None = None): ... + def partitions(self, size: Incomplete | None = None) -> None: ... def fetchall(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def all(self): ... def __iter__(self): ... def __next__(self): ... @@ -77,12 +77,12 @@ class ScalarResult(FilterResult): class MappingResult(_WithKeys, FilterResult): def __init__(self, result) -> None: ... - def unique(self, strategy: Incomplete | None = ...): ... + def unique(self, strategy: Incomplete | None = None): ... def columns(self, *col_expressions): ... - def partitions(self, size: Incomplete | None = ...) -> None: ... + def partitions(self, size: Incomplete | None = None) -> None: ... def fetchall(self): ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def all(self): ... def __iter__(self): ... def __next__(self): ... @@ -101,7 +101,9 @@ class FrozenResult: class IteratorResult(Result): iterator: Any raw: Any - def __init__(self, cursor_metadata, iterator, raw: Incomplete | None = ..., _source_supports_scalars: bool = ...) -> None: ... + def __init__( + self, cursor_metadata, iterator, raw: Incomplete | None = None, _source_supports_scalars: bool = False + ) -> None: ... def null_result() -> IteratorResult: ... @@ -114,9 +116,9 @@ class ChunkedIteratorResult(IteratorResult): self, cursor_metadata, chunks, - source_supports_scalars: bool = ..., - raw: Incomplete | None = ..., - dynamic_yield_per: bool = ..., + source_supports_scalars: bool = False, + raw: Incomplete | None = None, + dynamic_yield_per: bool = False, ) -> None: ... class MergedResult(IteratorResult): diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index 0a4c48a085ea..7a5b30789954 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -27,31 +27,31 @@ class URL(_URLTuple): def create( cls, drivername: str, - username: str | None = ..., + username: str | None = None, password: str | _PasswordObject | None = None, - host: str | None = ..., - port: int | None = ..., - database: str | None = ..., + host: str | None = None, + port: int | None = None, + database: str | None = None, query: _Query | None = ..., ) -> URL: ... def set( self, - drivername: str | None = ..., - username: str | None = ..., + drivername: str | None = None, + username: str | None = None, password: str | _PasswordObject | None = None, - host: str | None = ..., - port: int | None = ..., - database: str | None = ..., - query: _Query | None = ..., + host: str | None = None, + port: int | None = None, + database: str | None = None, + query: _Query | None = None, ) -> Self: ... - def update_query_string(self, query_string: str, append: bool = ...) -> Self: ... - def update_query_pairs(self, key_value_pairs: Iterable[tuple[str, str]], append: bool = ...) -> Self: ... - def update_query_dict(self, query_parameters: SupportsItems[str, str | Sequence[str]], append: bool = ...) -> Self: ... + def update_query_string(self, query_string: str, append: bool = False) -> Self: ... + def update_query_pairs(self, key_value_pairs: Iterable[tuple[str, str]], append: bool = False) -> Self: ... + def update_query_dict(self, query_parameters: SupportsItems[str, str | Sequence[str]], append: bool = False) -> Self: ... def difference_update_query(self, names: Iterable[str]) -> URL: ... @property def normalized_query(self) -> immutabledict[str, tuple[str, ...]]: ... - def __to_string__(self, hide_password: bool = ...) -> str: ... - def render_as_string(self, hide_password: bool = ...) -> str: ... + def __to_string__(self, hide_password: bool = True) -> str: ... + def render_as_string(self, hide_password: bool = True) -> str: ... def __copy__(self) -> Self: ... def __deepcopy__(self, memo: Unused) -> Self: ... def __hash__(self) -> int: ... @@ -60,6 +60,6 @@ class URL(_URLTuple): def get_backend_name(self) -> str: ... def get_driver_name(self) -> str: ... def get_dialect(self) -> type[Dialect]: ... - def translate_connect_args(self, names: list[str] | None = ..., **kw: str) -> dict[str, Any]: ... + def translate_connect_args(self, names: list[str] | None = None, **kw: str) -> dict[str, Any]: ... def make_url(name_or_url: str | URL) -> URL: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/event/base.pyi b/stubs/SQLAlchemy/sqlalchemy/event/base.pyi index d968c86e5ddd..d367033311fb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/event/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/event/base.pyi @@ -5,7 +5,7 @@ class _UnpickleDispatch: def __call__(self, _instance_cls): ... class _Dispatch: - def __init__(self, parent, instance_cls: Incomplete | None = ...) -> None: ... + def __init__(self, parent, instance_cls: Incomplete | None = None) -> None: ... def __getattr__(self, name: str): ... def __reduce__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi b/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi index f513b9664f50..616d3d784803 100644 --- a/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi @@ -8,14 +8,19 @@ class _EventKey: fn_key: Any fn_wrap: Any dispatch_target: Any - def __init__(self, target, identifier, fn, dispatch_target, _fn_wrap: Incomplete | None = ...) -> None: ... + def __init__(self, target, identifier, fn, dispatch_target, _fn_wrap: Incomplete | None = None) -> None: ... def with_wrapper(self, fn_wrap): ... def with_dispatch_target(self, dispatch_target): ... def listen(self, *args, **kw) -> None: ... def remove(self) -> None: ... def contains(self): ... def base_listen( - self, propagate: bool = ..., insert: bool = ..., named: bool = ..., retval: Incomplete | None = ..., asyncio: bool = ... + self, + propagate: bool = False, + insert: bool = False, + named: bool = False, + retval: Incomplete | None = None, + asyncio: bool = False, ) -> None: ... def append_to_list(self, owner, list_): ... def remove_from_list(self, owner, list_) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/exc.pyi b/stubs/SQLAlchemy/sqlalchemy/exc.pyi index 30dba09fc49b..876de1270d83 100644 --- a/stubs/SQLAlchemy/sqlalchemy/exc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/exc.pyi @@ -22,7 +22,7 @@ class AmbiguousForeignKeysError(ArgumentError): ... class CircularDependencyError(SQLAlchemyError): cycles: Any edges: Any - def __init__(self, message, cycles, edges, msg: Incomplete | None = ..., code: Incomplete | None = ...) -> None: ... + def __init__(self, message, cycles, edges, msg: Incomplete | None = None, code: Incomplete | None = None) -> None: ... def __reduce__(self): ... class CompileError(SQLAlchemyError): ... @@ -32,7 +32,7 @@ class UnsupportedCompilationError(CompileError): compiler: Any element_type: Any message: str | None - def __init__(self, compiler, element_type, message: str | None = ...) -> None: ... + def __init__(self, compiler, element_type, message: str | None = None) -> None: ... def __reduce__(self): ... class IdentifierError(SQLAlchemyError): ... @@ -88,9 +88,9 @@ class StatementError(SQLAlchemyError): statement, params, orig, - hide_parameters: bool = ..., - code: Incomplete | None = ..., - ismulti: Incomplete | None = ..., + hide_parameters: bool = False, + code: Incomplete | None = None, + ismulti: Incomplete | None = None, ) -> None: ... def add_detail(self, msg) -> None: ... def __reduce__(self): ... @@ -104,10 +104,10 @@ class DBAPIError(StatementError): params, orig, dbapi_base_err, - hide_parameters: bool = ..., - connection_invalidated: bool = ..., - dialect: Incomplete | None = ..., - ismulti: Incomplete | None = ..., + hide_parameters: bool = False, + connection_invalidated: bool = False, + dialect: Incomplete | None = None, + ismulti: Incomplete | None = None, ): ... def __reduce__(self): ... connection_invalidated: Any @@ -116,10 +116,10 @@ class DBAPIError(StatementError): statement, params, orig, - hide_parameters: bool = ..., - connection_invalidated: bool = ..., - code: Incomplete | None = ..., - ismulti: Incomplete | None = ..., + hide_parameters: bool = False, + connection_invalidated: bool = False, + code: Incomplete | None = None, + ismulti: Incomplete | None = None, ) -> None: ... class InterfaceError(DBAPIError): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi index d72c6d7ee574..f75244e2a0e3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi @@ -25,17 +25,17 @@ class AssociationProxy(interfaces.InspectionAttrInfo): self, target_collection, attr, - creator: Incomplete | None = ..., - getset_factory: Incomplete | None = ..., - proxy_factory: Incomplete | None = ..., - proxy_bulk_set: Incomplete | None = ..., - info: Incomplete | None = ..., - cascade_scalar_deletes: bool = ..., + creator: Incomplete | None = None, + getset_factory: Incomplete | None = None, + proxy_factory: Incomplete | None = None, + proxy_bulk_set: Incomplete | None = None, + info: Incomplete | None = None, + cascade_scalar_deletes: bool = False, ) -> None: ... def __get__(self, obj, class_): ... def __set__(self, obj, values) -> None: ... def __delete__(self, obj) -> None: ... - def for_class(self, class_, obj: Incomplete | None = ...): ... + def for_class(self, class_, obj: Incomplete | None = None): ... class AssociationProxyInstance: parent: Any @@ -62,15 +62,15 @@ class AssociationProxyInstance: def get(self, obj): ... def set(self, obj, values) -> None: ... def delete(self, obj) -> None: ... - def any(self, criterion: Incomplete | None = ..., **kwargs): ... - def has(self, criterion: Incomplete | None = ..., **kwargs): ... + def any(self, criterion: Incomplete | None = None, **kwargs): ... + def has(self, criterion: Incomplete | None = None, **kwargs): ... class AmbiguousAssociationProxyInstance(AssociationProxyInstance): def get(self, obj): ... def __eq__(self, obj): ... def __ne__(self, obj): ... - def any(self, criterion: Incomplete | None = ..., **kwargs) -> None: ... - def has(self, criterion: Incomplete | None = ..., **kwargs) -> None: ... + def any(self, criterion: Incomplete | None = None, **kwargs) -> None: ... + def has(self, criterion: Incomplete | None = None, **kwargs) -> None: ... class ObjectAssociationProxyInstance(AssociationProxyInstance): def contains(self, obj): ... @@ -113,7 +113,7 @@ class _AssociationList(_AssociationCollection): def count(self, value): ... def extend(self, values) -> None: ... def insert(self, index, value) -> None: ... - def pop(self, index: int = ...): ... + def pop(self, index: int = -1): ... def remove(self, value) -> None: ... def reverse(self) -> None: ... def sort(self) -> None: ... @@ -150,8 +150,8 @@ class _AssociationDict(_AssociationCollection): def __gt__(self, other): ... def __ge__(self, other): ... def __cmp__(self, other): ... - def get(self, key, default: Incomplete | None = ...): ... - def setdefault(self, key, default: Incomplete | None = ...): ... + def get(self, key, default: Incomplete | None = None): ... + def setdefault(self, key, default: Incomplete | None = None): ... def keys(self): ... def items(self): ... def values(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi index 61f3579aecf8..5e1b2c263496 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi @@ -5,7 +5,7 @@ class ReversibleProxy: ... class StartableContext(abc.ABC, metaclass=abc.ABCMeta): @abc.abstractmethod - async def start(self, is_ctxmanager: bool = ...): ... + async def start(self, is_ctxmanager: bool = False): ... def __await__(self): ... async def __aenter__(self): ... @abc.abstractmethod diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi index 26538f549e98..15aa848485fa 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi @@ -12,8 +12,8 @@ class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): engine: Any sync_engine: Any sync_connection: Any - def __init__(self, async_engine, sync_connection: Incomplete | None = ...) -> None: ... - async def start(self, is_ctxmanager: bool = ...): ... + def __init__(self, async_engine, sync_connection: Incomplete | None = None) -> None: ... + async def start(self, is_ctxmanager: bool = False): ... @property def connection(self) -> None: ... async def get_raw_connection(self): ... @@ -21,7 +21,7 @@ class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): def info(self): ... def begin(self): ... def begin_nested(self): ... - async def invalidate(self, exception: Incomplete | None = ...): ... + async def invalidate(self, exception: Incomplete | None = None): ... async def get_isolation_level(self): ... async def set_isolation_level(self): ... def in_transaction(self): ... @@ -32,12 +32,12 @@ class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): async def commit(self) -> None: ... async def rollback(self) -> None: ... async def close(self) -> None: ... - async def exec_driver_sql(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def stream(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def execute(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def scalar(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def scalars(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def stream_scalars(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... + async def exec_driver_sql(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def stream(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def execute(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def scalar(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def scalars(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def stream_scalars(self, statement, parameters: Incomplete | None = None, execution_options=...): ... async def run_sync(self, fn, *arg, **kw): ... def __await__(self): ... async def __aexit__( @@ -57,7 +57,7 @@ class AsyncEngine(ProxyComparable, AsyncConnectable): conn: Any def __init__(self, conn) -> None: ... transaction: Any - async def start(self, is_ctxmanager: bool = ...): ... + async def start(self, is_ctxmanager: bool = False): ... async def __aexit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... @@ -87,7 +87,7 @@ class AsyncTransaction(ProxyComparable, StartableContext): connection: Any sync_transaction: Any nested: Any - def __init__(self, connection, nested: bool = ...) -> None: ... + def __init__(self, connection, nested: bool = False) -> None: ... @property def is_valid(self): ... @property @@ -95,7 +95,7 @@ class AsyncTransaction(ProxyComparable, StartableContext): async def close(self) -> None: ... async def rollback(self) -> None: ... async def commit(self) -> None: ... - async def start(self, is_ctxmanager: bool = ...): ... + async def start(self, is_ctxmanager: bool = False): ... async def __aexit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi index 43a2a3b0b879..ee9864e0b182 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi @@ -8,11 +8,11 @@ class AsyncCommon(FilterResult): class AsyncResult(AsyncCommon): def __init__(self, real_result) -> None: ... def keys(self): ... - def unique(self, strategy: Incomplete | None = ...): ... + def unique(self, strategy: Incomplete | None = None): ... def columns(self, *col_expressions): ... - async def partitions(self, size: Incomplete | None = ...) -> None: ... + async def partitions(self, size: Incomplete | None = None) -> None: ... async def fetchone(self): ... - async def fetchmany(self, size: Incomplete | None = ...): ... + async def fetchmany(self, size: Incomplete | None = None): ... async def all(self): ... def __aiter__(self): ... async def __anext__(self): ... @@ -23,15 +23,15 @@ class AsyncResult(AsyncCommon): async def one(self): ... async def scalar(self): ... async def freeze(self): ... - def scalars(self, index: int = ...): ... + def scalars(self, index: int = 0): ... def mappings(self): ... class AsyncScalarResult(AsyncCommon): def __init__(self, real_result, index) -> None: ... - def unique(self, strategy: Incomplete | None = ...): ... - async def partitions(self, size: Incomplete | None = ...) -> None: ... + def unique(self, strategy: Incomplete | None = None): ... + async def partitions(self, size: Incomplete | None = None) -> None: ... async def fetchall(self): ... - async def fetchmany(self, size: Incomplete | None = ...): ... + async def fetchmany(self, size: Incomplete | None = None): ... async def all(self): ... def __aiter__(self): ... async def __anext__(self): ... @@ -42,12 +42,12 @@ class AsyncScalarResult(AsyncCommon): class AsyncMappingResult(AsyncCommon): def __init__(self, result) -> None: ... def keys(self): ... - def unique(self, strategy: Incomplete | None = ...): ... + def unique(self, strategy: Incomplete | None = None): ... def columns(self, *col_expressions): ... - async def partitions(self, size: Incomplete | None = ...) -> None: ... + async def partitions(self, size: Incomplete | None = None) -> None: ... async def fetchall(self): ... async def fetchone(self): ... - async def fetchmany(self, size: Incomplete | None = ...): ... + async def fetchmany(self, size: Incomplete | None = None): ... async def all(self): ... def __aiter__(self): ... async def __anext__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi index a71390ced527..2d6557caff95 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi @@ -21,7 +21,7 @@ class async_scoped_session(ScopedSessionMixin): autoflush: Any def __contains__(self, instance): ... def __iter__(self): ... - def add(self, instance, _warn: bool = ...) -> None: ... + def add(self, instance, _warn: bool = True) -> None: ... def add_all(self, instances) -> None: ... def begin(self, **kw): ... def begin_nested(self, **kw): ... @@ -30,38 +30,40 @@ class async_scoped_session(ScopedSessionMixin): async def connection(self, **kw): ... async def delete(self, instance): ... async def execute( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... - def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = None) -> None: ... def expire_all(self) -> None: ... def expunge(self, instance) -> None: ... def expunge_all(self) -> None: ... - async def flush(self, objects: Incomplete | None = ...) -> None: ... + async def flush(self, objects: Incomplete | None = None) -> None: ... async def get( self, entity, ident, - options: Incomplete | None = ..., - populate_existing: bool = ..., - with_for_update: Incomplete | None = ..., - identity_token: Incomplete | None = ..., + options: Incomplete | None = None, + populate_existing: bool = False, + with_for_update: Incomplete | None = None, + identity_token: Incomplete | None = None, ): ... - def get_bind(self, mapper: Incomplete | None = ..., clause: Incomplete | None = ..., bind: Incomplete | None = ..., **kw): ... - def is_modified(self, instance, include_collections: bool = ...): ... - async def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... - async def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...): ... + def get_bind( + self, mapper: Incomplete | None = None, clause: Incomplete | None = None, bind: Incomplete | None = None, **kw + ): ... + def is_modified(self, instance, include_collections: bool = True): ... + async def merge(self, instance, load: bool = True, options: Incomplete | None = None): ... + async def refresh(self, instance, attribute_names: Incomplete | None = None, with_for_update: Incomplete | None = None): ... async def rollback(self): ... async def scalar( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def stream( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def stream_scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... @property def dirty(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi index 02e1e942fc4d..aefe03ad9ee2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi @@ -13,40 +13,42 @@ class AsyncSession(ReversibleProxy): sync_session_class: Any sync_session: Any def __init__( - self, bind: Incomplete | None = ..., binds: Incomplete | None = ..., sync_session_class: Incomplete | None = ..., **kw + self, bind: Incomplete | None = None, binds: Incomplete | None = None, sync_session_class: Incomplete | None = None, **kw ) -> None: ... - async def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...): ... + async def refresh(self, instance, attribute_names: Incomplete | None = None, with_for_update: Incomplete | None = None): ... async def run_sync(self, fn, *arg, **kw): ... async def execute( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def scalar( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def get( self, entity, ident, - options: Incomplete | None = ..., - populate_existing: bool = ..., - with_for_update: Incomplete | None = ..., - identity_token: Incomplete | None = ..., + options: Incomplete | None = None, + populate_existing: bool = False, + with_for_update: Incomplete | None = None, + identity_token: Incomplete | None = None, ): ... async def stream( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def stream_scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def delete(self, instance): ... - async def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... - async def flush(self, objects: Incomplete | None = ...) -> None: ... + async def merge(self, instance, load: bool = True, options: Incomplete | None = None): ... + async def flush(self, objects: Incomplete | None = None) -> None: ... def get_transaction(self): ... def get_nested_transaction(self): ... - def get_bind(self, mapper: Incomplete | None = ..., clause: Incomplete | None = ..., bind: Incomplete | None = ..., **kw): ... + def get_bind( + self, mapper: Incomplete | None = None, clause: Incomplete | None = None, bind: Incomplete | None = None, **kw + ): ... async def connection(self, **kw): ... def begin(self, **kw): ... def begin_nested(self, **kw): ... @@ -68,13 +70,13 @@ class AsyncSession(ReversibleProxy): def object_session(cls, instance): ... def __contains__(self, instance): ... def __iter__(self): ... - def add(self, instance, _warn: bool = ...) -> None: ... + def add(self, instance, _warn: bool = True) -> None: ... def add_all(self, instances) -> None: ... - def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = None) -> None: ... def expire_all(self) -> None: ... def expunge(self, instance) -> None: ... def expunge_all(self) -> None: ... - def is_modified(self, instance, include_collections: bool = ...): ... + def is_modified(self, instance, include_collections: bool = True): ... def in_transaction(self): ... def in_nested_transaction(self): ... @property @@ -103,12 +105,12 @@ class AsyncSessionTransaction(ReversibleProxy, StartableContext): session: Any nested: Any sync_transaction: Any - def __init__(self, session, nested: bool = ...) -> None: ... + def __init__(self, session, nested: bool = False) -> None: ... @property def is_active(self): ... async def rollback(self) -> None: ... async def commit(self) -> None: ... - async def start(self, is_ctxmanager: bool = ...): ... + async def start(self, is_ctxmanager: bool = False): ... async def __aexit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi index f17b2d3b60ae..47a5793cb398 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi @@ -12,16 +12,16 @@ class AutomapBase: @classmethod def prepare( cls, - autoload_with: Incomplete | None = ..., - engine: Incomplete | None = ..., - reflect: bool = ..., - schema: Incomplete | None = ..., - classname_for_table: Incomplete | None = ..., - collection_class: Incomplete | None = ..., - name_for_scalar_relationship: Incomplete | None = ..., - name_for_collection_relationship: Incomplete | None = ..., - generate_relationship: Incomplete | None = ..., + autoload_with: Incomplete | None = None, + engine: Incomplete | None = None, + reflect: bool = False, + schema: Incomplete | None = None, + classname_for_table: Incomplete | None = None, + collection_class: Incomplete | None = None, + name_for_scalar_relationship: Incomplete | None = None, + name_for_collection_relationship: Incomplete | None = None, + generate_relationship: Incomplete | None = None, reflection_options=..., ) -> None: ... -def automap_base(declarative_base: Incomplete | None = ..., **kw): ... +def automap_base(declarative_base: Incomplete | None = None, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi index 2cf3c3250ac0..250844a1d85f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi @@ -11,16 +11,16 @@ class Bakery: class BakedQuery: steps: Any - def __init__(self, bakery, initial_fn, args=...) -> None: ... + def __init__(self, bakery, initial_fn, args=()) -> None: ... @classmethod - def bakery(cls, size: int = ..., _size_alert: Incomplete | None = ...): ... + def bakery(cls, size: int = 200, _size_alert: Incomplete | None = None): ... def __iadd__(self, other): ... def __add__(self, other): ... def add_criteria(self, fn, *args): ... def with_criteria(self, fn, *args): ... def for_session(self, session): ... def __call__(self, session): ... - def spoil(self, full: bool = ...): ... + def spoil(self, full: bool = False): ... def to_query(self, query_or_session): ... class Result: diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi index 08a80eb03bce..b8355d51ced1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi @@ -22,13 +22,13 @@ class ShardedSession(Session): self, shard_chooser, id_chooser, - execute_chooser: Incomplete | None = ..., - shards: Incomplete | None = ..., + execute_chooser: Incomplete | None = None, + shards: Incomplete | None = None, query_cls=..., **kwargs, ): ... def connection_callable( - self, mapper: Incomplete | None = ..., instance: Incomplete | None = ..., shard_id: Incomplete | None = ..., **kwargs + self, mapper: Incomplete | None = None, instance: Incomplete | None = None, shard_id: Incomplete | None = None, **kwargs ): ... - def get_bind(self, mapper: Incomplete | None = ..., shard_id: Incomplete | None = ..., instance: Incomplete | None = ..., clause: Incomplete | None = ..., **kw): ... # type: ignore[override] + def get_bind(self, mapper: Incomplete | None = None, shard_id: Incomplete | None = None, instance: Incomplete | None = None, clause: Incomplete | None = None, **kw): ... # type: ignore[override] def bind_shard(self, shard_id, bind) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi index eda35d683c6e..d9d20108f4ab 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi @@ -10,7 +10,7 @@ class hybrid_method(interfaces.InspectionAttrInfo): is_attribute: bool extension_type: Any func: Any - def __init__(self, func, expr: Incomplete | None = ...) -> None: ... + def __init__(self, func, expr: Incomplete | None = None) -> None: ... def __get__(self, instance, owner): ... expr: Any def expression(self, expr): ... @@ -27,11 +27,11 @@ class hybrid_property(interfaces.InspectionAttrInfo): def __init__( self, fget, - fset: Incomplete | None = ..., - fdel: Incomplete | None = ..., - expr: Incomplete | None = ..., - custom_comparator: Incomplete | None = ..., - update_expr: Incomplete | None = ..., + fset: Incomplete | None = None, + fdel: Incomplete | None = None, + expr: Incomplete | None = None, + custom_comparator: Incomplete | None = None, + update_expr: Incomplete | None = None, ) -> None: ... def __get__(self, instance, owner): ... def __set__(self, instance, value) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi index 1178ebd4fff4..8d34ff0db8b8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi @@ -10,7 +10,7 @@ class index_property(hybrid_property): datatype: Any onebased: Any def __init__( - self, attr_name, index, default=..., datatype: Incomplete | None = ..., mutable: bool = ..., onebased: bool = ... + self, attr_name, index, default=..., datatype: Incomplete | None = None, mutable: bool = True, onebased: bool = True ): ... def fget(self, instance): ... def fset(self, instance, value) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi index d054f2def40d..d88af6e40c01 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi @@ -39,7 +39,7 @@ class _ClassInstrumentationAdapter(ClassManager): def manage(self) -> None: ... def unregister(self) -> None: ... def manager_getter(self): ... - def instrument_attribute(self, key, inst, propagated: bool = ...) -> None: ... + def instrument_attribute(self, key, inst, propagated: bool = False) -> None: ... def post_configure_attribute(self, key) -> None: ... def install_descriptor(self, key, inst) -> None: ... def uninstall_descriptor(self, key) -> None: ... @@ -47,8 +47,8 @@ class _ClassInstrumentationAdapter(ClassManager): def uninstall_member(self, key) -> None: ... def instrument_collection_class(self, key, collection_class): ... def initialize_collection(self, key, state, factory): ... - def new_instance(self, state: Incomplete | None = ...): ... - def setup_instance(self, instance, state: Incomplete | None = ...): ... + def new_instance(self, state: Incomplete | None = None): ... + def setup_instance(self, instance, state: Incomplete | None = None): ... def teardown_instance(self, instance) -> None: ... def has_state(self, instance): ... def state_getter(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi index 7c86012baa48..bebca695be58 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi @@ -1,20 +1,20 @@ from _typeshed import Incomplete from typing import Any -def ordering_list(attr, count_from: Incomplete | None = ..., **kw): ... +def ordering_list(attr, count_from: Incomplete | None = None, **kw): ... class OrderingList(list[Any]): ordering_attr: Any ordering_func: Any reorder_on_append: Any def __init__( - self, ordering_attr: Incomplete | None = ..., ordering_func: Incomplete | None = ..., reorder_on_append: bool = ... + self, ordering_attr: Incomplete | None = None, ordering_func: Incomplete | None = None, reorder_on_append: bool = False ) -> None: ... def reorder(self) -> None: ... def append(self, entity) -> None: ... def insert(self, index, entity) -> None: ... def remove(self, entity) -> None: ... - def pop(self, index: int = ...): ... # type: ignore[override] + def pop(self, index: int = -1): ... # type: ignore[override] def __setitem__(self, index, entity) -> None: ... def __delitem__(self, index) -> None: ... def __setslice__(self, start, end, values) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi index 4177beb2f2e5..3584cf3ebd4c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi @@ -2,7 +2,9 @@ from _typeshed import Incomplete def Serializer(*args, **kw): ... def Deserializer( - file, metadata: Incomplete | None = ..., scoped_session: Incomplete | None = ..., engine: Incomplete | None = ... + file, metadata: Incomplete | None = None, scoped_session: Incomplete | None = None, engine: Incomplete | None = None +): ... +def dumps(obj, protocol=5): ... +def loads( + data, metadata: Incomplete | None = None, scoped_session: Incomplete | None = None, engine: Incomplete | None = None ): ... -def dumps(obj, protocol=...): ... -def loads(data, metadata: Incomplete | None = ..., scoped_session: Incomplete | None = ..., engine: Incomplete | None = ...): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi b/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi index f1b3362d14dc..049185fd8048 100644 --- a/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi @@ -22,8 +22,8 @@ class Connection(_LegacyConnection): def commit(self) -> None: ... def rollback(self) -> None: ... def close(self) -> None: ... - def execute(self, statement, parameters: Incomplete | None = ..., execution_options: Incomplete | None = ...): ... # type: ignore[override] - def scalar(self, statement, parameters: Incomplete | None = ..., execution_options: Incomplete | None = ...): ... # type: ignore[override] + def execute(self, statement, parameters: Incomplete | None = None, execution_options: Incomplete | None = None): ... # type: ignore[override] + def scalar(self, statement, parameters: Incomplete | None = None, execution_options: Incomplete | None = None): ... # type: ignore[override] class Engine(_LegacyEngine): transaction: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/inspection.pyi b/stubs/SQLAlchemy/sqlalchemy/inspection.pyi index d758818c57fc..3e92030a6f5d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/inspection.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/inspection.pyi @@ -1 +1 @@ -def inspect(subject, raiseerr: bool = ...): ... +def inspect(subject, raiseerr: bool = True): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/log.pyi b/stubs/SQLAlchemy/sqlalchemy/log.pyi index 98b20ef91797..2bb42e332f15 100644 --- a/stubs/SQLAlchemy/sqlalchemy/log.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/log.pyi @@ -28,7 +28,7 @@ class InstanceLogger: def isEnabledFor(self, level): ... def getEffectiveLevel(self): ... -def instance_logger(instance: Identified, echoflag: _EchoFlag = ...) -> None: ... +def instance_logger(instance: Identified, echoflag: _EchoFlag = None) -> None: ... class echo_property: __doc__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi index 6e32aa68bacf..a0ba4126d5fa 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi @@ -85,7 +85,7 @@ from .util import ( with_polymorphic as with_polymorphic, ) -def create_session(bind: Incomplete | None = ..., **kwargs): ... +def create_session(bind: Incomplete | None = None, **kwargs): ... with_loader_criteria: Any relationship: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi index c054153eef86..d181cf386d9c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi @@ -32,10 +32,10 @@ class QueryableAttribute( class_, key, parententity, - impl: Incomplete | None = ..., - comparator: Incomplete | None = ..., - of_type: Incomplete | None = ..., - extra_criteria=..., + impl: Incomplete | None = None, + comparator: Incomplete | None = None, + of_type: Incomplete | None = None, + extra_criteria=(), ) -> None: ... def __reduce__(self): ... def get_history(self, instance, passive=...): ... @@ -52,7 +52,7 @@ class QueryableAttribute( def label(self, name): ... def operate(self, op, *other, **kwargs): ... def reverse_operate(self, op, other, **kwargs): ... - def hasparent(self, state, optimistic: bool = ...): ... + def hasparent(self, state, optimistic: bool = False): ... def __getattr__(self, key: str): ... @memoized_property def property(self): ... @@ -112,17 +112,17 @@ class AttributeImpl: key, callable_, dispatch, - trackparent: bool = ..., - compare_function: Incomplete | None = ..., - active_history: bool = ..., - parent_token: Incomplete | None = ..., - load_on_unexpire: bool = ..., - send_modified_events: bool = ..., - accepts_scalar_loader: Incomplete | None = ..., + trackparent: bool = False, + compare_function: Incomplete | None = None, + active_history: bool = False, + parent_token: Incomplete | None = None, + load_on_unexpire: bool = True, + send_modified_events: bool = True, + accepts_scalar_loader: Incomplete | None = None, **kwargs, ) -> None: ... active_history: Any - def hasparent(self, state, optimistic: bool = ...): ... + def hasparent(self, state, optimistic: bool = False): ... def sethasparent(self, state, parent_state, value) -> None: ... def get_history(self, state, dict_, passive=...) -> None: ... def get_all_pending(self, state, dict_, passive=...) -> None: ... @@ -130,7 +130,9 @@ class AttributeImpl: def append(self, state, dict_, value, initiator, passive=...) -> None: ... def remove(self, state, dict_, value, initiator, passive=...) -> None: ... def pop(self, state, dict_, value, initiator, passive=...) -> None: ... - def set(self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = ..., pop: bool = ...) -> None: ... + def set( + self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = None, pop: bool = False + ) -> None: ... def get_committed_value(self, state, dict_, passive=...): ... def set_committed_value(self, state, dict_, value): ... @@ -143,7 +145,9 @@ class ScalarAttributeImpl(AttributeImpl): def __init__(self, *arg, **kw) -> None: ... def delete(self, state, dict_) -> None: ... def get_history(self, state, dict_, passive=...): ... - def set(self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = ..., pop: bool = ...) -> None: ... + def set( + self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = None, pop: bool = False + ) -> None: ... def fire_replace_event(self, state, dict_, value, previous, initiator): ... def fire_remove_event(self, state, dict_, value, initiator) -> None: ... @property @@ -157,7 +161,9 @@ class ScalarObjectAttributeImpl(ScalarAttributeImpl): def delete(self, state, dict_) -> None: ... def get_history(self, state, dict_, passive=...): ... def get_all_pending(self, state, dict_, passive=...): ... - def set(self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = ..., pop: bool = ...) -> None: ... + def set( + self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = None, pop: bool = False + ) -> None: ... def fire_remove_event(self, state, dict_, value, initiator) -> None: ... def fire_replace_event(self, state, dict_, value, previous, initiator): ... @@ -175,10 +181,10 @@ class CollectionAttributeImpl(AttributeImpl): key, callable_, dispatch, - typecallable: Incomplete | None = ..., - trackparent: bool = ..., - copy_function: Incomplete | None = ..., - compare_function: Incomplete | None = ..., + typecallable: Incomplete | None = None, + trackparent: bool = False, + copy_function: Incomplete | None = None, + compare_function: Incomplete | None = None, **kwargs, ) -> None: ... def get_history(self, state, dict_, passive=...): ... @@ -196,14 +202,14 @@ class CollectionAttributeImpl(AttributeImpl): state, dict_, value, - initiator: Incomplete | None = ..., + initiator: Incomplete | None = None, passive=..., - check_old: Incomplete | None = ..., - pop: bool = ..., - _adapt: bool = ..., + check_old: Incomplete | None = None, + pop: bool = False, + _adapt: bool = True, ) -> None: ... def set_committed_value(self, state, dict_, value): ... - def get_collection(self, state, dict_, user_data: Incomplete | None = ..., passive=...): ... + def get_collection(self, state, dict_, user_data: Incomplete | None = None, passive=...): ... def backref_listeners(attribute, key, uselist): ... @@ -227,26 +233,26 @@ HISTORY_BLANK: Any def get_history(obj, key, passive=...): ... def get_state_history(state, key, passive=...): ... -def has_parent(cls, obj, key, optimistic: bool = ...): ... +def has_parent(cls, obj, key, optimistic: bool = False): ... def register_attribute(class_, key, **kw): ... def register_attribute_impl( class_, key, - uselist: bool = ..., - callable_: Incomplete | None = ..., - useobject: bool = ..., - impl_class: Incomplete | None = ..., - backref: Incomplete | None = ..., + uselist: bool = False, + callable_: Incomplete | None = None, + useobject: bool = False, + impl_class: Incomplete | None = None, + backref: Incomplete | None = None, **kw, ): ... def register_descriptor( - class_, key, comparator: Incomplete | None = ..., parententity: Incomplete | None = ..., doc: Incomplete | None = ... + class_, key, comparator: Incomplete | None = None, parententity: Incomplete | None = None, doc: Incomplete | None = None ): ... def unregister_attribute(class_, key) -> None: ... def init_collection(obj, key): ... def init_state_collection(state, dict_, key): ... def set_committed_value(instance, key, value) -> None: ... -def set_attribute(instance, key, value, initiator: Incomplete | None = ...) -> None: ... +def set_attribute(instance, key, value, initiator: Incomplete | None = None) -> None: ... def get_attribute(instance, key): ... def del_attribute(instance, key) -> None: ... def flag_modified(instance, key) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi index 4d247f53c726..d231d89d4505 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi @@ -55,7 +55,7 @@ def _is_mapped_class(entity): ... _state_mapper: Any -def class_mapper(class_, configure: bool = ...): ... +def class_mapper(class_, configure: bool = True): ... class InspectionAttr: is_selectable: bool diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi index b21f02a3a35f..129b82fbbc6f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi @@ -7,7 +7,7 @@ def remove_class(classname, cls, decl_class_registry) -> None: ... class _MultipleClassMarker: on_remove: Any contents: Any - def __init__(self, classes, on_remove: Incomplete | None = ...) -> None: ... + def __init__(self, classes, on_remove: Incomplete | None = None) -> None: ... def remove_item(self, cls) -> None: ... def __iter__(self): ... def attempt_get(self, path, key): ... @@ -48,5 +48,5 @@ class _class_resolver: arg: Any fallback: Any favor_tables: Any - def __init__(self, cls, prop, fallback, arg, favor_tables: bool = ...) -> None: ... + def __init__(self, cls, prop, fallback, arg, favor_tables: bool = False) -> None: ... def __call__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi index 8efe02c952a0..91d88b539fb2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -73,22 +73,22 @@ class CollectionAdapter: @property def data(self): ... def bulk_appender(self): ... - def append_with_event(self, item, initiator: Incomplete | None = ...) -> None: ... + def append_with_event(self, item, initiator: Incomplete | None = None) -> None: ... def append_without_event(self, item) -> None: ... def append_multiple_without_event(self, items) -> None: ... def bulk_remover(self): ... - def remove_with_event(self, item, initiator: Incomplete | None = ...) -> None: ... + def remove_with_event(self, item, initiator: Incomplete | None = None) -> None: ... def remove_without_event(self, item) -> None: ... - def clear_with_event(self, initiator: Incomplete | None = ...) -> None: ... + def clear_with_event(self, initiator: Incomplete | None = None) -> None: ... def clear_without_event(self) -> None: ... def __iter__(self): ... def __len__(self) -> int: ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... - def fire_append_wo_mutation_event(self, item, initiator: Incomplete | None = ...): ... - def fire_append_event(self, item, initiator: Incomplete | None = ...): ... - def fire_remove_event(self, item, initiator: Incomplete | None = ...) -> None: ... - def fire_pre_remove_event(self, initiator: Incomplete | None = ...) -> None: ... + def fire_append_wo_mutation_event(self, item, initiator: Incomplete | None = None): ... + def fire_append_event(self, item, initiator: Incomplete | None = None): ... + def fire_remove_event(self, item, initiator: Incomplete | None = None) -> None: ... + def fire_pre_remove_event(self, initiator: Incomplete | None = None) -> None: ... class InstrumentedList(list[_T]): def append(self, item, _sa_initiator: Event | Literal[False] | None = None) -> None: ... @@ -112,8 +112,8 @@ class InstrumentedDict(dict[_KT, _VT]): ... class MappedCollection(dict[_KT, _VT]): keyfunc: Any def __init__(self, keyfunc) -> None: ... - def set(self, value: _VT, _sa_initiator: Event | Literal[False] | None = ...) -> None: ... - def remove(self, value: _VT, _sa_initiator: Event | Literal[False] | None = ...) -> None: ... + def set(self, value: _VT, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def remove(self, value: _VT, _sa_initiator: Event | Literal[False] | None = None) -> None: ... def __delitem__(self, key: _KT, _sa_initiatorEvent: Event | Literal[False] | None = None) -> None: ... def __setitem__(self, key: _KT, value: _VT, _sa_initiator: Event | Literal[False] | None = None) -> None: ... @overload diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi index 423eeb985552..7986198b21ec 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi @@ -37,8 +37,8 @@ class QueryContext: params, session, load_options, - execution_options: Incomplete | None = ..., - bind_arguments: Incomplete | None = ..., + execution_options: Incomplete | None = None, + bind_arguments: Incomplete | None = None, ) -> None: ... class ORMCompileState(CompileState): @@ -142,8 +142,8 @@ class _BundleEntity(_QueryEntity): expr, entities_collection, is_current_entities: bool, - setup_entities: bool = ..., - parent_bundle: Incomplete | None = ..., + setup_entities: bool = True, + parent_bundle: Incomplete | None = None, ) -> None: ... @property def mapper(self): ... @@ -178,7 +178,7 @@ class _RawColumnEntity(_ColumnEntity): entities_collection, raw_column_index, is_current_entities: bool, - parent_bundle: Incomplete | None = ..., + parent_bundle: Incomplete | None = None, ) -> None: ... def corresponds_to(self, entity): ... def setup_compile_state(self, compile_state) -> None: ... @@ -200,7 +200,7 @@ class _ORMColumnEntity(_ColumnEntity): parententity, raw_column_index, is_current_entities: bool, - parent_bundle: Incomplete | None = ..., + parent_bundle: Incomplete | None = None, ) -> None: ... def corresponds_to(self, entity): ... def setup_compile_state(self, compile_state) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi index 3afa68d90912..f109fd39bba0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi @@ -32,10 +32,10 @@ class DeclarativeMeta(type): def __setattr__(cls, key: str, value: Any) -> None: ... def __delattr__(cls, key: str) -> None: ... -def synonym_for(name, map_column: bool = ...): ... +def synonym_for(name, map_column: bool = False): ... class declared_attr(interfaces._MappedAttribute, property): - def __init__(self, fget, cascading: bool = ...) -> None: ... + def __init__(self, fget, cascading: bool = False) -> None: ... def __get__(self, self_, cls): ... @hybridproperty def cascading(self): ... @@ -48,23 +48,23 @@ class _stateful_declared_attr(declared_attr): def declarative_mixin(cls: _ClsT) -> _ClsT: ... @overload def declarative_base( - bind: Connectable | None = ..., - metadata: MetaData | None = ..., - mapper: Incomplete | None = ..., + bind: Connectable | None = None, + metadata: MetaData | None = None, + mapper: Incomplete | None = None, cls: type[Any] | tuple[type[Any], ...] = ..., - name: str = ..., + name: str = "Base", constructor: Callable[..., None] = ..., - class_registry: dict[str, type[Any]] | None = ..., + class_registry: dict[str, type[Any]] | None = None, ) -> type[_DeclarativeBase]: ... @overload def declarative_base( - bind: Connectable | None = ..., - metadata: MetaData | None = ..., - mapper: Incomplete | None = ..., + bind: Connectable | None = None, + metadata: MetaData | None = None, + mapper: Incomplete | None = None, cls: type[Any] | tuple[type[Any], ...] = ..., - name: str = ..., + name: str = "Base", constructor: Callable[..., None] = ..., - class_registry: dict[str, type[Any]] | None = ..., + class_registry: dict[str, type[Any]] | None = None, *, metaclass: _DeclarativeBaseMeta[_DeclT], ) -> _DeclT: ... @@ -85,25 +85,25 @@ class registry: constructor: Callable[..., None] def __init__( self, - metadata: MetaData | None = ..., - class_registry: dict[str, type[Any]] | None = ..., + metadata: MetaData | None = None, + class_registry: dict[str, type[Any]] | None = None, constructor: Callable[..., None] = ..., - _bind: Connectable | None = ..., + _bind: Connectable | None = None, ) -> None: ... @property def mappers(self) -> frozenset[Any]: ... - def configure(self, cascade: bool = ...) -> None: ... - def dispose(self, cascade: bool = ...) -> None: ... + def configure(self, cascade: bool = False) -> None: ... + def dispose(self, cascade: bool = False) -> None: ... @overload def generate_base( - self, mapper: Incomplete | None = ..., cls: type[Any] | tuple[type[Any], ...] = ..., name: str = ... + self, mapper: Incomplete | None = None, cls: type[Any] | tuple[type[Any], ...] = ..., name: str = "Base" ) -> type[_DeclarativeBase]: ... @overload def generate_base( self, - mapper: Incomplete | None = ..., + mapper: Incomplete | None = None, cls: type[Any] | tuple[type[Any], ...] = ..., - name: str = ..., + name: str = "Base", *, metaclass: _DeclarativeBaseMeta[_DeclT], ) -> _DeclT: ... @@ -125,7 +125,7 @@ class registry: self, *, mapper: Incomplete | None = ..., metaclass: _DeclarativeBaseMeta[_DeclT] ) -> Callable[[_ClsT], _ClsT | _DeclT | Any]: ... def map_declaratively(self, cls): ... - def map_imperatively(self, class_, local_table: Incomplete | None = ..., **kw): ... + def map_imperatively(self, class_, local_table: Incomplete | None = None, **kw): ... @overload def as_declarative( diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi index 9d5dbf1c0723..7aab93cf9046 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi @@ -43,5 +43,5 @@ class _DeferredMapperConfig(_ClassScanMapperConfig): @classmethod def config_for_cls(cls, class_): ... @classmethod - def classes_for_base(cls, base_cls, sort: bool = ...): ... + def classes_for_base(cls, base_cls, sort: bool = True): ... def map(self, mapper_kw=...): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi index f4e8b7930dd9..119d974fa940 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi @@ -61,11 +61,11 @@ class SynonymProperty(DescriptorProperty): def __init__( self, name, - map_column: Incomplete | None = ..., - descriptor: Incomplete | None = ..., - comparator_factory: Incomplete | None = ..., - doc: Incomplete | None = ..., - info: Incomplete | None = ..., + map_column: Incomplete | None = None, + descriptor: Incomplete | None = None, + comparator_factory: Incomplete | None = None, + doc: Incomplete | None = None, + info: Incomplete | None = None, ) -> None: ... @property def uses_objects(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi index 40193a48f6be..6008d1d9f04a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi @@ -21,22 +21,22 @@ class DynamicAttributeImpl(attributes.AttributeImpl): target_mapper: Any query_class: Any def __init__( - self, class_, key, typecallable, dispatch, target_mapper, order_by, query_class: Incomplete | None = ..., **kw + self, class_, key, typecallable, dispatch, target_mapper, order_by, query_class: Incomplete | None = None, **kw ) -> None: ... def get(self, state, dict_, passive=...): ... - def get_collection(self, state, dict_, user_data: Incomplete | None = ..., passive=...): ... - def fire_append_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = ...) -> None: ... - def fire_remove_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = ...) -> None: ... + def get_collection(self, state, dict_, user_data: Incomplete | None = None, passive=...): ... + def fire_append_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = None) -> None: ... + def fire_remove_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = None) -> None: ... def set( self, state, dict_, value, - initiator: Incomplete | None = ..., + initiator: Incomplete | None = None, passive=..., - check_old: Incomplete | None = ..., - pop: bool = ..., - _adapt: bool = ..., + check_old: Incomplete | None = None, + pop: bool = False, + _adapt: bool = True, ) -> None: ... def delete(self, *args, **kwargs) -> None: ... def set_committed_value(self, state, dict_, value) -> None: ... @@ -74,7 +74,7 @@ class CollectionHistory: unchanged_items: Any added_items: Any deleted_items: Any - def __init__(self, attr, state, apply_to: Incomplete | None = ...) -> None: ... + def __init__(self, attr, state, apply_to: Incomplete | None = None) -> None: ... @property def added_plus_unchanged(self): ... @property diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi index 9091e9694c89..1e4cf1b01419 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi @@ -11,7 +11,7 @@ class _NoObject(operators.ColumnOperators[Any]): class EvaluatorCompiler: target_cls: Any - def __init__(self, target_cls: Incomplete | None = ...) -> None: ... + def __init__(self, target_cls: Incomplete | None = None) -> None: ... def process(self, *clauses): ... def visit_grouping(self, clause): ... def visit_null(self, clause): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi index 384ffdf114cb..b589abf2f489 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi @@ -18,15 +18,15 @@ class DetachedInstanceError(sa_exc.SQLAlchemyError): code: str class UnmappedInstanceError(UnmappedError): - def __init__(self, obj, msg: Incomplete | None = ...) -> None: ... + def __init__(self, obj, msg: Incomplete | None = None) -> None: ... def __reduce__(self): ... class UnmappedClassError(UnmappedError): - def __init__(self, cls, msg: Incomplete | None = ...) -> None: ... + def __init__(self, cls, msg: Incomplete | None = None) -> None: ... def __reduce__(self): ... class ObjectDeletedError(sa_exc.InvalidRequestError): - def __init__(self, state, msg: Incomplete | None = ...) -> None: ... + def __init__(self, state, msg: Incomplete | None = None) -> None: ... def __reduce__(self): ... class UnmappedColumnError(sa_exc.InvalidRequestError): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi index 062e91c0c095..59f767906eed 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi @@ -10,7 +10,7 @@ class IdentityMap: def has_key(self, key): ... def popitem(self) -> None: ... def pop(self, key, *args) -> None: ... - def setdefault(self, key, default: Incomplete | None = ...) -> None: ... + def setdefault(self, key, default: Incomplete | None = None) -> None: ... def __len__(self) -> int: ... def copy(self) -> None: ... def __setitem__(self, key, value) -> None: ... @@ -22,7 +22,7 @@ class WeakInstanceDict(IdentityMap): def contains_state(self, state): ... def replace(self, state): ... def add(self, state): ... - def get(self, key, default: Incomplete | None = ...): ... + def get(self, key, default: Incomplete | None = None): ... def items(self): ... def values(self): ... def __iter__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi index 6c972cef57ad..cfdfa096db9d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi @@ -38,10 +38,10 @@ class ClassManager(HasMemoized, dict[Any, Any]): def state_getter(self): ... @hybridmethod def dict_getter(self): ... - def instrument_attribute(self, key, inst, propagated: bool = ...) -> None: ... + def instrument_attribute(self, key, inst, propagated: bool = False) -> None: ... def subclass_managers(self, recursive) -> None: ... def post_configure_attribute(self, key) -> None: ... - def uninstrument_attribute(self, key, propagated: bool = ...) -> None: ... + def uninstrument_attribute(self, key, propagated: bool = False) -> None: ... def unregister(self) -> None: ... def install_descriptor(self, key, inst) -> None: ... def uninstall_descriptor(self, key) -> None: ... @@ -49,15 +49,15 @@ class ClassManager(HasMemoized, dict[Any, Any]): def uninstall_member(self, key) -> None: ... def instrument_collection_class(self, key, collection_class): ... def initialize_collection(self, key, state, factory): ... - def is_instrumented(self, key, search: bool = ...): ... + def is_instrumented(self, key, search: bool = False): ... def get_impl(self, key): ... @property def attributes(self): ... - def new_instance(self, state: Incomplete | None = ...): ... - def setup_instance(self, instance, state: Incomplete | None = ...) -> None: ... + def new_instance(self, state: Incomplete | None = None): ... + def setup_instance(self, instance, state: Incomplete | None = None) -> None: ... def teardown_instance(self, instance) -> None: ... def has_state(self, instance): ... - def has_parent(self, state, key, optimistic: bool = ...): ... + def has_parent(self, state, key, optimistic: bool = False): ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... @@ -77,12 +77,12 @@ manager_of_class = base.manager_of_class def register_class( class_, - finalize: bool = ..., - mapper: Incomplete | None = ..., - registry: Incomplete | None = ..., - declarative_scan: Incomplete | None = ..., - expired_attribute_loader: Incomplete | None = ..., - init_method: Incomplete | None = ..., + finalize: bool = True, + mapper: Incomplete | None = None, + registry: Incomplete | None = None, + declarative_scan: Incomplete | None = None, + expired_attribute_loader: Incomplete | None = None, + init_method: Incomplete | None = None, ): ... def unregister_class(class_) -> None: ... def is_instrumented(instance, key): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi index 61b1c7f7eb0a..07a8975782b8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi @@ -46,7 +46,7 @@ class MapperProperty(HasCacheKey, _MappedAttribute, InspectionAttr, util.Memoize is_property: bool def setup(self, context, query_entity, path, adapter, **kwargs) -> None: ... def create_row_processor(self, context, query_entity, path, mapper, result, adapter, populators) -> None: ... - def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = ...): ... + def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = None): ... parent: Any def set_parent(self, parent, init) -> None: ... def instrument_class(self, mapper) -> None: ... @@ -64,7 +64,7 @@ class PropComparator(operators.ColumnOperators[_T], Generic[_T]): __visit_name__: str prop: Any property: Any - def __init__(self, prop, parentmapper, adapt_to_entity: Incomplete | None = ...) -> None: ... + def __init__(self, prop, parentmapper, adapt_to_entity: Incomplete | None = None) -> None: ... def __clause_element__(self) -> None: ... def adapt_to_entity(self, adapt_to_entity): ... @property @@ -79,8 +79,8 @@ class PropComparator(operators.ColumnOperators[_T], Generic[_T]): def of_type_op(a, class_): ... def of_type(self, class_): ... def and_(self, *criteria): ... - def any(self, criterion: Incomplete | None = ..., **kwargs): ... - def has(self, criterion: Incomplete | None = ..., **kwargs): ... + def any(self, criterion: Incomplete | None = None, **kwargs): ... + def has(self, criterion: Incomplete | None = None, **kwargs): ... class StrategizedProperty(MapperProperty): inherit_cache: bool @@ -111,7 +111,7 @@ class CriteriaOption(CompileStateOption): class UserDefinedOption(ORMOption): propagate_to_loaders: bool payload: Any - def __init__(self, payload: Incomplete | None = ...) -> None: ... + def __init__(self, payload: Incomplete | None = None) -> None: ... class MapperOption(ORMOption): propagate_to_loaders: bool diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi index 8341245981e4..328b33ef126b 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi @@ -2,18 +2,18 @@ from _typeshed import Incomplete from typing import Any def instances(cursor, context): ... -def merge_frozen_result(session, statement, frozen_result, load: bool = ...): ... -def merge_result(query, iterator, load: bool = ...): ... +def merge_frozen_result(session, statement, frozen_result, load: bool = True): ... +def merge_result(query, iterator, load: bool = True): ... def get_from_identity(session, mapper, key, passive): ... def load_on_ident( session, statement, key, - load_options: Incomplete | None = ..., - refresh_state: Incomplete | None = ..., - with_for_update: Incomplete | None = ..., - only_load_props: Incomplete | None = ..., - no_autoflush: bool = ..., + load_options: Incomplete | None = None, + refresh_state: Incomplete | None = None, + with_for_update: Incomplete | None = None, + only_load_props: Incomplete | None = None, + no_autoflush: bool = False, bind_arguments=..., execution_options=..., ): ... @@ -21,12 +21,12 @@ def load_on_pk_identity( session, statement, primary_key_identity, - load_options: Incomplete | None = ..., - refresh_state: Incomplete | None = ..., - with_for_update: Incomplete | None = ..., - only_load_props: Incomplete | None = ..., - identity_token: Incomplete | None = ..., - no_autoflush: bool = ..., + load_options: Incomplete | None = None, + refresh_state: Incomplete | None = None, + with_for_update: Incomplete | None = None, + only_load_props: Incomplete | None = None, + identity_token: Incomplete | None = None, + no_autoflush: bool = False, bind_arguments=..., execution_options=..., ): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi index 999ad8981258..816e98eb102f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi @@ -46,33 +46,33 @@ class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHas def __init__( self, class_, - local_table: Incomplete | None = ..., - properties: Incomplete | None = ..., - primary_key: Incomplete | None = ..., - non_primary: bool = ..., - inherits: Incomplete | None = ..., - inherit_condition: Incomplete | None = ..., - inherit_foreign_keys: Incomplete | None = ..., - always_refresh: bool = ..., - version_id_col: Incomplete | None = ..., - version_id_generator: Incomplete | None = ..., - polymorphic_on: Incomplete | None = ..., - _polymorphic_map: Incomplete | None = ..., - polymorphic_identity: Incomplete | None = ..., - concrete: bool = ..., - with_polymorphic: Incomplete | None = ..., - polymorphic_load: Incomplete | None = ..., - allow_partial_pks: bool = ..., - batch: bool = ..., - column_prefix: Incomplete | None = ..., - include_properties: Incomplete | None = ..., - exclude_properties: Incomplete | None = ..., - passive_updates: bool = ..., - passive_deletes: bool = ..., - confirm_deleted_rows: bool = ..., - eager_defaults: bool = ..., - legacy_is_orphan: bool = ..., - _compiled_cache_size: int = ..., + local_table: Incomplete | None = None, + properties: Incomplete | None = None, + primary_key: Incomplete | None = None, + non_primary: bool = False, + inherits: Incomplete | None = None, + inherit_condition: Incomplete | None = None, + inherit_foreign_keys: Incomplete | None = None, + always_refresh: bool = False, + version_id_col: Incomplete | None = None, + version_id_generator: Incomplete | None = None, + polymorphic_on: Incomplete | None = None, + _polymorphic_map: Incomplete | None = None, + polymorphic_identity: Incomplete | None = None, + concrete: bool = False, + with_polymorphic: Incomplete | None = None, + polymorphic_load: Incomplete | None = None, + allow_partial_pks: bool = True, + batch: bool = True, + column_prefix: Incomplete | None = None, + include_properties: Incomplete | None = None, + exclude_properties: Incomplete | None = None, + passive_updates: bool = True, + passive_deletes: bool = False, + confirm_deleted_rows: bool = True, + eager_defaults: bool = False, + legacy_is_orphan: bool = False, + _compiled_cache_size: int = 100, ): ... is_mapper: bool represents_outer_join: bool @@ -92,7 +92,7 @@ class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHas def add_properties(self, dict_of_properties) -> None: ... def add_property(self, key, prop) -> None: ... def has_property(self, key): ... - def get_property(self, key, _configure_mappers: bool = ...): ... + def get_property(self, key, _configure_mappers: bool = True): ... def get_property_by_column(self, column): ... @property def iterate_properties(self): ... @@ -126,11 +126,11 @@ class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHas def primary_mapper(self): ... @property def primary_base_mapper(self): ... - def identity_key_from_row(self, row, identity_token: Incomplete | None = ..., adapter: Incomplete | None = ...): ... - def identity_key_from_primary_key(self, primary_key, identity_token: Incomplete | None = ...): ... + def identity_key_from_row(self, row, identity_token: Incomplete | None = None, adapter: Incomplete | None = None): ... + def identity_key_from_primary_key(self, primary_key, identity_token: Incomplete | None = None): ... def identity_key_from_instance(self, instance): ... def primary_key_from_instance(self, instance): ... - def cascade_iterator(self, type_, state, halt_on: Incomplete | None = ...) -> None: ... + def cascade_iterator(self, type_, state, halt_on: Incomplete | None = None) -> None: ... class _OptGetColumnsNotAvailable(Exception): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi index 9da5d3161f46..8b7e2303352f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi @@ -15,7 +15,7 @@ class PathRegistry(HasCacheKey): def __ne__(self, other): ... def set(self, attributes, key, value) -> None: ... def setdefault(self, attributes, key, value) -> None: ... - def get(self, attributes, key, value: Incomplete | None = ...): ... + def get(self, attributes, key, value: Incomplete | None = None): ... def __len__(self) -> int: ... def __hash__(self) -> int: ... @property diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi index 8d5d721e7d5e..f6bef4909bd2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi @@ -3,7 +3,7 @@ from typing import Any from ..sql.base import CompileState, Options from ..sql.dml import DeleteDMLState, UpdateDMLState -def save_obj(base_mapper, states, uowtransaction, single: bool = ...) -> None: ... +def save_obj(base_mapper, states, uowtransaction, single: bool = False) -> None: ... def post_update(base_mapper, states, uowtransaction, post_update_cols) -> None: ... def delete_obj(base_mapper, states, uowtransaction) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi index ab769f034319..30fd701100d8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi @@ -19,11 +19,11 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi logger: Any load_options: Any session: Any - def __init__(self, entities, session: Incomplete | None = ...) -> None: ... + def __init__(self, entities, session: Incomplete | None = None) -> None: ... @property def statement(self): ... - def subquery(self, name: str | None = ..., with_labels: bool = ..., reduce_columns: bool = ...): ... - def cte(self, name: Incomplete | None = ..., recursive: bool = ..., nesting: bool = ...): ... + def subquery(self, name: str | None = None, with_labels: bool = False, reduce_columns: bool = False): ... + def cte(self, name: Incomplete | None = None, recursive: bool = False, nesting: bool = False): ... def label(self, name): ... def as_scalar(self): ... def scalar_subquery(self): ... @@ -43,7 +43,7 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi @property def whereclause(self): ... def with_polymorphic( - self, cls_or_mappers, selectable: Incomplete | None = ..., polymorphic_on: Incomplete | None = ... + self, cls_or_mappers, selectable: Incomplete | None = None, polymorphic_on: Incomplete | None = None ) -> Self: ... def yield_per(self, count) -> Self: ... def get(self, ident): ... @@ -52,8 +52,8 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi def correlate(self, *fromclauses) -> Self: ... def autoflush(self, setting) -> Self: ... def populate_existing(self) -> Self: ... - def with_parent(self, instance, property: Incomplete | None = ..., from_entity: Incomplete | None = ...): ... - def add_entity(self, entity, alias: Incomplete | None = ...) -> Self: ... + def with_parent(self, instance, property: Incomplete | None = None, from_entity: Incomplete | None = None): ... + def add_entity(self, entity, alias: Incomplete | None = None) -> Self: ... def with_session(self, session) -> Self: ... def from_self(self, *entities): ... def values(self, *columns): ... @@ -66,7 +66,12 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi def get_execution_options(self): ... def execution_options(self, **kwargs) -> Self: ... def with_for_update( - self, read: bool = ..., nowait: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ... + self, + read: bool = False, + nowait: bool = False, + of: Incomplete | None = None, + skip_locked: bool = False, + key_share: bool = False, ) -> Self: ... def params(self, *args, **kwargs) -> Self: ... def where(self, *criterion): ... @@ -100,12 +105,14 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi def __iter__(self) -> Iterator[_T]: ... @property def column_descriptions(self): ... - def instances(self, result_proxy, context: Incomplete | None = ...): ... - def merge_result(self, iterator, load: bool = ...): ... + def instances(self, result_proxy, context: Incomplete | None = None): ... + def merge_result(self, iterator, load: bool = True): ... def exists(self): ... def count(self) -> int: ... - def delete(self, synchronize_session: _SynchronizeSessionArgument = ...) -> int: ... - def update(self, values, synchronize_session: _SynchronizeSessionArgument = ..., update_args: Incomplete | None = ...): ... + def delete(self, synchronize_session: _SynchronizeSessionArgument = "evaluate") -> int: ... + def update( + self, values, synchronize_session: _SynchronizeSessionArgument = "evaluate", update_args: Incomplete | None = None + ): ... class FromStatement(GroupedElement, SelectBase, Executable): __visit_name__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi index e7382a512721..cac546132331 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi @@ -51,40 +51,40 @@ class RelationshipProperty(StrategizedProperty): def __init__( self, argument, - secondary: Incomplete | None = ..., - primaryjoin: Incomplete | None = ..., - secondaryjoin: Incomplete | None = ..., - foreign_keys: Incomplete | None = ..., - uselist: Incomplete | None = ..., - order_by: bool = ..., - backref: Incomplete | None = ..., - back_populates: Incomplete | None = ..., - overlaps: Incomplete | None = ..., - post_update: bool = ..., - cascade: bool = ..., - viewonly: bool = ..., - lazy: str = ..., - collection_class: Incomplete | None = ..., - passive_deletes=..., - passive_updates=..., - remote_side: Incomplete | None = ..., - enable_typechecks=..., - join_depth: Incomplete | None = ..., - comparator_factory: Incomplete | None = ..., - single_parent: bool = ..., - innerjoin: bool = ..., - distinct_target_key: Incomplete | None = ..., - doc: Incomplete | None = ..., - active_history=..., - cascade_backrefs=..., - load_on_pending: bool = ..., - bake_queries: bool = ..., - _local_remote_pairs: Incomplete | None = ..., - query_class: Incomplete | None = ..., - info: Incomplete | None = ..., - omit_join: Incomplete | None = ..., - sync_backref: Incomplete | None = ..., - _legacy_inactive_history_style: bool = ..., + secondary: Incomplete | None = None, + primaryjoin: Incomplete | None = None, + secondaryjoin: Incomplete | None = None, + foreign_keys: Incomplete | None = None, + uselist: Incomplete | None = None, + order_by: bool = False, + backref: Incomplete | None = None, + back_populates: Incomplete | None = None, + overlaps: Incomplete | None = None, + post_update: bool = False, + cascade: bool = False, + viewonly: bool = False, + lazy: str = "select", + collection_class: Incomplete | None = None, + passive_deletes=False, + passive_updates=True, + remote_side: Incomplete | None = None, + enable_typechecks=True, + join_depth: Incomplete | None = None, + comparator_factory: Incomplete | None = None, + single_parent: bool = False, + innerjoin: bool = False, + distinct_target_key: Incomplete | None = None, + doc: Incomplete | None = None, + active_history=False, + cascade_backrefs=True, + load_on_pending: bool = False, + bake_queries: bool = True, + _local_remote_pairs: Incomplete | None = None, + query_class: Incomplete | None = None, + info: Incomplete | None = None, + omit_join: Incomplete | None = None, + sync_backref: Incomplete | None = None, + _legacy_inactive_history_style: bool = False, ) -> None: ... def instrument_class(self, mapper) -> None: ... @@ -94,9 +94,9 @@ class RelationshipProperty(StrategizedProperty): self, prop, parentmapper, - adapt_to_entity: Incomplete | None = ..., - of_type: Incomplete | None = ..., - extra_criteria=..., + adapt_to_entity: Incomplete | None = None, + of_type: Incomplete | None = None, + extra_criteria=(), ) -> None: ... def adapt_to_entity(self, adapt_to_entity): ... @memoized_property @@ -109,8 +109,8 @@ class RelationshipProperty(StrategizedProperty): def in_(self, other) -> ColumnOperators[_T]: ... __hash__: ClassVar[None] # type: ignore[assignment] def __eq__(self, other): ... - def any(self, criterion: Incomplete | None = ..., **kwargs): ... - def has(self, criterion: Incomplete | None = ..., **kwargs): ... + def any(self, criterion: Incomplete | None = None, **kwargs): ... + def has(self, criterion: Incomplete | None = None, **kwargs): ... def contains(self, other, **kwargs) -> ColumnOperators[_T]: ... def __ne__(self, other) -> ColumnOperators[_T]: ... # type: ignore[override] @memoized_property @@ -119,7 +119,7 @@ class RelationshipProperty(StrategizedProperty): def merge( self, session, source_state, source_dict, dest_state, dest_dict, load, _recursive, _resolve_conflict_map ) -> None: ... - def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = ...) -> None: ... + def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = None) -> None: ... @memoized_property def entity(self): ... @memoized_property @@ -151,17 +151,17 @@ class JoinCondition: child_persist_selectable, parent_local_selectable, child_local_selectable, - primaryjoin: Incomplete | None = ..., - secondary: Incomplete | None = ..., - secondaryjoin: Incomplete | None = ..., - parent_equivalents: Incomplete | None = ..., - child_equivalents: Incomplete | None = ..., - consider_as_foreign_keys: Incomplete | None = ..., - local_remote_pairs: Incomplete | None = ..., - remote_side: Incomplete | None = ..., - self_referential: bool = ..., - prop: Incomplete | None = ..., - support_sync: bool = ..., + primaryjoin: Incomplete | None = None, + secondary: Incomplete | None = None, + secondaryjoin: Incomplete | None = None, + parent_equivalents: Incomplete | None = None, + child_equivalents: Incomplete | None = None, + consider_as_foreign_keys: Incomplete | None = None, + local_remote_pairs: Incomplete | None = None, + remote_side: Incomplete | None = None, + self_referential: bool = False, + prop: Incomplete | None = None, + support_sync: bool = True, can_be_synced_fn=..., ): ... @property @@ -177,9 +177,9 @@ class JoinCondition: @memoized_property def foreign_key_columns(self): ... def join_targets( - self, source_selectable, dest_selectable, aliased, single_crit: Incomplete | None = ..., extra_criteria=... + self, source_selectable, dest_selectable, aliased, single_crit: Incomplete | None = None, extra_criteria=() ): ... - def create_lazy_clause(self, reverse_direction: bool = ...): ... + def create_lazy_clause(self, reverse_direction: bool = False): ... class _ColInAnnotations: name: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi index 0731e46169c0..4f007eae9b9c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi @@ -10,9 +10,9 @@ class ScopedSessionMixin: class scoped_session(ScopedSessionMixin): session_factory: Any registry: Any - def __init__(self, session_factory, scopefunc: Incomplete | None = ...) -> None: ... + def __init__(self, session_factory, scopefunc: Incomplete | None = None) -> None: ... def remove(self) -> None: ... - def query_property(self, query_cls: Incomplete | None = ...): ... + def query_property(self, query_cls: Incomplete | None = None): ... # dynamically proxied from class Session bind: Any identity_map: Any @@ -38,68 +38,68 @@ class scoped_session(ScopedSessionMixin): def object_session(cls, instance): ... def __contains__(self, instance): ... def __iter__(self): ... - def add(self, instance, _warn: bool = ...) -> None: ... + def add(self, instance, _warn: bool = True) -> None: ... def add_all(self, instances) -> None: ... - def begin(self, subtransactions: bool = ..., nested: bool = ..., _subtrans: bool = ...): ... + def begin(self, subtransactions: bool = False, nested: bool = False, _subtrans: bool = False): ... def begin_nested(self): ... def close(self) -> None: ... def commit(self) -> None: ... def connection( self, - bind_arguments: Incomplete | None = ..., - close_with_result: bool = ..., - execution_options: Incomplete | None = ..., + bind_arguments: Incomplete | None = None, + close_with_result: bool = False, + execution_options: Incomplete | None = None, **kw, ): ... def delete(self, instance) -> None: ... def execute( self, statement, - params: Incomplete | None = ..., + params: Incomplete | None = None, execution_options=..., - bind_arguments: Incomplete | None = ..., - _parent_execute_state: Incomplete | None = ..., - _add_event: Incomplete | None = ..., + bind_arguments: Incomplete | None = None, + _parent_execute_state: Incomplete | None = None, + _add_event: Incomplete | None = None, **kw, ): ... - def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = None) -> None: ... def expire_all(self) -> None: ... def expunge(self, instance) -> None: ... def expunge_all(self) -> None: ... - def flush(self, objects: Incomplete | None = ...) -> None: ... + def flush(self, objects: Incomplete | None = None) -> None: ... def get( self, entity, ident, - options: Incomplete | None = ..., - populate_existing: bool = ..., - with_for_update: Incomplete | None = ..., - identity_token: Incomplete | None = ..., - execution_options: Incomplete | None = ..., + options: Incomplete | None = None, + populate_existing: bool = False, + with_for_update: Incomplete | None = None, + identity_token: Incomplete | None = None, + execution_options: Incomplete | None = None, ): ... def get_bind( self, - mapper: Incomplete | None = ..., - clause: Incomplete | None = ..., - bind: Incomplete | None = ..., - _sa_skip_events: Incomplete | None = ..., - _sa_skip_for_implicit_returning: bool = ..., + mapper: Incomplete | None = None, + clause: Incomplete | None = None, + bind: Incomplete | None = None, + _sa_skip_events: Incomplete | None = None, + _sa_skip_for_implicit_returning: bool = False, ): ... - def is_modified(self, instance, include_collections: bool = ...): ... + def is_modified(self, instance, include_collections: bool = True): ... def bulk_save_objects( - self, objects, return_defaults: bool = ..., update_changed_only: bool = ..., preserve_order: bool = ... + self, objects, return_defaults: bool = False, update_changed_only: bool = True, preserve_order: bool = True ): ... - def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = ..., render_nulls: bool = ...) -> None: ... + def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = False, render_nulls: bool = False) -> None: ... def bulk_update_mappings(self, mapper, mappings) -> None: ... - def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... + def merge(self, instance, load: bool = True, options: Incomplete | None = None): ... def query(self, *entities, **kwargs): ... - def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...) -> None: ... + def refresh(self, instance, attribute_names: Incomplete | None = None, with_for_update: Incomplete | None = None) -> None: ... def rollback(self) -> None: ... def scalar( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... def scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... ScopedSession = scoped_session diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi index 9f60a2669e58..91ef8ebe299d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi @@ -34,10 +34,10 @@ class ORMExecuteState(MemoizedSlots): ) -> None: ... def invoke_statement( self, - statement: Incomplete | None = ..., - params: Incomplete | None = ..., - execution_options: Incomplete | None = ..., - bind_arguments: Incomplete | None = ..., + statement: Incomplete | None = None, + params: Incomplete | None = None, + execution_options: Incomplete | None = None, + bind_arguments: Incomplete | None = None, ): ... @property def bind_mapper(self): ... @@ -72,16 +72,16 @@ class ORMExecuteState(MemoizedSlots): class SessionTransaction(TransactionalContext): session: Any nested: Any - def __init__(self, session, parent: Incomplete | None = ..., nested: bool = ..., autobegin: bool = ...) -> None: ... + def __init__(self, session, parent: Incomplete | None = None, nested: bool = False, autobegin: bool = False) -> None: ... @property def parent(self): ... @property def is_active(self): ... - def connection(self, bindkey, execution_options: Incomplete | None = ..., **kwargs): ... + def connection(self, bindkey, execution_options: Incomplete | None = None, **kwargs): ... def prepare(self) -> None: ... - def commit(self, _to_root: bool = ...): ... - def rollback(self, _capture_exception: bool = ..., _to_root: bool = ...): ... - def close(self, invalidate: bool = ...) -> None: ... + def commit(self, _to_root: bool = False): ... + def rollback(self, _capture_exception: bool = False, _to_root: bool = False): ... + def close(self, invalidate: bool = False) -> None: ... class Session(_SessionClassMethods): identity_map: Any @@ -95,16 +95,16 @@ class Session(_SessionClassMethods): twophase: Any def __init__( self, - bind: Incomplete | None = ..., - autoflush: bool = ..., - future: bool = ..., - expire_on_commit: bool = ..., - autocommit: bool = ..., - twophase: bool = ..., - binds: Incomplete | None = ..., - enable_baked_queries: bool = ..., - info: Incomplete | None = ..., - query_cls: Incomplete | None = ..., + bind: Incomplete | None = None, + autoflush: bool = True, + future: bool = False, + expire_on_commit: bool = True, + autocommit: bool = False, + twophase: bool = False, + binds: Incomplete | None = None, + enable_baked_queries: bool = True, + info: Incomplete | None = None, + query_cls: Incomplete | None = None, ) -> None: ... connection_callable: Any def __enter__(self) -> Self: ... @@ -119,7 +119,7 @@ class Session(_SessionClassMethods): def get_nested_transaction(self): ... @memoized_property def info(self): ... - def begin(self, subtransactions: bool = ..., nested: bool = ..., _subtrans: bool = ...): ... + def begin(self, subtransactions: bool = False, nested: bool = False, _subtrans: bool = False): ... def begin_nested(self): ... def rollback(self) -> None: ... def commit(self) -> None: ... @@ -127,26 +127,26 @@ class Session(_SessionClassMethods): # TODO: bind_arguments could use a TypedDict def connection( self, - bind_arguments: Mapping[str, Any] | None = ..., - close_with_result: bool = ..., - execution_options: Mapping[str, Any] | None = ..., + bind_arguments: Mapping[str, Any] | None = None, + close_with_result: bool = False, + execution_options: Mapping[str, Any] | None = None, **kw: Any, ) -> Connection: ... def execute( self, statement, - params: Incomplete | None = ..., + params: Incomplete | None = None, execution_options=..., - bind_arguments: Incomplete | None = ..., - _parent_execute_state: Incomplete | None = ..., - _add_event: Incomplete | None = ..., + bind_arguments: Incomplete | None = None, + _parent_execute_state: Incomplete | None = None, + _add_event: Incomplete | None = None, **kw, ) -> Result: ... def scalar( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... def scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... def close(self) -> None: ... def invalidate(self) -> None: ... @@ -155,11 +155,11 @@ class Session(_SessionClassMethods): def bind_table(self, table, bind) -> None: ... def get_bind( self, - mapper: Incomplete | None = ..., - clause: Incomplete | None = ..., - bind: Incomplete | None = ..., - _sa_skip_events: Incomplete | None = ..., - _sa_skip_for_implicit_returning: bool = ..., + mapper: Incomplete | None = None, + clause: Incomplete | None = None, + bind: Incomplete | None = None, + _sa_skip_events: Incomplete | None = None, + _sa_skip_for_implicit_returning: bool = False, ): ... @overload def query(self, entities: Table, **kwargs: Any) -> Query[Any]: ... @@ -171,34 +171,34 @@ class Session(_SessionClassMethods): def query(self, *entities: type[_T], **kwargs: Any) -> Query[_T]: ... @property def no_autoflush(self) -> None: ... - def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...) -> None: ... + def refresh(self, instance, attribute_names: Incomplete | None = None, with_for_update: Incomplete | None = None) -> None: ... def expire_all(self) -> None: ... - def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = None) -> None: ... def expunge(self, instance) -> None: ... - def add(self, instance, _warn: bool = ...) -> None: ... + def add(self, instance, _warn: bool = True) -> None: ... def add_all(self, instances) -> None: ... def delete(self, instance) -> None: ... def get( self, entity, ident, - options: Incomplete | None = ..., - populate_existing: bool = ..., - with_for_update: Incomplete | None = ..., - identity_token: Incomplete | None = ..., - execution_options: Incomplete | None = ..., + options: Incomplete | None = None, + populate_existing: bool = False, + with_for_update: Incomplete | None = None, + identity_token: Incomplete | None = None, + execution_options: Incomplete | None = None, ): ... - def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... + def merge(self, instance, load: bool = True, options: Incomplete | None = None): ... def enable_relationship_loading(self, obj) -> None: ... def __contains__(self, instance): ... def __iter__(self): ... - def flush(self, objects: Incomplete | None = ...) -> None: ... + def flush(self, objects: Incomplete | None = None) -> None: ... def bulk_save_objects( - self, objects, return_defaults: bool = ..., update_changed_only: bool = ..., preserve_order: bool = ... + self, objects, return_defaults: bool = False, update_changed_only: bool = True, preserve_order: bool = True ): ... - def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = ..., render_nulls: bool = ...) -> None: ... + def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = False, render_nulls: bool = False) -> None: ... def bulk_update_mappings(self, mapper, mappings) -> None: ... - def is_modified(self, instance, include_collections: bool = ...): ... + def is_modified(self, instance, include_collections: bool = True): ... @property def is_active(self): ... @property @@ -213,12 +213,12 @@ class sessionmaker(_SessionClassMethods): class_: Any def __init__( self, - bind: Incomplete | None = ..., + bind: Incomplete | None = None, class_=..., - autoflush: bool = ..., - autocommit: bool = ..., - expire_on_commit: bool = ..., - info: Incomplete | None = ..., + autoflush: bool = True, + autocommit: bool = False, + expire_on_commit: bool = True, + info: Incomplete | None = None, **kw, ) -> None: ... def begin(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi index f4b9508149f5..7ca4a1c2dcf4 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi @@ -8,7 +8,7 @@ class UninstrumentedColumnLoader(LoaderStrategy): columns: Any def __init__(self, parent, strategy_key) -> None: ... def setup_query( - self, compile_state, query_entity, path, loadopt, adapter, column_collection: Incomplete | None = ..., **kwargs + self, compile_state, query_entity, path, loadopt, adapter, column_collection: Incomplete | None = None, **kwargs ) -> None: ... def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... @@ -17,7 +17,7 @@ class ColumnLoader(LoaderStrategy): columns: Any is_composite: Any def __init__(self, parent, strategy_key) -> None: ... - def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, check_for_adapt: bool = ..., **kwargs) -> None: ... # type: ignore[override] + def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, check_for_adapt: bool = False, **kwargs) -> None: ... # type: ignore[override] is_class_level: bool def init_class_attribute(self, mapper) -> None: ... def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... @@ -39,12 +39,12 @@ class DeferredColumnLoader(LoaderStrategy): def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... is_class_level: bool def init_class_attribute(self, mapper) -> None: ... - def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, only_load_props: Incomplete | None = ..., **kw) -> None: ... # type: ignore[override] + def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, only_load_props: Incomplete | None = None, **kw) -> None: ... # type: ignore[override] class LoadDeferredColumns: key: Any raiseload: Any - def __init__(self, key, raiseload: bool = ...) -> None: ... + def __init__(self, key, raiseload: bool = False) -> None: ... def __call__(self, state, passive=...): ... class AbstractRelationshipLoader(LoaderStrategy): @@ -116,9 +116,9 @@ class JoinedLoader(AbstractRelationshipLoader): path, loadopt, adapter, - column_collection: Incomplete | None = ..., - parentmapper: Incomplete | None = ..., - chained_from_outerjoin: bool = ..., + column_collection: Incomplete | None = None, + parentmapper: Incomplete | None = None, + chained_from_outerjoin: bool = False, **kwargs, ) -> None: ... def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index cf9761cfb3ee..48321a09b0be 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -20,22 +20,22 @@ class Load(Generative, LoaderOption): def process_compile_state_replaced_entities(self, compile_state, mapper_entities) -> None: ... def process_compile_state(self, compile_state) -> None: ... def options(self, *opts) -> Self: ... - def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = ...) -> Self: ... - def set_column_strategy(self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> Self: ... + def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = True) -> Self: ... + def set_column_strategy(self, attrs, strategy, opts: Incomplete | None = None, opts_only: bool = False) -> Self: ... def set_generic_strategy(self, attrs, strategy) -> Self: ... def set_class_strategy(self, strategy, opts) -> Self: ... # Added dynamically at runtime - def contains_eager(loadopt, attr, alias: Incomplete | None = ...) -> Self: ... + def contains_eager(loadopt, attr, alias: Incomplete | None = None) -> Self: ... def load_only(loadopt, *attrs) -> Self: ... - def joinedload(loadopt, attr, innerjoin: Incomplete | None = ...) -> Self: ... + def joinedload(loadopt, attr, innerjoin: Incomplete | None = None) -> Self: ... def subqueryload(loadopt, attr) -> Self: ... def selectinload(loadopt, attr) -> Self: ... def lazyload(loadopt, attr) -> Self: ... def immediateload(loadopt, attr) -> Self: ... def noload(loadopt, attr) -> Self: ... - def raiseload(loadopt, attr, sql_only: bool = ...) -> Self: ... + def raiseload(loadopt, attr, sql_only: bool = False) -> Self: ... def defaultload(loadopt, attr) -> Self: ... - def defer(loadopt, key, raiseload: bool = ...) -> Self: ... + def defer(loadopt, key, raiseload: bool = False) -> Self: ... def undefer(loadopt, key) -> Self: ... def undefer_group(loadopt, name) -> Self: ... def with_expression(loadopt, key, expression) -> Self: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi index 20de2df97427..26b13e383029 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi @@ -26,11 +26,11 @@ class UOWTransaction: def register_object( self, state, - isdelete: bool = ..., - listonly: bool = ..., - cancel_delete: bool = ..., - operation: Incomplete | None = ..., - prop: Incomplete | None = ..., + isdelete: bool = False, + listonly: bool = False, + cancel_delete: bool = False, + operation: Incomplete | None = None, + prop: Incomplete | None = None, ): ... def register_post_update(self, state, post_update_cols) -> None: ... def filter_states_for_dep(self, dep, states): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi index b7c6fd4f7d78..cb7e9f809ea9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi @@ -32,7 +32,7 @@ class CascadeOptions(frozenset[Any]): @classmethod def from_string(cls, arg): ... -def polymorphic_union(table_map, typecolname, aliasname: str = ..., cast_nulls: bool = ...): ... +def polymorphic_union(table_map, typecolname, aliasname: str = "p_union", cast_nulls: bool = True): ... def identity_key(*args, **kwargs): ... class ORMAdapter(sql_util.ColumnAdapter): @@ -41,10 +41,10 @@ class ORMAdapter(sql_util.ColumnAdapter): def __init__( self, entity, - equivalents: Incomplete | None = ..., - adapt_required: bool = ..., - allow_label_resolve: bool = ..., - anonymize_labels: bool = ..., + equivalents: Incomplete | None = None, + adapt_required: bool = False, + allow_label_resolve: bool = True, + anonymize_labels: bool = False, ) -> None: ... class AliasedClass: @@ -52,15 +52,15 @@ class AliasedClass: def __init__( self, mapped_class_or_ac, - alias: Incomplete | None = ..., - name: Incomplete | None = ..., - flat: bool = ..., - adapt_on_names: bool = ..., - with_polymorphic_mappers=..., - with_polymorphic_discriminator: Incomplete | None = ..., - base_alias: Incomplete | None = ..., - use_mapper_path: bool = ..., - represents_outer_join: bool = ..., + alias: Incomplete | None = None, + name: Incomplete | None = None, + flat: bool = False, + adapt_on_names: bool = False, + with_polymorphic_mappers=(), + with_polymorphic_discriminator: Incomplete | None = None, + base_alias: Incomplete | None = None, + use_mapper_path: bool = False, + represents_outer_join: bool = False, ) -> None: ... def __getattr__(self, key: str): ... @@ -110,29 +110,29 @@ class LoaderCriteriaOption(CriteriaOption): self, entity_or_base, where_criteria, - loader_only: bool = ..., - include_aliases: bool = ..., - propagate_to_loaders: bool = ..., - track_closure_variables: bool = ..., + loader_only: bool = False, + include_aliases: bool = False, + propagate_to_loaders: bool = True, + track_closure_variables: bool = True, ) -> None: ... def process_compile_state_replaced_entities(self, compile_state, mapper_entities): ... def process_compile_state(self, compile_state) -> None: ... def get_global_criteria(self, attributes) -> None: ... def aliased( - element, alias: Incomplete | None = ..., name: Incomplete | None = ..., flat: bool = ..., adapt_on_names: bool = ... + element, alias: Incomplete | None = None, name: Incomplete | None = None, flat: bool = False, adapt_on_names: bool = False ): ... def with_polymorphic( base, classes, - selectable: bool = ..., - flat: bool = ..., - polymorphic_on: Incomplete | None = ..., - aliased: bool = ..., - adapt_on_names: bool = ..., - innerjoin: bool = ..., - _use_mapper_path: bool = ..., - _existing_alias: Incomplete | None = ..., + selectable: bool = False, + flat: bool = False, + polymorphic_on: Incomplete | None = None, + aliased: bool = False, + adapt_on_names: bool = False, + innerjoin: bool = False, + _use_mapper_path: bool = False, + _existing_alias: Incomplete | None = None, ) -> AliasedClass: ... class Bundle(ORMColumnsClauseRole, SupportsCloneAnnotations, sql_base.MemoizedHasCacheKey, InspectionAttr): @@ -166,28 +166,35 @@ class _ORMJoin(expression.Join): self, left, right, - onclause: Incomplete | None = ..., - isouter: bool = ..., - full: bool = ..., - _left_memo: Incomplete | None = ..., - _right_memo: Incomplete | None = ..., - _extra_criteria=..., + onclause: Incomplete | None = None, + isouter: bool = False, + full: bool = False, + _left_memo: Incomplete | None = None, + _right_memo: Incomplete | None = None, + _extra_criteria=(), ) -> None: ... def join( self, right, - onclause: Incomplete | None = ..., - isouter: bool = ..., - full: bool = ..., - join_to_left: Incomplete | None = ..., + onclause: Incomplete | None = None, + isouter: bool = False, + full: bool = False, + join_to_left: Incomplete | None = None, + ): ... + def outerjoin( + self, right, onclause: Incomplete | None = None, full: bool = False, join_to_left: Incomplete | None = None ): ... - def outerjoin(self, right, onclause: Incomplete | None = ..., full: bool = ..., join_to_left: Incomplete | None = ...): ... def join( - left, right, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ..., join_to_left: Incomplete | None = ... + left, + right, + onclause: Incomplete | None = None, + isouter: bool = False, + full: bool = False, + join_to_left: Incomplete | None = None, ): ... -def outerjoin(left, right, onclause: Incomplete | None = ..., full: bool = ..., join_to_left: Incomplete | None = ...): ... -def with_parent(instance, prop, from_entity: Incomplete | None = ...): ... +def outerjoin(left, right, onclause: Incomplete | None = None, full: bool = False, join_to_left: Incomplete | None = None): ... +def with_parent(instance, prop, from_entity: Incomplete | None = None): ... def has_identity(object_): ... def was_deleted(object_): ... def randomize_unitofwork() -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi index 14e6e99b8afc..0a22c6e1741a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi @@ -27,14 +27,14 @@ class Pool(log.Identified): def __init__( self, creator: Callable[[], DBAPIConnection], - recycle: int = ..., - echo: Incomplete | None = ..., - logging_name: Incomplete | None = ..., - reset_on_return: bool = ..., - events: Incomplete | None = ..., - dialect: Incomplete | None = ..., - pre_ping: bool = ..., - _dispatch: Incomplete | None = ..., + recycle: int = -1, + echo: Incomplete | None = None, + logging_name: Incomplete | None = None, + reset_on_return: bool = True, + events: Incomplete | None = None, + dialect: Incomplete | None = None, + pre_ping: bool = False, + _dispatch: Incomplete | None = None, ) -> None: ... def recreate(self) -> None: ... def dispose(self) -> None: ... @@ -43,7 +43,7 @@ class Pool(log.Identified): class _ConnectionRecord: finalize_callback: Any - def __init__(self, pool, connect: bool = ...) -> None: ... + def __init__(self, pool, connect: bool = True) -> None: ... fresh: bool fairy_ref: Any starttime: Any @@ -60,13 +60,13 @@ class _ConnectionRecord: def record_info(self): ... @classmethod def checkout(cls, pool): ... - def checkin(self, _fairy_was_created: bool = ...) -> None: ... + def checkin(self, _fairy_was_created: bool = True) -> None: ... @property def in_use(self): ... @property def last_connect_time(self): ... def close(self) -> None: ... - def invalidate(self, e: Incomplete | None = ..., soft: bool = ...) -> None: ... + def invalidate(self, e: Incomplete | None = None, soft: bool = False) -> None: ... def get_connection(self): ... class _ConnectionFairy: @@ -84,7 +84,7 @@ class _ConnectionFairy: def info(self): ... @property def record_info(self): ... - def invalidate(self, e: Incomplete | None = ..., soft: bool = ...) -> None: ... + def invalidate(self, e: Incomplete | None = None, soft: bool = False) -> None: ... def cursor(self, *args, **kwargs): ... def __getattr__(self, key: str): ... def detach(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi b/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi index 2646cafd536d..88eb1fb2ea60 100644 --- a/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi @@ -5,7 +5,7 @@ from .base import Pool class QueuePool(Pool): def __init__( - self, creator, pool_size: int = ..., max_overflow: int = ..., timeout: float = ..., use_lifo: bool = ..., **kw + self, creator, pool_size: int = 5, max_overflow: int = 10, timeout: float = 30.0, use_lifo: bool = False, **kw ) -> None: ... def recreate(self): ... def dispose(self) -> None: ... @@ -26,7 +26,7 @@ class NullPool(Pool): class SingletonThreadPool(Pool): size: Any - def __init__(self, creator, pool_size: int = ..., **kw) -> None: ... + def __init__(self, creator, pool_size: int = 5, **kw) -> None: ... def recreate(self): ... def dispose(self) -> None: ... def status(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/processors.pyi b/stubs/SQLAlchemy/sqlalchemy/processors.pyi index 2c74bf49992d..26ee40a7c386 100644 --- a/stubs/SQLAlchemy/sqlalchemy/processors.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/processors.pyi @@ -2,6 +2,6 @@ from _typeshed import Incomplete def str_to_datetime_processor_factory(regexp, type_): ... def py_fallback(): ... -def to_unicode_processor_factory(encoding, errors: Incomplete | None = ...): ... -def to_conditional_unicode_processor_factory(encoding, errors: Incomplete | None = ...): ... +def to_unicode_processor_factory(encoding, errors: Incomplete | None = None): ... +def to_conditional_unicode_processor_factory(encoding, errors: Incomplete | None = None): ... def to_decimal_processor_factory(target_class, scale): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi index 2218cb44fb9e..bf12c6fd34cb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi @@ -116,7 +116,7 @@ class SchemaVisitor(ClauseVisitor): __traverse_options__: Any class ColumnCollection: - def __init__(self, columns: Incomplete | None = ...) -> None: ... + def __init__(self, columns: Incomplete | None = None) -> None: ... def keys(self): ... def values(self): ... def items(self): ... @@ -128,7 +128,7 @@ class ColumnCollection: def __contains__(self, key): ... def compare(self, other): ... def __eq__(self, other): ... - def get(self, key, default: Incomplete | None = ...): ... + def get(self, key, default: Incomplete | None = None): ... def __setitem__(self, key, value) -> None: ... def __delitem__(self, key) -> None: ... def __setattr__(self, key: str, obj) -> None: ... @@ -136,13 +136,13 @@ class ColumnCollection: def remove(self, column) -> None: ... def update(self, iter_) -> None: ... __hash__: ClassVar[None] # type: ignore[assignment] - def add(self, column, key: Incomplete | None = ...) -> None: ... + def add(self, column, key: Incomplete | None = None) -> None: ... def contains_column(self, col): ... def as_immutable(self): ... - def corresponding_column(self, column, require_embedded: bool = ...): ... + def corresponding_column(self, column, require_embedded: bool = False): ... class DedupeColumnCollection(ColumnCollection): - def add(self, column, key: Incomplete | None = ...) -> None: ... + def add(self, column, key: Incomplete | None = None) -> None: ... def extend(self, iter_) -> None: ... def remove(self, column) -> None: ... def replace(self, column) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi index 034252252300..605ed309ac66 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi @@ -13,9 +13,9 @@ traversals: Any def expect( role, element, - apply_propagate_attrs: Incomplete | None = ..., - argname: Incomplete | None = ..., - post_inspect: bool = ..., + apply_propagate_attrs: Incomplete | None = None, + argname: Incomplete | None = None, + post_inspect: bool = False, **kw, ): ... def expect_as_key(role, element, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi index bd521727bdfa..c10001f35fab 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi @@ -38,7 +38,7 @@ WARN_LINTING: Incomplete FROM_LINTING: Incomplete class FromLinter: - def lint(self, start: Incomplete | None = ...): ... + def lint(self, start: Incomplete | None = None): ... def warn(self) -> None: ... class Compiled: @@ -55,8 +55,8 @@ class Compiled: self, dialect, statement, - schema_translate_map: Incomplete | None = ..., - render_schema_translate: bool = ..., + schema_translate_map: Incomplete | None = None, + render_schema_translate: bool = False, compile_kwargs=..., ) -> None: ... def visit_unsupported_compilation(self, element, err) -> None: ... @@ -64,7 +64,7 @@ class Compiled: def sql_compiler(self) -> None: ... def process(self, obj, **kwargs): ... def construct_params( - self, params: Incomplete | None = ..., extracted_parameters: Incomplete | None = ..., escape_names: bool = ... + self, params: Incomplete | None = None, extracted_parameters: Incomplete | None = None, escape_names: bool = True ) -> None: ... @property def params(self): ... @@ -80,7 +80,7 @@ class _CompileLabel(elements.ColumnElement[Incomplete]): __visit_name__: str element: Incomplete name: Incomplete - def __init__(self, col, name, alt_names=...) -> None: ... + def __init__(self, col, name, alt_names=()) -> None: ... @property def proxy_set(self): ... @property @@ -125,9 +125,9 @@ class SQLCompiler(Compiled): self, dialect, statement, - cache_key: Incomplete | None = ..., - column_keys: Incomplete | None = ..., - for_executemany: bool = ..., + cache_key: Incomplete | None = None, + column_keys: Incomplete | None = None, + for_executemany: bool = False, linting=..., **kwargs, ) -> None: ... @@ -138,27 +138,27 @@ class SQLCompiler(Compiled): def is_subquery(self): ... @property def sql_compiler(self): ... - def construct_params(self, params: Incomplete | None = ..., _group_number: Incomplete | None = ..., _check: bool = ..., extracted_parameters: Incomplete | None = ..., escape_names: bool = ...): ... # type: ignore[override] + def construct_params(self, params: Incomplete | None = None, _group_number: Incomplete | None = None, _check: bool = True, extracted_parameters: Incomplete | None = None, escape_names: bool = True): ... # type: ignore[override] @property def params(self): ... def default_from(self): ... - def visit_grouping(self, grouping, asfrom: bool = ..., **kwargs): ... + def visit_grouping(self, grouping, asfrom: bool = False, **kwargs): ... def visit_select_statement_grouping(self, grouping, **kwargs): ... - def visit_label_reference(self, element, within_columns_clause: bool = ..., **kwargs): ... - def visit_textual_label_reference(self, element, within_columns_clause: bool = ..., **kwargs): ... + def visit_label_reference(self, element, within_columns_clause: bool = False, **kwargs): ... + def visit_textual_label_reference(self, element, within_columns_clause: bool = False, **kwargs): ... def visit_label( self, label, - add_to_result_map: Incomplete | None = ..., - within_label_clause: bool = ..., - within_columns_clause: bool = ..., - render_label_as_label: Incomplete | None = ..., - result_map_targets=..., + add_to_result_map: Incomplete | None = None, + within_label_clause: bool = False, + within_columns_clause: bool = False, + render_label_as_label: Incomplete | None = None, + result_map_targets=(), **kw, ): ... def visit_lambda_element(self, element, **kw): ... def visit_column( - self, column, add_to_result_map: Incomplete | None = ..., include_table: bool = ..., result_map_targets=..., **kwargs + self, column, add_to_result_map: Incomplete | None = None, include_table: bool = True, result_map_targets=(), **kwargs ): ... def visit_collation(self, element, **kw): ... def visit_fromclause(self, fromclause, **kwargs): ... @@ -166,8 +166,8 @@ class SQLCompiler(Compiled): def visit_typeclause(self, typeclause, **kw): ... def post_process_text(self, text): ... def escape_literal_column(self, text): ... - def visit_textclause(self, textclause, add_to_result_map: Incomplete | None = ..., **kw): ... - def visit_textual_select(self, taf, compound_index: Incomplete | None = ..., asfrom: bool = ..., **kw): ... + def visit_textclause(self, textclause, add_to_result_map: Incomplete | None = None, **kw): ... + def visit_textual_select(self, taf, compound_index: Incomplete | None = None, asfrom: bool = False, **kw): ... def visit_null(self, expr, **kw): ... def visit_true(self, expr, **kw): ... def visit_false(self, expr, **kw): ... @@ -181,13 +181,13 @@ class SQLCompiler(Compiled): def visit_funcfilter(self, funcfilter, **kwargs): ... def visit_extract(self, extract, **kwargs): ... def visit_scalar_function_column(self, element, **kw): ... - def visit_function(self, func, add_to_result_map: Incomplete | None = ..., **kwargs): ... + def visit_function(self, func, add_to_result_map: Incomplete | None = None, **kwargs): ... def visit_next_value_func(self, next_value, **kw): ... def visit_sequence(self, sequence, **kw) -> None: ... def function_argspec(self, func, **kwargs): ... compile_state: Incomplete - def visit_compound_select(self, cs, asfrom: bool = ..., compound_index: Incomplete | None = ..., **kwargs): ... - def visit_unary(self, unary, add_to_result_map: Incomplete | None = ..., result_map_targets=..., **kw): ... + def visit_compound_select(self, cs, asfrom: bool = False, compound_index: Incomplete | None = None, **kwargs): ... + def visit_unary(self, unary, add_to_result_map: Incomplete | None = None, result_map_targets=(), **kw): ... def visit_is_true_unary_operator(self, element, operator, **kw): ... def visit_is_false_unary_operator(self, element, operator, **kw): ... def visit_not_match_op_binary(self, binary, operator, **kw): ... @@ -197,10 +197,10 @@ class SQLCompiler(Compiled): def visit_binary( self, binary, - override_operator: Incomplete | None = ..., - eager_grouping: bool = ..., - from_linter: Incomplete | None = ..., - lateral_from_linter: Incomplete | None = ..., + override_operator: Incomplete | None = None, + eager_grouping: bool = False, + from_linter: Incomplete | None = None, + lateral_from_linter: Incomplete | None = None, **kw, ): ... def visit_function_as_comparison_op_binary(self, element, operator, **kw): ... @@ -226,24 +226,24 @@ class SQLCompiler(Compiled): def visit_bindparam( self, bindparam, - within_columns_clause: bool = ..., - literal_binds: bool = ..., - skip_bind_expression: bool = ..., - literal_execute: bool = ..., - render_postcompile: bool = ..., + within_columns_clause: bool = False, + literal_binds: bool = False, + skip_bind_expression: bool = False, + literal_execute: bool = False, + render_postcompile: bool = False, **kwargs, ): ... def render_literal_bindparam( - self, bindparam, render_literal_value=..., bind_expression_template: Incomplete | None = ..., **kw + self, bindparam, render_literal_value=..., bind_expression_template: Incomplete | None = None, **kw ): ... def render_literal_value(self, value, type_): ... def bindparam_string( self, name, - positional_names: Incomplete | None = ..., - post_compile: bool = ..., - expanding: bool = ..., - escaped_from: Incomplete | None = ..., + positional_names: Incomplete | None = None, + post_compile: bool = False, + expanding: bool = False, + escaped_from: Incomplete | None = None, **kw, ): ... execution_options: Incomplete @@ -251,11 +251,11 @@ class SQLCompiler(Compiled): def visit_cte( self, cte, - asfrom: bool = ..., - ashint: bool = ..., - fromhints: Incomplete | None = ..., - visiting_cte: Incomplete | None = ..., - from_linter: Incomplete | None = ..., + asfrom: bool = False, + ashint: bool = False, + fromhints: Incomplete | None = None, + visiting_cte: Incomplete | None = None, + from_linter: Incomplete | None = None, **kwargs, ): ... def visit_table_valued_alias(self, element, **kw): ... @@ -263,20 +263,20 @@ class SQLCompiler(Compiled): def visit_alias( self, alias, - asfrom: bool = ..., - ashint: bool = ..., - iscrud: bool = ..., - fromhints: Incomplete | None = ..., - subquery: bool = ..., - lateral: bool = ..., - enclosing_alias: Incomplete | None = ..., - from_linter: Incomplete | None = ..., + asfrom: bool = False, + ashint: bool = False, + iscrud: bool = False, + fromhints: Incomplete | None = None, + subquery: bool = False, + lateral: bool = False, + enclosing_alias: Incomplete | None = None, + from_linter: Incomplete | None = None, **kwargs, ): ... def visit_subquery(self, subquery, **kw): ... def visit_lateral(self, lateral_, **kw): ... - def visit_tablesample(self, tablesample, asfrom: bool = ..., **kw): ... - def visit_values(self, element, asfrom: bool = ..., from_linter: Incomplete | None = ..., **kw): ... + def visit_tablesample(self, tablesample, asfrom: bool = False, **kw): ... + def visit_values(self, element, asfrom: bool = False, from_linter: Incomplete | None = None, **kw): ... def get_render_as_alias_suffix(self, alias_name_text): ... def format_from_hint_text(self, sqltext, table, hint, iscrud): ... def get_select_hint_text(self, byfroms) -> None: ... @@ -287,13 +287,13 @@ class SQLCompiler(Compiled): def visit_select( self, select_stmt, - asfrom: bool = ..., - insert_into: bool = ..., - fromhints: Incomplete | None = ..., - compound_index: Incomplete | None = ..., - select_wraps_for: Incomplete | None = ..., - lateral: bool = ..., - from_linter: Incomplete | None = ..., + asfrom: bool = False, + insert_into: bool = False, + fromhints: Incomplete | None = None, + compound_index: Incomplete | None = None, + select_wraps_for: Incomplete | None = None, + lateral: bool = False, + from_linter: Incomplete | None = None, **kwargs, ): ... def get_cte_preamble(self, recursive): ... @@ -307,15 +307,15 @@ class SQLCompiler(Compiled): def visit_table( self, table, - asfrom: bool = ..., - iscrud: bool = ..., - ashint: bool = ..., - fromhints: Incomplete | None = ..., - use_schema: bool = ..., - from_linter: Incomplete | None = ..., + asfrom: bool = False, + iscrud: bool = False, + ashint: bool = False, + fromhints: Incomplete | None = None, + use_schema: bool = True, + from_linter: Incomplete | None = None, **kwargs, ): ... - 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 visit_insert(self, insert_stmt, **kw): ... def update_limit_clause(self, update_stmt) -> None: ... def update_tables_clause(self, update_stmt, from_table, extra_froms, **kw): ... @@ -349,17 +349,17 @@ class DDLCompiler(Compiled): @memoized_property def type_compiler(self): ... def construct_params( - self, params: Incomplete | None = ..., extracted_parameters: Incomplete | None = ..., escape_names: bool = ... + self, params: Incomplete | None = None, extracted_parameters: Incomplete | None = None, escape_names: bool = True ) -> None: ... def visit_ddl(self, ddl, **kwargs): ... def visit_create_schema(self, create, **kw): ... def visit_drop_schema(self, drop, **kw): ... def visit_create_table(self, create, **kw): ... - def visit_create_column(self, create, first_pk: bool = ..., **kw): ... - def create_table_constraints(self, table, _include_foreign_key_constraints: Incomplete | None = ..., **kw): ... + def visit_create_column(self, create, first_pk: bool = False, **kw): ... + def create_table_constraints(self, table, _include_foreign_key_constraints: Incomplete | None = None, **kw): ... def visit_drop_table(self, drop, **kw): ... def visit_drop_view(self, drop, **kw): ... - def visit_create_index(self, create, include_schema: bool = ..., include_table_schema: bool = ..., **kw): ... + def visit_create_index(self, create, include_schema: bool = False, include_table_schema: bool = True, **kw): ... def visit_drop_index(self, drop, **kw): ... def visit_add_constraint(self, create, **kw): ... def visit_set_table_comment(self, create, **kw): ... @@ -367,7 +367,7 @@ class DDLCompiler(Compiled): def visit_set_column_comment(self, create, **kw): ... def visit_drop_column_comment(self, drop, **kw): ... def get_identity_options(self, identity_options): ... - def visit_create_sequence(self, create, prefix: Incomplete | None = ..., **kw): ... + def visit_create_sequence(self, create, prefix: Incomplete | None = None, **kw): ... def visit_drop_sequence(self, drop, **kw): ... def visit_drop_constraint(self, drop, **kw): ... def get_column_specification(self, column, **kwargs): ... @@ -451,36 +451,36 @@ class IdentifierPreparer: def __init__( self, dialect, - initial_quote: str = ..., - final_quote: Incomplete | None = ..., - escape_quote: str = ..., - quote_case_sensitive_collations: bool = ..., - omit_schema: bool = ..., + initial_quote: str = '"', + final_quote: Incomplete | None = None, + escape_quote: str = '"', + quote_case_sensitive_collations: bool = True, + omit_schema: bool = False, ) -> None: ... def validate_sql_phrase(self, element, reg): ... def quote_identifier(self, value): ... - def quote_schema(self, schema, force: Incomplete | None = ...): ... - def quote(self, ident, force: Incomplete | None = ...): ... + def quote_schema(self, schema, force: Incomplete | None = None): ... + def quote(self, ident, force: Incomplete | None = None): ... def format_collation(self, collation_name): ... - def format_sequence(self, sequence, use_schema: bool = ...): ... - def format_label(self, label, name: Incomplete | None = ...): ... - def format_alias(self, alias, name: Incomplete | None = ...): ... - def format_savepoint(self, savepoint, name: Incomplete | None = ...): ... - def format_constraint(self, constraint, _alembic_quote: bool = ...): ... - def truncate_and_render_index_name(self, name, _alembic_quote: bool = ...): ... - def truncate_and_render_constraint_name(self, name, _alembic_quote: bool = ...): ... + def format_sequence(self, sequence, use_schema: bool = True): ... + def format_label(self, label, name: Incomplete | None = None): ... + def format_alias(self, alias, name: Incomplete | None = None): ... + def format_savepoint(self, savepoint, name: Incomplete | None = None): ... + def format_constraint(self, constraint, _alembic_quote: bool = True): ... + def truncate_and_render_index_name(self, name, _alembic_quote: bool = True): ... + def truncate_and_render_constraint_name(self, name, _alembic_quote: bool = True): ... def format_index(self, index): ... - def format_table(self, table, use_schema: bool = ..., name: Incomplete | None = ...): ... + def format_table(self, table, use_schema: bool = True, name: Incomplete | None = None): ... def format_schema(self, name): ... - def format_label_name(self, name, anon_map: Incomplete | None = ...): ... + def format_label_name(self, name, anon_map: Incomplete | None = None): ... def format_column( self, column, - use_table: bool = ..., - name: Incomplete | None = ..., - table_name: Incomplete | None = ..., - use_schema: bool = ..., - anon_map: Incomplete | None = ..., + use_table: bool = False, + name: Incomplete | None = None, + table_name: Incomplete | None = None, + use_schema: bool = False, + anon_map: Incomplete | None = None, ): ... - def format_table_seq(self, table, use_schema: bool = ...): ... + def format_table_seq(self, table, use_schema: bool = True): ... def unformat_identifiers(self, identifiers): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi index 5d34ce026300..4749fedd2bba 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi @@ -12,11 +12,11 @@ class DDLElement(roles.DDLRole, Executable, _DDLCompiles): on: Any dialect: Any callable_: Any - def execute(self, bind: Incomplete | None = ..., target: Incomplete | None = ...): ... # type: ignore[override] + def execute(self, bind: Incomplete | None = None, target: Incomplete | None = None): ... # type: ignore[override] def against(self, target) -> None: ... state: Any def execute_if( - self, dialect: Incomplete | None = ..., callable_: Incomplete | None = ..., state: Incomplete | None = ... + self, dialect: Incomplete | None = None, callable_: Incomplete | None = None, state: Incomplete | None = None ) -> None: ... def __call__(self, target, bind, **kw): ... bind: Any @@ -25,7 +25,7 @@ class DDL(DDLElement): __visit_name__: str statement: Any context: Any - def __init__(self, statement, context: Incomplete | None = ..., bind: Incomplete | None = ...) -> None: ... + def __init__(self, statement, context: Incomplete | None = None, bind: Incomplete | None = None) -> None: ... class _CreateDropBase(DDLElement): element: Any @@ -35,10 +35,10 @@ class _CreateDropBase(DDLElement): def __init__( self, element, - bind: Incomplete | None = ..., - if_exists: bool = ..., - if_not_exists: bool = ..., - _legacy_bind: Incomplete | None = ..., + bind: Incomplete | None = None, + if_exists: bool = False, + if_not_exists: bool = False, + _legacy_bind: Incomplete | None = None, ) -> None: ... @property def stringify_dialect(self): ... @@ -46,13 +46,13 @@ class _CreateDropBase(DDLElement): class CreateSchema(_CreateDropBase): __visit_name__: str quote: Any - def __init__(self, name, quote: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, name, quote: Incomplete | None = None, **kw) -> None: ... class DropSchema(_CreateDropBase): __visit_name__: str quote: Any cascade: Any - def __init__(self, name, quote: Incomplete | None = ..., cascade: bool = ..., **kw) -> None: ... + def __init__(self, name, quote: Incomplete | None = None, cascade: bool = False, **kw) -> None: ... class CreateTable(_CreateDropBase): __visit_name__: str @@ -61,9 +61,9 @@ class CreateTable(_CreateDropBase): def __init__( self, element, - bind: Incomplete | None = ..., - include_foreign_key_constraints: Incomplete | None = ..., - if_not_exists: bool = ..., + bind: Incomplete | None = None, + include_foreign_key_constraints: Incomplete | None = None, + if_not_exists: bool = False, ) -> None: ... class _DropView(_CreateDropBase): @@ -76,7 +76,7 @@ class CreateColumn(_DDLCompiles): class DropTable(_CreateDropBase): __visit_name__: str - def __init__(self, element, bind: Incomplete | None = ..., if_exists: bool = ...) -> None: ... + def __init__(self, element, bind: Incomplete | None = None, if_exists: bool = False) -> None: ... class CreateSequence(_CreateDropBase): __visit_name__: str @@ -86,11 +86,11 @@ class DropSequence(_CreateDropBase): class CreateIndex(_CreateDropBase): __visit_name__: str - def __init__(self, element, bind: Incomplete | None = ..., if_not_exists: bool = ...) -> None: ... + def __init__(self, element, bind: Incomplete | None = None, if_not_exists: bool = False) -> None: ... class DropIndex(_CreateDropBase): __visit_name__: str - def __init__(self, element, bind: Incomplete | None = ..., if_exists: bool = ...) -> None: ... + def __init__(self, element, bind: Incomplete | None = None, if_exists: bool = False) -> None: ... class AddConstraint(_CreateDropBase): __visit_name__: str @@ -99,7 +99,7 @@ class AddConstraint(_CreateDropBase): class DropConstraint(_CreateDropBase): __visit_name__: str cascade: Any - def __init__(self, element, cascade: bool = ..., **kw) -> None: ... + def __init__(self, element, cascade: bool = False, **kw) -> None: ... class SetTableComment(_CreateDropBase): __visit_name__: str @@ -123,18 +123,18 @@ class SchemaGenerator(DDLBase): preparer: Any dialect: Any memo: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., tables: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = False, tables: Incomplete | None = None, **kwargs) -> None: ... def visit_metadata(self, metadata) -> None: ... def visit_table( self, table, - create_ok: bool = ..., - include_foreign_key_constraints: Incomplete | None = ..., - _is_metadata_operation: bool = ..., + create_ok: bool = False, + include_foreign_key_constraints: Incomplete | None = None, + _is_metadata_operation: bool = False, ) -> None: ... def visit_foreign_key_constraint(self, constraint) -> None: ... - def visit_sequence(self, sequence, create_ok: bool = ...) -> None: ... - def visit_index(self, index, create_ok: bool = ...) -> None: ... + def visit_sequence(self, sequence, create_ok: bool = False) -> None: ... + def visit_index(self, index, create_ok: bool = False) -> None: ... class SchemaDropper(DDLBase): checkfirst: Any @@ -142,14 +142,14 @@ class SchemaDropper(DDLBase): preparer: Any dialect: Any memo: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., tables: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = False, tables: Incomplete | None = None, **kwargs) -> None: ... def visit_metadata(self, metadata): ... - def visit_index(self, index, drop_ok: bool = ...) -> None: ... - def visit_table(self, table, drop_ok: bool = ..., _is_metadata_operation: bool = ..., _ignore_sequences=...) -> None: ... + def visit_index(self, index, drop_ok: bool = False) -> None: ... + def visit_table(self, table, drop_ok: bool = False, _is_metadata_operation: bool = False, _ignore_sequences=()) -> None: ... def visit_foreign_key_constraint(self, constraint) -> None: ... - def visit_sequence(self, sequence, drop_ok: bool = ...) -> None: ... + def visit_sequence(self, sequence, drop_ok: bool = False) -> None: ... -def sort_tables(tables, skip_fn: Incomplete | None = ..., extra_dependencies: Incomplete | None = ...): ... +def sort_tables(tables, skip_fn: Incomplete | None = None, extra_dependencies: Incomplete | None = None): ... def sort_tables_and_constraints( - tables, filter_fn: Incomplete | None = ..., extra_dependencies: Incomplete | None = ..., _warn_for_cycles: bool = ... + tables, filter_fn: Incomplete | None = None, extra_dependencies: Incomplete | None = None, _warn_for_cycles: bool = False ): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi index 8dbc7c04b8b8..891beefdf4a4 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi @@ -42,7 +42,7 @@ class UpdateBase(roles.DMLRole, HasCTE, HasCompileState, DialectKWArgs, HasPrefi def returning(self, *cols) -> None: ... @property def exported_columns(self): ... - def with_hint(self, text, selectable: Incomplete | None = ..., dialect_name: str = ...) -> None: ... + def with_hint(self, text, selectable: Incomplete | None = None, dialect_name: str = "*") -> None: ... class ValuesBase(UpdateBase): __visit_name__: str @@ -60,16 +60,16 @@ class Insert(ValuesBase): def __init__( self, table, - values: Incomplete | None = ..., - inline: bool = ..., - bind: Incomplete | None = ..., - prefixes: Incomplete | None = ..., - returning: Incomplete | None = ..., - return_defaults: bool = ..., + values: Incomplete | None = None, + inline: bool = False, + bind: Incomplete | None = None, + prefixes: Incomplete | None = None, + returning: Incomplete | None = None, + return_defaults: bool = False, **dialect_kw, ) -> None: ... def inline(self) -> None: ... - def from_select(self, names, select, include_defaults: bool = ...) -> None: ... + def from_select(self, names, select, include_defaults: bool = True) -> None: ... class DMLWhereBase: def where(self, *whereclause) -> None: ... @@ -84,14 +84,14 @@ class Update(DMLWhereBase, ValuesBase): def __init__( self, table, - whereclause: Incomplete | None = ..., - values: Incomplete | None = ..., - inline: bool = ..., - bind: Incomplete | None = ..., - prefixes: Incomplete | None = ..., - returning: Incomplete | None = ..., - return_defaults: bool = ..., - preserve_parameter_order: bool = ..., + whereclause: Incomplete | None = None, + values: Incomplete | None = None, + inline: bool = False, + bind: Incomplete | None = None, + prefixes: Incomplete | None = None, + returning: Incomplete | None = None, + return_defaults: bool = False, + preserve_parameter_order: bool = False, **dialect_kw, ) -> None: ... def ordered_values(self, *args) -> None: ... @@ -104,9 +104,9 @@ class Delete(DMLWhereBase, UpdateBase): def __init__( self, table, - whereclause: Incomplete | None = ..., - bind: Incomplete | None = ..., - returning: Incomplete | None = ..., - prefixes: Incomplete | None = ..., + whereclause: Incomplete | None = None, + bind: Incomplete | None = None, + returning: Incomplete | None = None, + prefixes: Incomplete | None = None, **dialect_kw, ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi index 93c53c0c5c65..48be8c4669d7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi @@ -13,9 +13,9 @@ from .visitors import Traversible _T = TypeVar("_T") def collate(expression, collation): ... -def between(expr, lower_bound, upper_bound, symmetric: bool = ...): ... -def literal(value, type_: Incomplete | None = ...): ... -def outparam(key, type_: Incomplete | None = ...): ... +def between(expr, lower_bound, upper_bound, symmetric: bool = False): ... +def literal(value, type_: Incomplete | None = None): ... +def outparam(key, type_: Incomplete | None = None): ... def not_(clause): ... class ClauseElement(roles.SQLRole, SupportsWrappingAnnotations, MemoizedHasCacheKey, HasCopyInternals, Traversible): @@ -31,8 +31,8 @@ class ClauseElement(roles.SQLRole, SupportsWrappingAnnotations, MemoizedHasCache def unique_params(self, *optionaldict, **kwargs): ... def params(self, *optionaldict, **kwargs): ... def compare(self, other, **kw): ... - def self_group(self, against: Incomplete | None = ...): ... - def compile(self, bind: Incomplete | None = ..., dialect: Incomplete | None = ..., **kw): ... + def self_group(self, against: Incomplete | None = None): ... + def compile(self, bind: Incomplete | None = None, dialect: Incomplete | None = None, **kw): ... def __invert__(self): ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... @@ -56,7 +56,7 @@ class ColumnElement( primary_key: bool foreign_keys: Any key: Any - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @memoized_property def type(self): ... @HasMemoized.memoized_attribute @@ -99,17 +99,17 @@ class BindParameter(roles.InElementRole, ColumnElement[_T], Generic[_T]): self, key, value=..., - type_: Incomplete | None = ..., - unique: bool = ..., + type_: Incomplete | None = None, + unique: bool = False, required=..., - quote: Incomplete | None = ..., - callable_: Incomplete | None = ..., - expanding: bool = ..., - isoutparam: bool = ..., - literal_execute: bool = ..., - _compared_to_operator: Incomplete | None = ..., - _compared_to_type: Incomplete | None = ..., - _is_crud: bool = ..., + quote: Incomplete | None = None, + callable_: Incomplete | None = None, + expanding: bool = False, + isoutparam: bool = False, + literal_execute: bool = False, + _compared_to_operator: Incomplete | None = None, + _compared_to_type: Incomplete | None = None, + _is_crud: bool = False, ) -> None: ... @property def effective_value(self): ... @@ -144,7 +144,7 @@ class TextClause( def type(self): ... @property def comparator(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Null(SingletonConstant, roles.ConstExprRole, ColumnElement[None]): __visit_name__: str @@ -171,7 +171,7 @@ class ClauseList(roles.InElementRole, roles.OrderByRole, roles.ColumnsClauseRole def __iter__(self): ... def __len__(self) -> int: ... def append(self, clause) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class BooleanClauseList(ClauseList, ColumnElement[Any]): __visit_name__: str @@ -181,7 +181,7 @@ class BooleanClauseList(ClauseList, ColumnElement[Any]): def and_(cls, *clauses): ... @classmethod def or_(cls, *clauses): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... and_: Any or_: Any @@ -190,7 +190,7 @@ class Tuple(ClauseList, ColumnElement[Any]): __visit_name__: str type: Any def __init__(self, *clauses, **kw) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Case(ColumnElement[Any]): __visit_name__: str @@ -200,7 +200,7 @@ class Case(ColumnElement[Any]): else_: Any def __init__(self, *whens, **kw) -> None: ... -def literal_column(text, type_: Incomplete | None = ...): ... +def literal_column(text, type_: Incomplete | None = None): ... class Cast(WrapsColumnExpression, ColumnElement[Any]): __visit_name__: str @@ -220,7 +220,7 @@ class TypeCoerce(WrapsColumnExpression, ColumnElement[Any]): def typed_expression(self): ... @property def wrapped_column_expression(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Extract(ColumnElement[Any]): __visit_name__: str @@ -249,12 +249,12 @@ class UnaryExpression(ColumnElement[Any]): def __init__( self, element, - operator: Incomplete | None = ..., - modifier: Incomplete | None = ..., - type_: Incomplete | None = ..., - wraps_column_expression: bool = ..., + operator: Incomplete | None = None, + modifier: Incomplete | None = None, + type_: Incomplete | None = None, + wraps_column_expression: bool = False, ) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class CollectionAggregate(UnaryExpression): inherit_cache: bool @@ -272,7 +272,7 @@ class AsBoolean(WrapsColumnExpression, UnaryExpression): def __init__(self, element, operator, negate) -> None: ... @property def wrapped_column_expression(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class BinaryExpression(ColumnElement[Any]): __visit_name__: str @@ -287,15 +287,15 @@ class BinaryExpression(ColumnElement[Any]): left, right, operator, - type_: Incomplete | None = ..., - negate: Incomplete | None = ..., - modifiers: Incomplete | None = ..., + type_: Incomplete | None = None, + negate: Incomplete | None = None, + modifiers: Incomplete | None = None, ) -> None: ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... @property def is_comparison(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Slice(ColumnElement[Any]): __visit_name__: str @@ -303,15 +303,15 @@ class Slice(ColumnElement[Any]): stop: Any step: Any type: Any - def __init__(self, start, stop, step, _name: Incomplete | None = ...) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def __init__(self, start, stop, step, _name: Incomplete | None = None) -> None: ... + def self_group(self, against: Incomplete | None = None): ... class IndexExpression(BinaryExpression): inherit_cache: bool class GroupedElement(ClauseElement): __visit_name__: str - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Grouping(GroupedElement, ColumnElement[Any]): element: Any @@ -332,10 +332,10 @@ class Over(ColumnElement[Any]): def __init__( self, element, - partition_by: Incomplete | None = ..., - order_by: Incomplete | None = ..., - range_: Incomplete | None = ..., - rows: Incomplete | None = ..., + partition_by: Incomplete | None = None, + order_by: Incomplete | None = None, + range_: Incomplete | None = None, + rows: Incomplete | None = None, ) -> None: ... def __reduce__(self): ... @memoized_property @@ -349,10 +349,10 @@ class WithinGroup(ColumnElement[Any]): def __reduce__(self): ... def over( self, - partition_by: Incomplete | None = ..., - order_by: Incomplete | None = ..., - range_: Incomplete | None = ..., - rows: Incomplete | None = ..., + partition_by: Incomplete | None = None, + order_by: Incomplete | None = None, + range_: Incomplete | None = None, + rows: Incomplete | None = None, ): ... @memoized_property def type(self): ... @@ -365,12 +365,12 @@ class FunctionFilter(ColumnElement[Any]): def filter(self, *criterion): ... def over( self, - partition_by: Incomplete | None = ..., - order_by: Incomplete | None = ..., - range_: Incomplete | None = ..., - rows: Incomplete | None = ..., + partition_by: Incomplete | None = None, + order_by: Incomplete | None = None, + range_: Incomplete | None = None, + rows: Incomplete | None = None, ): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @memoized_property def type(self): ... @@ -378,13 +378,13 @@ class Label(roles.LabeledColumnExprRole, ColumnElement[Any]): __visit_name__: str name: Any key: Any - def __init__(self, name, element, type_: Incomplete | None = ...) -> None: ... + def __init__(self, name, element, type_: Incomplete | None = None) -> None: ... def __reduce__(self): ... @memoized_property def type(self): ... @HasMemoized.memoized_attribute def element(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @property def primary_key(self): ... @property @@ -407,9 +407,9 @@ class ColumnClause(roles.DDLReferredColumnRole, roles.LabeledColumnExprRole, rol key: Any type: Any def __init__( - self, text, type_: Incomplete | None = ..., is_literal: bool = ..., _selectable: Incomplete | None = ... + self, text, type_: Incomplete | None = None, is_literal: bool = False, _selectable: Incomplete | None = None ) -> None: ... - def get_children(self, column_tables: bool = ..., **kw): ... # type: ignore[override] + def get_children(self, column_tables: bool = False, **kw): ... # type: ignore[override] @property def entity_namespace(self): ... @@ -459,7 +459,7 @@ class AnnotatedColumnElement(Annotated): def info(self): ... class _truncated_label(quoted_name): - def __new__(cls, value, quote: Incomplete | None = ...): ... + def __new__(cls, value, quote: Incomplete | None = None): ... def __reduce__(self): ... def apply_map(self, map_): ... @@ -467,7 +467,7 @@ class conv(_truncated_label): ... class _anonymous_label(_truncated_label): @classmethod - def safe_construct(cls, seed, body, enclosing_label: Incomplete | None = ..., sanitize_key: bool = ...): ... + def safe_construct(cls, seed, body, enclosing_label: Incomplete | None = None, sanitize_key: bool = False): ... def __add__(self, other): ... def __radd__(self, other): ... def apply_map(self, map_): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi index d5180c37d9bf..22404d7612b5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi @@ -7,15 +7,15 @@ from .elements import BinaryExpression, ColumnElement, NamedColumn from .selectable import FromClause, TableValuedAlias from .visitors import TraversibleType -def register_function(identifier, fn, package: str = ...) -> None: ... +def register_function(identifier, fn, package: str = "_default") -> None: ... class FunctionElement(Executable, ColumnElement[Any], FromClause, Generative): # type: ignore[misc] packagenames: Incomplete clause_expr: Incomplete def __init__(self, *clauses, **kwargs) -> None: ... - def scalar_table_valued(self, name, type_: Incomplete | None = ...): ... + def scalar_table_valued(self, name, type_: Incomplete | None = None): ... def table_valued(self, *expr, **kw): ... - def column_valued(self, name: str | None = ..., joins_implicitly: bool = ...): ... + def column_valued(self, name: str | None = None, joins_implicitly: bool = False): ... @property def columns(self): ... @property @@ -24,20 +24,20 @@ class FunctionElement(Executable, ColumnElement[Any], FromClause, Generative): def clauses(self): ... def over( self, - partition_by: Incomplete | None = ..., - order_by: Incomplete | None = ..., - rows: Incomplete | None = ..., - range_: Incomplete | None = ..., + partition_by: Incomplete | None = None, + order_by: Incomplete | None = None, + rows: Incomplete | None = None, + range_: Incomplete | None = None, ): ... def within_group(self, *order_by): ... def filter(self, *criterion): ... def as_comparison(self, left_index, right_index): ... def within_group_type(self, within_group) -> None: ... - def alias(self, name: str | None = ..., joins_implicitly: bool = ...) -> TableValuedAlias: ... # type: ignore[override] + def alias(self, name: str | None = None, joins_implicitly: bool = False) -> TableValuedAlias: ... # type: ignore[override] def select(self): ... def scalar(self): ... def execute(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @property def entity_namespace(self): ... @@ -66,7 +66,7 @@ class ScalarFunctionColumn(NamedColumn): fn: Incomplete name: Incomplete type: Incomplete - def __init__(self, fn, name, type_: Incomplete | None = ...) -> None: ... + def __init__(self, fn, name, type_: Incomplete | None = None) -> None: ... class _FunctionGenerator: opts: Incomplete @@ -143,7 +143,7 @@ class random(GenericFunction): class count(GenericFunction): type: Incomplete inherit_cache: bool - def __init__(self, expression: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, expression: Incomplete | None = None, **kwargs) -> None: ... class current_date(AnsiFunction): type: Incomplete diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi index b6ada6db4382..49c91eefc3c5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi @@ -17,12 +17,12 @@ class LambdaOptions(Options): def lambda_stmt( lmb, - enable_tracking: bool = ..., - track_closure_variables: bool = ..., - track_on: Incomplete | None = ..., - global_track_bound_values: bool = ..., - track_bound_values: bool = ..., - lambda_cache: Incomplete | None = ..., + enable_tracking: bool = True, + track_closure_variables: bool = True, + track_on: Incomplete | None = None, + global_track_bound_values: bool = True, + track_bound_values: bool = True, + lambda_cache: Incomplete | None = None, ): ... class LambdaElement(elements.ClauseElement): @@ -32,22 +32,22 @@ class LambdaElement(elements.ClauseElement): role: Incomplete tracker_key: Incomplete opts: Incomplete - def __init__(self, fn, role, opts=..., apply_propagate_attrs: Incomplete | None = ...) -> None: ... + def __init__(self, fn, role, opts=..., apply_propagate_attrs: Incomplete | None = None) -> None: ... def __getattr__(self, key: str): ... class DeferredLambdaElement(LambdaElement): lambda_args: Incomplete - def __init__(self, fn, role, opts=..., lambda_args=...) -> None: ... + def __init__(self, fn, role, opts=..., lambda_args=()) -> None: ... class StatementLambdaElement(roles.AllowsLambdaRole, LambdaElement): def __add__(self, other): ... def add_criteria( self, other, - enable_tracking: bool = ..., - track_on: Incomplete | None = ..., - track_closure_variables: bool = ..., - track_bound_values: bool = ..., + enable_tracking: bool = True, + track_on: Incomplete | None = None, + track_closure_variables: bool = True, + track_bound_values: bool = True, ): ... def spoil(self): ... @@ -105,9 +105,9 @@ class PyWrapper(ColumnOperators[_T], Generic[_T]): fn, name, to_evaluate, - closure_index: Incomplete | None = ..., - getter: Incomplete | None = ..., - track_bound_values: bool = ..., + closure_index: Incomplete | None = None, + getter: Incomplete | None = None, + track_bound_values: bool = True, ) -> None: ... def __call__(self, *arg, **kw): ... def operate(self, op, *other, **kwargs): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi index abfafe7c2e63..cb91ff53553d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi @@ -11,8 +11,8 @@ class Operators: def __and__(self, other): ... def __or__(self, other): ... def __invert__(self): ... - def op(self, opstring, precedence: int = ..., is_comparison: bool = ..., return_type: Incomplete | None = ...): ... - def bool_op(self, opstring, precedence: int = ...): ... + def op(self, opstring, precedence: int = 0, is_comparison: bool = False, return_type: Incomplete | None = None): ... + def bool_op(self, opstring, precedence: int = 0): ... def operate(self, op, *other, **kwargs): ... def reverse_operate(self, op, other, **kwargs): ... @@ -27,11 +27,11 @@ class custom_op: def __init__( self, opstring, - precedence: int = ..., - is_comparison: bool = ..., - return_type: Incomplete | None = ..., - natural_self_precedent: bool = ..., - eager_grouping: bool = ..., + precedence: int = 0, + is_comparison: bool = False, + return_type: Incomplete | None = None, + natural_self_precedent: bool = False, + eager_grouping: bool = False, ) -> None: ... def __eq__(self, other): ... def __hash__(self) -> int: ... @@ -55,15 +55,15 @@ class ColumnOperators(Operators, Generic[_T]): def __lshift__(self, other) -> ColumnOperators[_T]: ... def __rshift__(self, other) -> ColumnOperators[_T]: ... def concat(self, other: _T | ColumnOperators[_T] | None) -> ColumnOperators[_T]: ... - def like(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... - def ilike(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... + def like(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... + def ilike(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... def in_(self, other: Container[_T] | Iterable[_T]) -> ColumnOperators[_T]: ... def not_in(self, other: Container[_T] | Iterable[_T]) -> ColumnOperators[_T]: ... def notin_(self, other: Container[_T] | Iterable[_T]) -> ColumnOperators[_T]: ... - def not_like(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... - def notlike(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... - def not_ilike(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... - def notilike(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... + def not_like(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... + def notlike(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... + def not_ilike(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... + def notilike(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... def is_(self, other: _T) -> ColumnOperators[_T]: ... def is_not(self, other: _T) -> ColumnOperators[_T]: ... def isnot(self, other: _T) -> ColumnOperators[_T]: ... @@ -71,8 +71,8 @@ class ColumnOperators(Operators, Generic[_T]): def endswith(self, other: str, **kwargs) -> ColumnOperators[_T]: ... def contains(self, other: str, **kwargs) -> ColumnOperators[_T]: ... def match(self, other: str, **kwargs) -> ColumnOperators[_T]: ... - def regexp_match(self, pattern, flags: Incomplete | None = ...) -> ColumnOperators[_T]: ... - def regexp_replace(self, pattern, replacement, flags: Incomplete | None = ...) -> ColumnOperators[_T]: ... + def regexp_match(self, pattern, flags: Incomplete | None = None) -> ColumnOperators[_T]: ... + def regexp_replace(self, pattern, replacement, flags: Incomplete | None = None) -> ColumnOperators[_T]: ... def desc(self) -> ColumnOperators[_T]: ... def asc(self) -> ColumnOperators[_T]: ... def nulls_first(self) -> ColumnOperators[_T]: ... @@ -85,7 +85,7 @@ class ColumnOperators(Operators, Generic[_T]): def __rmul__(self, other) -> ColumnOperators[_T]: ... def __rdiv__(self, other) -> ColumnOperators[_T]: ... def __rmod__(self, other) -> ColumnOperators[_T]: ... - def between(self, cleft, cright, symmetric: bool = ...) -> ColumnOperators[_T]: ... + def between(self, cleft, cright, symmetric: bool = False) -> ColumnOperators[_T]: ... def distinct(self) -> ColumnOperators[_T]: ... def any_(self) -> ColumnOperators[_T]: ... def all_(self) -> ColumnOperators[_T]: ... @@ -123,18 +123,18 @@ isnot = is_not def collate(a, b): ... def op(a, opstring, b): ... -def like_op(a, b, escape: Incomplete | None = ...): ... -def not_like_op(a, b, escape: Incomplete | None = ...): ... +def like_op(a, b, escape: Incomplete | None = None): ... +def not_like_op(a, b, escape: Incomplete | None = None): ... notlike_op = not_like_op -def ilike_op(a, b, escape: Incomplete | None = ...): ... -def not_ilike_op(a, b, escape: Incomplete | None = ...): ... +def ilike_op(a, b, escape: Incomplete | None = None): ... +def not_ilike_op(a, b, escape: Incomplete | None = None): ... notilike_op = not_ilike_op -def between_op(a, b, c, symmetric: bool = ...): ... -def not_between_op(a, b, c, symmetric: bool = ...): ... +def between_op(a, b, c, symmetric: bool = False): ... +def not_between_op(a, b, c, symmetric: bool = False): ... notbetween_op = not_between_op @@ -146,25 +146,25 @@ notin_op = not_in_op def distinct_op(a): ... def any_op(a): ... def all_op(a): ... -def startswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... -def not_startswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... +def startswith_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... +def not_startswith_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... notstartswith_op = not_startswith_op -def endswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... -def not_endswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... +def endswith_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... +def not_endswith_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... notendswith_op = not_endswith_op -def contains_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... -def not_contains_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... +def contains_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... +def not_contains_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... notcontains_op = not_contains_op def match_op(a, b, **kw): ... -def regexp_match_op(a, b, flags: Incomplete | None = ...): ... -def not_regexp_match_op(a, b, flags: Incomplete | None = ...): ... -def regexp_replace_op(a, b, replacement, flags: Incomplete | None = ...): ... +def regexp_match_op(a, b, flags: Incomplete | None = None): ... +def not_regexp_match_op(a, b, flags: Incomplete | None = None): ... +def regexp_replace_op(a, b, replacement, flags: Incomplete | None = None): ... def not_match_op(a, b, **kw): ... notmatch_op = not_match_op diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi index 21656beed655..3199c6d3dcd2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi @@ -30,13 +30,13 @@ class Table(DialectKWArgs, SchemaItem, TableClause): @property def bind(self): ... def add_is_dependent_on(self, table) -> None: ... - def append_column(self, column, replace_existing: bool = ...) -> None: ... # type: ignore[override] + def append_column(self, column, replace_existing: bool = False) -> None: ... # type: ignore[override] def append_constraint(self, constraint) -> None: ... - def exists(self, bind: Incomplete | None = ...): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def tometadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = ..., name: Incomplete | None = ...): ... - def to_metadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = ..., name: Incomplete | None = ...): ... + def exists(self, bind: Incomplete | None = None): ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... + def tometadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = None, name: Incomplete | None = None): ... + def to_metadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = None, name: Incomplete | None = None): ... class Column(DialectKWArgs, SchemaItem, ColumnClause): __visit_name__: str @@ -80,20 +80,20 @@ class ForeignKey(DialectKWArgs, SchemaItem): def __init__( self, column, - _constraint: Incomplete | None = ..., - use_alter: bool = ..., - name: Incomplete | None = ..., - onupdate: Incomplete | None = ..., - ondelete: Incomplete | None = ..., - deferrable: Incomplete | None = ..., - initially: Incomplete | None = ..., - link_to_name: bool = ..., - match: Incomplete | None = ..., - info: Incomplete | None = ..., - _unresolvable: bool = ..., + _constraint: Incomplete | None = None, + use_alter: bool = False, + name: Incomplete | None = None, + onupdate: Incomplete | None = None, + ondelete: Incomplete | None = None, + deferrable: Incomplete | None = None, + initially: Incomplete | None = None, + link_to_name: bool = False, + match: Incomplete | None = None, + info: Incomplete | None = None, + _unresolvable: bool = False, **dialect_kw, ) -> None: ... - def copy(self, schema: Incomplete | None = ..., **kw): ... + def copy(self, schema: Incomplete | None = None, **kw): ... @property def target_fullname(self): ... def references(self, table): ... @@ -107,8 +107,8 @@ class DefaultGenerator(Executable, SchemaItem): is_server_default: bool column: Any for_update: Any - def __init__(self, for_update: bool = ...) -> None: ... - def execute(self, bind: Incomplete | None = ...): ... # type: ignore[override] + def __init__(self, for_update: bool = False) -> None: ... + def execute(self, bind: Incomplete | None = None): ... # type: ignore[override] @property def bind(self): ... @@ -134,15 +134,15 @@ class IdentityOptions: order: Any def __init__( self, - start: Incomplete | None = ..., - increment: Incomplete | None = ..., - minvalue: Incomplete | None = ..., - maxvalue: Incomplete | None = ..., - nominvalue: Incomplete | None = ..., - nomaxvalue: Incomplete | None = ..., - cycle: Incomplete | None = ..., - cache: Incomplete | None = ..., - order: Incomplete | None = ..., + start: Incomplete | None = None, + increment: Incomplete | None = None, + minvalue: Incomplete | None = None, + maxvalue: Incomplete | None = None, + nominvalue: Incomplete | None = None, + nomaxvalue: Incomplete | None = None, + cycle: Incomplete | None = None, + cache: Incomplete | None = None, + order: Incomplete | None = None, ) -> None: ... class Sequence(IdentityOptions, DefaultGenerator): @@ -156,22 +156,22 @@ class Sequence(IdentityOptions, DefaultGenerator): def __init__( self, name, - start: Incomplete | None = ..., - increment: Incomplete | None = ..., - minvalue: Incomplete | None = ..., - maxvalue: Incomplete | None = ..., - nominvalue: Incomplete | None = ..., - nomaxvalue: Incomplete | None = ..., - cycle: Incomplete | None = ..., - schema: Incomplete | None = ..., - cache: Incomplete | None = ..., - order: Incomplete | None = ..., - data_type: Incomplete | None = ..., - optional: bool = ..., - quote: Incomplete | None = ..., - metadata: Incomplete | None = ..., - quote_schema: Incomplete | None = ..., - for_update: bool = ..., + start: Incomplete | None = None, + increment: Incomplete | None = None, + minvalue: Incomplete | None = None, + maxvalue: Incomplete | None = None, + nominvalue: Incomplete | None = None, + nomaxvalue: Incomplete | None = None, + cycle: Incomplete | None = None, + schema: Incomplete | None = None, + cache: Incomplete | None = None, + order: Incomplete | None = None, + data_type: Incomplete | None = None, + optional: bool = False, + quote: Incomplete | None = None, + metadata: Incomplete | None = None, + quote_schema: Incomplete | None = None, + for_update: bool = False, ) -> None: ... @memoized_property def is_callable(self): ... @@ -180,8 +180,8 @@ class Sequence(IdentityOptions, DefaultGenerator): def next_value(self): ... @property def bind(self): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = True) -> None: ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = True) -> None: ... class FetchedValue(SchemaEventTarget): is_server_default: bool @@ -189,13 +189,13 @@ class FetchedValue(SchemaEventTarget): has_argument: bool is_clause_element: bool for_update: Any - def __init__(self, for_update: bool = ...) -> None: ... + def __init__(self, for_update: bool = False) -> None: ... class DefaultClause(FetchedValue): has_argument: bool arg: Any reflected: Any - def __init__(self, arg, for_update: bool = ..., _reflected: bool = ...) -> None: ... + def __init__(self, arg, for_update: bool = False, _reflected: bool = False) -> None: ... class Constraint(DialectKWArgs, SchemaItem): __visit_name__: str @@ -205,12 +205,12 @@ class Constraint(DialectKWArgs, SchemaItem): info: Any def __init__( self, - name: Incomplete | None = ..., - deferrable: Incomplete | None = ..., - initially: Incomplete | None = ..., - _create_rule: Incomplete | None = ..., - info: Incomplete | None = ..., - _type_bound: bool = ..., + name: Incomplete | None = None, + deferrable: Incomplete | None = None, + initially: Incomplete | None = None, + _create_rule: Incomplete | None = None, + info: Incomplete | None = None, + _type_bound: bool = False, **dialect_kw, ) -> None: ... @property @@ -225,7 +225,7 @@ class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint): def __init__(self, *columns, **kw) -> None: ... columns: Any def __contains__(self, x): ... - def copy(self, target_table: Incomplete | None = ..., **kw): ... + def copy(self, target_table: Incomplete | None = None, **kw): ... def contains_column(self, col): ... def __iter__(self): ... def __len__(self) -> int: ... @@ -236,19 +236,19 @@ class CheckConstraint(ColumnCollectionConstraint): def __init__( self, sqltext, - name: Incomplete | None = ..., - deferrable: Incomplete | None = ..., - initially: Incomplete | None = ..., - table: Incomplete | None = ..., - info: Incomplete | None = ..., - _create_rule: Incomplete | None = ..., - _autoattach: bool = ..., - _type_bound: bool = ..., + name: Incomplete | None = None, + deferrable: Incomplete | None = None, + initially: Incomplete | None = None, + table: Incomplete | None = None, + info: Incomplete | None = None, + _create_rule: Incomplete | None = None, + _autoattach: bool = True, + _type_bound: bool = False, **kw, ) -> None: ... @property def is_column_level(self): ... - def copy(self, target_table: Incomplete | None = ..., **kw): ... + def copy(self, target_table: Incomplete | None = None, **kw): ... class ForeignKeyConstraint(ColumnCollectionConstraint): __visit_name__: str @@ -262,16 +262,16 @@ class ForeignKeyConstraint(ColumnCollectionConstraint): self, columns, refcolumns, - name: Incomplete | None = ..., - onupdate: Incomplete | None = ..., - ondelete: Incomplete | None = ..., - deferrable: Incomplete | None = ..., - initially: Incomplete | None = ..., - use_alter: bool = ..., - link_to_name: bool = ..., - match: Incomplete | None = ..., - table: Incomplete | None = ..., - info: Incomplete | None = ..., + name: Incomplete | None = None, + onupdate: Incomplete | None = None, + ondelete: Incomplete | None = None, + deferrable: Incomplete | None = None, + initially: Incomplete | None = None, + use_alter: bool = False, + link_to_name: bool = False, + match: Incomplete | None = None, + table: Incomplete | None = None, + info: Incomplete | None = None, **dialect_kw, ) -> None: ... columns: Any @@ -279,7 +279,7 @@ class ForeignKeyConstraint(ColumnCollectionConstraint): def referred_table(self): ... @property def column_keys(self): ... - def copy(self, schema: Incomplete | None = ..., target_table: Incomplete | None = ..., **kw): ... # type: ignore[override] + def copy(self, schema: Incomplete | None = None, target_table: Incomplete | None = None, **kw): ... # type: ignore[override] class PrimaryKeyConstraint(ColumnCollectionConstraint): __visit_name__: str @@ -300,8 +300,8 @@ class Index(DialectKWArgs, ColumnCollectionMixin, SchemaItem): def __init__(self, name, *expressions, **kw) -> None: ... @property def bind(self): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...): ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = False): ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... DEFAULT_NAMING_CONVENTION: Any @@ -313,11 +313,11 @@ class MetaData(SchemaItem): info: Any def __init__( self, - bind: Incomplete | None = ..., - schema: Incomplete | None = ..., - quote_schema: Incomplete | None = ..., - naming_convention: Incomplete | None = ..., - info: Incomplete | None = ..., + bind: Incomplete | None = None, + schema: Incomplete | None = None, + quote_schema: Incomplete | None = None, + naming_convention: Incomplete | None = None, + info: Incomplete | None = None, ) -> None: ... def __contains__(self, table_or_key) -> bool: ... def is_bound(self): ... @@ -328,17 +328,17 @@ class MetaData(SchemaItem): def sorted_tables(self): ... def reflect( self, - bind: Incomplete | None = ..., - schema: Incomplete | None = ..., - views: bool = ..., - only: Incomplete | None = ..., - extend_existing: bool = ..., - autoload_replace: bool = ..., - resolve_fks: bool = ..., + bind: Incomplete | None = None, + schema: Incomplete | None = None, + views: bool = False, + only: Incomplete | None = None, + extend_existing: bool = False, + autoload_replace: bool = True, + resolve_fks: bool = True, **dialect_kwargs, ) -> None: ... - def create_all(self, bind: Incomplete | None = ..., tables: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop_all(self, bind: Incomplete | None = ..., tables: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create_all(self, bind: Incomplete | None = None, tables: Incomplete | None = None, checkfirst: bool = True) -> None: ... + def drop_all(self, bind: Incomplete | None = None, tables: Incomplete | None = None, checkfirst: bool = True) -> None: ... class ThreadLocalMetaData(MetaData): __visit_name__: str @@ -353,8 +353,8 @@ class Computed(FetchedValue, SchemaItem): sqltext: Any persisted: Any column: Any - def __init__(self, sqltext, persisted: Incomplete | None = ...) -> None: ... - def copy(self, target_table: Incomplete | None = ..., **kw): ... + def __init__(self, sqltext, persisted: Incomplete | None = None) -> None: ... + def copy(self, target_table: Incomplete | None = None, **kw): ... class Identity(IdentityOptions, FetchedValue, SchemaItem): __visit_name__: str @@ -363,16 +363,16 @@ class Identity(IdentityOptions, FetchedValue, SchemaItem): column: Any def __init__( self, - always: bool = ..., - on_null: Incomplete | None = ..., - start: Incomplete | None = ..., - increment: Incomplete | None = ..., - minvalue: Incomplete | None = ..., - maxvalue: Incomplete | None = ..., - nominvalue: Incomplete | None = ..., - nomaxvalue: Incomplete | None = ..., - cycle: Incomplete | None = ..., - cache: Incomplete | None = ..., - order: Incomplete | None = ..., + always: bool = False, + on_null: Incomplete | None = None, + start: Incomplete | None = None, + increment: Incomplete | None = None, + minvalue: Incomplete | None = None, + maxvalue: Incomplete | None = None, + nominvalue: Incomplete | None = None, + nomaxvalue: Incomplete | None = None, + cycle: Incomplete | None = None, + cache: Incomplete | None = None, + order: Incomplete | None = None, ) -> None: ... def copy(self, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi index eb24ab00c8f7..c9ddc58d3df7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi @@ -34,9 +34,9 @@ class ReturnsRows(roles.ReturnsRowsRole, ClauseElement): class Selectable(ReturnsRows): __visit_name__: str is_selectable: bool - def lateral(self, name: Incomplete | None = ...): ... + def lateral(self, name: Incomplete | None = None): ... def replace_selectable(self, old, alias): ... - def corresponding_column(self, column, require_embedded: bool = ...): ... + def corresponding_column(self, column, require_embedded: bool = False): ... class HasPrefixes: def prefix_with(self, *expr, **kw) -> Self: ... @@ -45,20 +45,20 @@ class HasSuffixes: def suffix_with(self, *expr, **kw) -> Self: ... class HasHints: - def with_statement_hint(self, text, dialect_name: str = ...): ... - def with_hint(self, selectable, text: str, dialect_name: str = ...) -> Self: ... + def with_statement_hint(self, text, dialect_name: str = "*"): ... + def with_hint(self, selectable, text: str, dialect_name: str = "*") -> Self: ... class FromClause(roles.AnonymizedFromClauseRole, Selectable): __visit_name__: str named_with_column: bool schema: Any is_selectable: bool - def select(self, whereclause: Incomplete | None = ..., **kwargs): ... - def join(self, right, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...): ... - def outerjoin(self, right, onclause: Incomplete | None = ..., full: bool = ...): ... - def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... + def select(self, whereclause: Incomplete | None = None, **kwargs): ... + def join(self, right, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False): ... + def outerjoin(self, right, onclause: Incomplete | None = None, full: bool = False): ... + def alias(self, name: Incomplete | None = None, flat: bool = False): ... def table_valued(self): ... - def tablesample(self, sampling, name: Incomplete | None = ..., seed: Incomplete | None = ...): ... + def tablesample(self, sampling, name: Incomplete | None = None, seed: Incomplete | None = None): ... def is_derived_from(self, fromclause): ... @property def description(self): ... @@ -87,15 +87,15 @@ class Join(roles.DMLTableRole, FromClause): onclause: Any isouter: Any full: Any - def __init__(self, left, right, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> None: ... + def __init__(self, left, right, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False) -> None: ... @property def description(self): ... def is_derived_from(self, fromclause): ... - def self_group(self, against: Incomplete | None = ...): ... - def select(self, whereclause: Incomplete | None = ..., **kwargs): ... + def self_group(self, against: Incomplete | None = None): ... + def select(self, whereclause: Incomplete | None = None, **kwargs): ... @property def bind(self): ... - def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... + def alias(self, name: Incomplete | None = None, flat: bool = False): ... class NoInit: def __init__(self, *arg, **kw) -> None: ... @@ -118,9 +118,9 @@ class TableValuedAlias(Alias): __visit_name__: str @HasMemoized.memoized_attribute def column(self): ... - def alias(self, name: Incomplete | None = ...): ... # type: ignore[override] - def lateral(self, name: Incomplete | None = ...): ... - def render_derived(self, name: Incomplete | None = ..., with_types: bool = ...): ... + def alias(self, name: Incomplete | None = None): ... # type: ignore[override] + def lateral(self, name: Incomplete | None = None): ... + def render_derived(self, name: Incomplete | None = None, with_types: bool = False): ... class Lateral(AliasedReturnsRows): __visit_name__: str @@ -131,13 +131,13 @@ class TableSample(AliasedReturnsRows): class CTE(roles.DMLTableRole, roles.IsCTERole, Generative, HasPrefixes, HasSuffixes, AliasedReturnsRows): __visit_name__: str - def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... + def alias(self, name: Incomplete | None = None, flat: bool = False): ... def union(self, *other): ... def union_all(self, *other): ... class HasCTE(roles.HasCTERole): def add_cte(self, cte) -> None: ... - def cte(self, name: Incomplete | None = ..., recursive: bool = ..., nesting: bool = ...): ... + def cte(self, name: Incomplete | None = None, recursive: bool = False, nesting: bool = False): ... class Subquery(AliasedReturnsRows): __visit_name__: str @@ -169,9 +169,9 @@ class TableClause(roles.DMLTableRole, Immutable, FromClause): @memoized_property def description(self): ... def append_column(self, c, **kw) -> None: ... - def insert(self, values: Incomplete | None = ..., inline: bool = ..., **kwargs): ... - def update(self, whereclause: Incomplete | None = ..., values: Incomplete | None = ..., inline: bool = ..., **kwargs): ... - def delete(self, whereclause: Incomplete | None = ..., **kwargs): ... + def insert(self, values: Incomplete | None = None, inline: bool = False, **kwargs): ... + def update(self, whereclause: Incomplete | None = None, values: Incomplete | None = None, inline: bool = False, **kwargs): ... + def delete(self, whereclause: Incomplete | None = None, **kwargs): ... class ForUpdateArg(ClauseElement): def __eq__(self, other): ... @@ -183,7 +183,12 @@ class ForUpdateArg(ClauseElement): key_share: Any of: Any def __init__( - self, nowait: bool = ..., read: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ... + self, + nowait: bool = False, + read: bool = False, + of: Incomplete | None = None, + skip_locked: bool = False, + key_share: bool = False, ) -> None: ... class Values(Generative, FromClause): @@ -193,7 +198,7 @@ class Values(Generative, FromClause): literal_binds: Any def __init__(self, *columns, **kw) -> None: ... def alias(self, name: Incomplete | None, **kw) -> Self: ... # type: ignore[override] - def lateral(self, name: Incomplete | None = ...) -> Self: ... + def lateral(self, name: Incomplete | None = None) -> Self: ... def data(self, values) -> Self: ... class SelectBase( @@ -220,9 +225,9 @@ class SelectBase( def exists(self): ... def scalar_subquery(self): ... def label(self, name): ... - def lateral(self, name: Incomplete | None = ...): ... - def subquery(self, name: Incomplete | None = ...): ... - def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... + def lateral(self, name: Incomplete | None = None): ... + def subquery(self, name: Incomplete | None = None): ... + def alias(self, name: Incomplete | None = None, flat: bool = False): ... class SelectStatementGrouping(GroupedElement, SelectBase): __visit_name__: str @@ -232,7 +237,7 @@ class SelectStatementGrouping(GroupedElement, SelectBase): def set_label_style(self, label_style): ... @property def select_statement(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @property def selected_columns(self): ... @@ -244,21 +249,26 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): def __init__( self, _label_style=..., - use_labels: bool = ..., - limit: Incomplete | None = ..., - offset: Incomplete | None = ..., - order_by: Incomplete | None = ..., - group_by: Incomplete | None = ..., - bind: Incomplete | None = ..., + use_labels: bool = False, + limit: Incomplete | None = None, + offset: Incomplete | None = None, + order_by: Incomplete | None = None, + group_by: Incomplete | None = None, + bind: Incomplete | None = None, ) -> None: ... def with_for_update( - self, nowait: bool = ..., read: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ... + self, + nowait: bool = False, + read: bool = False, + of: Incomplete | None = None, + skip_locked: bool = False, + key_share: bool = False, ) -> Self: ... def get_label_style(self): ... def set_label_style(self, style): ... def apply_labels(self): ... def limit(self, limit: Incomplete | None) -> Self: ... - def fetch(self, count: Incomplete | None, with_ties: bool = ..., percent: bool = ...) -> Self: ... + def fetch(self, count: Incomplete | None, with_ties: bool = False, percent: bool = False) -> Self: ... def offset(self, offset: Incomplete | None) -> Self: ... def slice(self, start: Incomplete | None, stop: Incomplete | None) -> Self: ... def order_by(self, *clauses) -> Self: ... @@ -277,7 +287,7 @@ class CompoundSelect(HasCompileState, GenerativeSelect): keyword: Any selects: Any def __init__(self, keyword, *selects, **kwargs) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... def is_derived_from(self, fromclause): ... @property def selected_columns(self): ... @@ -324,14 +334,14 @@ class Select( @classmethod def create_legacy_select( cls, - columns: Incomplete | None = ..., - whereclause: Incomplete | None = ..., - from_obj: Incomplete | None = ..., - distinct: bool = ..., - having: Incomplete | None = ..., - correlate: bool = ..., - prefixes: Incomplete | None = ..., - suffixes: Incomplete | None = ..., + columns: Incomplete | None = None, + whereclause: Incomplete | None = None, + from_obj: Incomplete | None = None, + distinct: bool = False, + having: Incomplete | None = None, + correlate: bool = True, + prefixes: Incomplete | None = None, + suffixes: Incomplete | None = None, **kwargs, ): ... def __init__(self) -> None: ... @@ -340,10 +350,10 @@ class Select( @property def column_descriptions(self): ... def from_statement(self, statement): ... - def join(self, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... - def outerjoin_from(self, from_, target, onclause: Incomplete | None = ..., full: bool = ...): ... - def join_from(self, from_, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... - def outerjoin(self, target, onclause: Incomplete | None = ..., full: bool = ...): ... + def join(self, target, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False) -> Self: ... + def outerjoin_from(self, from_, target, onclause: Incomplete | None = None, full: bool = False): ... + def join_from(self, from_, target, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False) -> Self: ... + def outerjoin(self, target, onclause: Incomplete | None = None, full: bool = False): ... def get_final_froms(self): ... @property def froms(self): ... @@ -355,7 +365,7 @@ class Select( def get_children(self, **kwargs): ... def add_columns(self, *columns) -> Self: ... def column(self, column): ... - def reduce_columns(self, only_synonyms: bool = ...): ... + def reduce_columns(self, only_synonyms: bool = True): ... def with_only_columns(self, *columns, **kw) -> Self: ... @property def whereclause(self): ... @@ -367,7 +377,7 @@ class Select( def correlate_except(self, *fromclauses) -> Self: ... @HasMemoized.memoized_attribute def selected_columns(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... def union(self, *other, **kwargs): ... def union_all(self, *other, **kwargs): ... def except_(self, *other, **kwargs): ... @@ -396,7 +406,7 @@ class ScalarSelect(roles.InElementRole, Generative, Grouping): class Exists(UnaryExpression): inherit_cache: bool def __init__(self, *args, **kwargs) -> None: ... - def select(self, whereclause: Incomplete | None = ..., **kwargs): ... + def select(self, whereclause: Incomplete | None = None, **kwargs): ... def correlate(self, *fromclause): ... def correlate_except(self, *fromclause): ... def select_from(self, *froms): ... @@ -409,7 +419,7 @@ class TextualSelect(SelectBase): element: Any column_args: Any positional: Any - def __init__(self, text, columns, positional: bool = ...) -> None: ... + def __init__(self, text, columns, positional: bool = False) -> None: ... @HasMemoized.memoized_attribute def selected_columns(self): ... def bindparams(self, *binds, **bind_as_values) -> Self: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi index eef39d632164..1bdec2ced356 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi @@ -38,12 +38,12 @@ class String(Concatenable, TypeEngine): collation: Any def __init__( self, - length: Incomplete | None = ..., - collation: Incomplete | None = ..., - convert_unicode: bool = ..., - unicode_error: Incomplete | None = ..., - _warn_on_bytestring: bool = ..., - _expect_unicode: bool = ..., + length: Incomplete | None = None, + collation: Incomplete | None = None, + convert_unicode: bool = False, + unicode_error: Incomplete | None = None, + _warn_on_bytestring: bool = False, + _expect_unicode: bool = False, ) -> None: ... def literal_processor(self, dialect): ... def bind_processor(self, dialect): ... @@ -57,11 +57,11 @@ class Text(String): class Unicode(String): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class UnicodeText(Text): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class Integer(_LookupExpressionAdapter, TypeEngine): __visit_name__: str @@ -84,10 +84,10 @@ class Numeric(_LookupExpressionAdapter, TypeEngine): asdecimal: Any def __init__( self, - precision: Incomplete | None = ..., - scale: Incomplete | None = ..., - decimal_return_scale: Incomplete | None = ..., - asdecimal: bool = ..., + precision: Incomplete | None = None, + scale: Incomplete | None = None, + decimal_return_scale: Incomplete | None = None, + asdecimal: bool = True, ) -> None: ... def get_dbapi_type(self, dbapi): ... def literal_processor(self, dialect): ... @@ -103,14 +103,14 @@ class Float(Numeric): asdecimal: Any decimal_return_scale: Any def __init__( - self, precision: Incomplete | None = ..., asdecimal: bool = ..., decimal_return_scale: Incomplete | None = ... + self, precision: Incomplete | None = None, asdecimal: bool = False, decimal_return_scale: Incomplete | None = None ) -> None: ... def result_processor(self, dialect, coltype): ... class DateTime(_LookupExpressionAdapter, TypeEngine): __visit_name__: str timezone: Any - def __init__(self, timezone: bool = ...) -> None: ... + def __init__(self, timezone: bool = False) -> None: ... def get_dbapi_type(self, dbapi): ... @property def python_type(self): ... @@ -124,14 +124,14 @@ class Date(_LookupExpressionAdapter, TypeEngine): class Time(_LookupExpressionAdapter, TypeEngine): __visit_name__: str timezone: Any - def __init__(self, timezone: bool = ...) -> None: ... + def __init__(self, timezone: bool = False) -> None: ... def get_dbapi_type(self, dbapi): ... @property def python_type(self): ... class _Binary(TypeEngine): length: Any - def __init__(self, length: Incomplete | None = ...) -> None: ... + def __init__(self, length: Incomplete | None = None) -> None: ... def literal_processor(self, dialect): ... @property def python_type(self): ... @@ -142,7 +142,7 @@ class _Binary(TypeEngine): class LargeBinary(_Binary): __visit_name__: str - def __init__(self, length: Incomplete | None = ...) -> None: ... + def __init__(self, length: Incomplete | None = None) -> None: ... class SchemaType(SchemaEventTarget): name: Any @@ -151,19 +151,19 @@ class SchemaType(SchemaEventTarget): inherit_schema: Any def __init__( self, - name: Incomplete | None = ..., - schema: Incomplete | None = ..., - metadata: Incomplete | None = ..., - inherit_schema: bool = ..., - quote: Incomplete | None = ..., - _create_events: bool = ..., + name: Incomplete | None = None, + schema: Incomplete | None = None, + metadata: Incomplete | None = None, + inherit_schema: bool = False, + quote: Incomplete | None = None, + _create_events: bool = True, ) -> None: ... def copy(self, **kw): ... def adapt(self, impltype, **kw): ... @property def bind(self): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... class Enum(Emulated, String, SchemaType): __visit_name__: str @@ -175,7 +175,7 @@ class Enum(Emulated, String, SchemaType): class Comparator(Concatenable.Comparator[Any]): ... comparator_factory: Any - def as_generic(self, allow_nulltype: bool = ...): ... + def as_generic(self, allow_nulltype: bool = False): ... def adapt_to_emulated(self, impltype, **kw): ... def adapt(self, impltype, **kw): ... def literal_processor(self, dialect): ... @@ -192,7 +192,7 @@ class PickleType(TypeDecorator): pickler: Any comparator: Any def __init__( - self, protocol=..., pickler: Incomplete | None = ..., comparator: Incomplete | None = ..., impl: Incomplete | None = ... + self, protocol=5, pickler: Incomplete | None = None, comparator: Incomplete | None = None, impl: Incomplete | None = None ) -> None: ... def __reduce__(self): ... def bind_processor(self, dialect): ... @@ -204,7 +204,7 @@ class Boolean(Emulated, TypeEngine, SchemaType): # type: ignore[misc] native: bool create_constraint: Any name: Any - def __init__(self, create_constraint: bool = ..., name: Incomplete | None = ..., _create_events: bool = ...) -> None: ... + def __init__(self, create_constraint: bool = False, name: Incomplete | None = None, _create_events: bool = True) -> None: ... @property def python_type(self): ... def literal_processor(self, dialect): ... @@ -222,7 +222,7 @@ class Interval(Emulated, _AbstractInterval, TypeDecorator): # type: ignore[misc second_precision: Any day_precision: Any def __init__( - self, native: bool = ..., second_precision: Incomplete | None = ..., day_precision: Incomplete | None = ... + self, native: bool = True, second_precision: Incomplete | None = None, day_precision: Incomplete | None = None ) -> None: ... @property def python_type(self): ... @@ -235,7 +235,7 @@ class JSON(Indexable, TypeEngine): hashable: bool NULL: Any none_as_null: Any - def __init__(self, none_as_null: bool = ...) -> None: ... + def __init__(self, none_as_null: bool = False) -> None: ... class JSONElementType(TypeEngine): def string_bind_processor(self, dialect): ... @@ -253,7 +253,7 @@ class JSON(Indexable, TypeEngine): def as_string(self): ... def as_integer(self): ... def as_float(self): ... - def as_numeric(self, precision, scale, asdecimal: bool = ...): ... + def as_numeric(self, precision, scale, asdecimal: bool = True): ... def as_json(self): ... comparator_factory: Any @property @@ -271,14 +271,14 @@ class ARRAY(SchemaEventTarget, Indexable, Concatenable, TypeEngine): class Comparator(Indexable.Comparator[_T], Concatenable.Comparator[_T], Generic[_T]): def contains(self, *arg, **kw) -> ColumnOperators[_T]: ... - def any(self, other, operator: Incomplete | None = ...): ... - def all(self, other, operator: Incomplete | None = ...): ... + def any(self, other, operator: Incomplete | None = None): ... + def all(self, other, operator: Incomplete | None = None): ... comparator_factory: Any item_type: Any as_tuple: Any dimensions: Any def __init__( - self, item_type, as_tuple: bool = ..., dimensions: Incomplete | None = ..., zero_indexes: bool = ... + self, item_type, as_tuple: bool = False, dimensions: Incomplete | None = None, zero_indexes: bool = False ) -> None: ... @property def hashable(self): ... @@ -316,7 +316,7 @@ class BIGINT(BigInteger): class TIMESTAMP(DateTime): __visit_name__: str - def __init__(self, timezone: bool = ...) -> None: ... + def __init__(self, timezone: bool = False) -> None: ... def get_dbapi_type(self, dbapi): ... class DATETIME(DateTime): diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi index 0bd17128785e..1f496655bf0c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi @@ -152,7 +152,7 @@ class TraversalComparatorStrategy(InternalTraversal, util.MemoizedSlots): def compare_bindparam(self, left, right, **kw): ... class ColIdentityComparatorStrategy(TraversalComparatorStrategy): - def compare_column_element(self, left, right, use_proxies: bool = ..., equivalents=..., **kw): ... + def compare_column_element(self, left, right, use_proxies: bool = True, equivalents=(), **kw): ... def compare_column(self, left, right, **kw): ... def compare_label(self, left, right, **kw): ... def compare_table(self, left, right, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi index af91551597c6..f5e384455101 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi @@ -44,11 +44,11 @@ class TypeEngine(Traversible): @property def python_type(self) -> None: ... def with_variant(self, type_, dialect_name): ... - def as_generic(self, allow_nulltype: bool = ...): ... + def as_generic(self, allow_nulltype: bool = False): ... def dialect_impl(self, dialect): ... def adapt(self, cls, **kw): ... def coerce_compared_value(self, op, value): ... - def compile(self, dialect: Incomplete | None = ...): ... + def compile(self, dialect: Incomplete | None = None): ... class VisitableCheckKWArg(util.EnsureKWArgType, TraversibleType): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi index 8bf4c57f94a0..50e9b145af1f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi @@ -11,11 +11,11 @@ def find_left_clause_to_join_from(clauses, join_to, onclause): ... def visit_binary_product(fn, expr) -> None: ... def find_tables( clause, - check_columns: bool = ..., - include_aliases: bool = ..., - include_joins: bool = ..., - include_selects: bool = ..., - include_crud: bool = ..., + check_columns: bool = False, + include_aliases: bool = False, + include_joins: bool = False, + include_selects: bool = False, + include_crud: bool = False, ): ... def unwrap_order_by(clause): ... def unwrap_label_reference(element): ... @@ -35,23 +35,23 @@ class _repr_base: class _repr_row(_repr_base): row: Any max_chars: Any - def __init__(self, row, max_chars: int = ...) -> None: ... + def __init__(self, row, max_chars: int = 300) -> None: ... class _repr_params(_repr_base): params: Any ismulti: Any batches: Any max_chars: Any - def __init__(self, params, batches, max_chars: int = ..., ismulti: Incomplete | None = ...) -> None: ... + def __init__(self, params, batches, max_chars: int = 300, ismulti: Incomplete | None = None) -> None: ... def adapt_criterion_to_null(crit, nulls): ... -def splice_joins(left, right, stop_on: Incomplete | None = ...): ... +def splice_joins(left, right, stop_on: Incomplete | None = None): ... def reduce_columns(columns, *clauses, **kw): ... def criterion_as_pairs( expression, - consider_as_foreign_keys: Incomplete | None = ..., - consider_as_referenced_keys: Incomplete | None = ..., - any_operator: bool = ..., + consider_as_foreign_keys: Incomplete | None = None, + consider_as_referenced_keys: Incomplete | None = None, + any_operator: bool = False, ): ... class ClauseAdapter(visitors.ReplacingExternalTraversal): @@ -65,14 +65,14 @@ class ClauseAdapter(visitors.ReplacingExternalTraversal): def __init__( self, selectable, - equivalents: Incomplete | None = ..., - include_fn: Incomplete | None = ..., - exclude_fn: Incomplete | None = ..., - adapt_on_names: bool = ..., - anonymize_labels: bool = ..., - adapt_from_selectables: Incomplete | None = ..., + equivalents: Incomplete | None = None, + include_fn: Incomplete | None = None, + exclude_fn: Incomplete | None = None, + adapt_on_names: bool = False, + anonymize_labels: bool = False, + adapt_from_selectables: Incomplete | None = None, ) -> None: ... - def replace(self, col, _include_singleton_constants: bool = ...): ... + def replace(self, col, _include_singleton_constants: bool = False): ... class ColumnAdapter(ClauseAdapter): columns: Any @@ -81,14 +81,14 @@ class ColumnAdapter(ClauseAdapter): def __init__( self, selectable, - equivalents: Incomplete | None = ..., - adapt_required: bool = ..., - include_fn: Incomplete | None = ..., - exclude_fn: Incomplete | None = ..., - adapt_on_names: bool = ..., - allow_label_resolve: bool = ..., - anonymize_labels: bool = ..., - adapt_from_selectables: Incomplete | None = ..., + equivalents: Incomplete | None = None, + adapt_required: bool = False, + include_fn: Incomplete | None = None, + exclude_fn: Incomplete | None = None, + adapt_on_names: bool = False, + allow_label_resolve: bool = True, + anonymize_labels: bool = False, + adapt_from_selectables: Incomplete | None = None, ) -> None: ... class _IncludeExcludeMapping: diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi index 398dee26ef9a..e8378c67ddc0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi @@ -5,7 +5,7 @@ class TraversibleType(type): class Traversible(metaclass=TraversibleType): def __class_getitem__(cls, key): ... - def get_children(self, omit_attrs=..., **kw): ... + def get_children(self, omit_attrs=(), **kw): ... class _InternalTraversalType(type): def __init__(cls, clsname, bases, clsdict) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi index e8366e9068ce..0d2920e93a3a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi @@ -8,27 +8,27 @@ def expect_deprecated_20(*messages, **kw): ... def emits_warning_on(db, *messages): ... def uses_deprecated(*messages): ... def global_cleanup_assertions() -> None: ... -def eq_regex(a, b, msg: Incomplete | None = ...) -> None: ... -def eq_(a, b, msg: Incomplete | None = ...) -> None: ... -def ne_(a, b, msg: Incomplete | None = ...) -> None: ... -def le_(a, b, msg: Incomplete | None = ...) -> None: ... -def is_instance_of(a, b, msg: Incomplete | None = ...) -> None: ... -def is_none(a, msg: Incomplete | None = ...) -> None: ... -def is_not_none(a, msg: Incomplete | None = ...) -> None: ... -def is_true(a, msg: Incomplete | None = ...) -> None: ... -def is_false(a, msg: Incomplete | None = ...) -> None: ... -def is_(a, b, msg: Incomplete | None = ...) -> None: ... -def is_not(a, b, msg: Incomplete | None = ...) -> None: ... +def eq_regex(a, b, msg: Incomplete | None = None) -> None: ... +def eq_(a, b, msg: Incomplete | None = None) -> None: ... +def ne_(a, b, msg: Incomplete | None = None) -> None: ... +def le_(a, b, msg: Incomplete | None = None) -> None: ... +def is_instance_of(a, b, msg: Incomplete | None = None) -> None: ... +def is_none(a, msg: Incomplete | None = None) -> None: ... +def is_not_none(a, msg: Incomplete | None = None) -> None: ... +def is_true(a, msg: Incomplete | None = None) -> None: ... +def is_false(a, msg: Incomplete | None = None) -> None: ... +def is_(a, b, msg: Incomplete | None = None) -> None: ... +def is_not(a, b, msg: Incomplete | None = None) -> None: ... is_not_ = is_not -def in_(a, b, msg: Incomplete | None = ...) -> None: ... -def not_in(a, b, msg: Incomplete | None = ...) -> None: ... +def in_(a, b, msg: Incomplete | None = None) -> None: ... +def not_in(a, b, msg: Incomplete | None = None) -> None: ... not_in_ = not_in -def startswith_(a, fragment, msg: Incomplete | None = ...) -> None: ... -def eq_ignore_whitespace(a, b, msg: Incomplete | None = ...) -> None: ... +def startswith_(a, fragment, msg: Incomplete | None = None) -> None: ... +def eq_ignore_whitespace(a, b, msg: Incomplete | None = None) -> None: ... def assert_raises(except_cls, callable_, *args, **kw): ... def assert_raises_context_ok(except_cls, callable_, *args, **kw): ... def assert_raises_message(except_cls, msg, callable_, *args, **kwargs): ... @@ -37,8 +37,8 @@ def assert_raises_message_context_ok(except_cls, msg, callable_, *args, **kwargs class _ErrorContainer: error: Incomplete -def expect_raises(except_cls, check_context: bool = ...): ... -def expect_raises_message(except_cls, msg, check_context: bool = ...): ... +def expect_raises(except_cls, check_context: bool = True): ... +def expect_raises_message(except_cls, msg, check_context: bool = True): ... class AssertsCompiledSQL: test_statement: Incomplete @@ -47,29 +47,29 @@ class AssertsCompiledSQL: self, clause, result, - params: Incomplete | None = ..., - checkparams: Incomplete | None = ..., - for_executemany: bool = ..., - check_literal_execute: Incomplete | None = ..., - check_post_param: Incomplete | None = ..., - dialect: Incomplete | None = ..., - checkpositional: Incomplete | None = ..., - check_prefetch: Incomplete | None = ..., - use_default_dialect: bool = ..., - allow_dialect_select: bool = ..., - supports_default_values: bool = ..., - supports_default_metavalue: bool = ..., - literal_binds: bool = ..., - render_postcompile: bool = ..., - schema_translate_map: Incomplete | None = ..., - render_schema_translate: bool = ..., - default_schema_name: Incomplete | None = ..., - from_linting: bool = ..., - check_param_order: bool = ..., + params: Incomplete | None = None, + checkparams: Incomplete | None = None, + for_executemany: bool = False, + check_literal_execute: Incomplete | None = None, + check_post_param: Incomplete | None = None, + dialect: Incomplete | None = None, + checkpositional: Incomplete | None = None, + check_prefetch: Incomplete | None = None, + use_default_dialect: bool = False, + allow_dialect_select: bool = False, + supports_default_values: bool = True, + supports_default_metavalue: bool = True, + literal_binds: bool = False, + render_postcompile: bool = False, + schema_translate_map: Incomplete | None = None, + render_schema_translate: bool = False, + default_schema_name: Incomplete | None = None, + from_linting: bool = False, + check_param_order: bool = True, ) -> None: ... class ComparesTables: - def assert_tables_equal(self, table, reflected_table, strict_types: bool = ...) -> None: ... + def assert_tables_equal(self, table, reflected_table, strict_types: bool = False) -> None: ... def assert_types_base(self, c1, c2) -> None: ... class AssertsExecutionResults: @@ -77,7 +77,7 @@ class AssertsExecutionResults: def assert_list(self, result, class_, list_) -> None: ... def assert_row(self, class_, rowobj, desc) -> None: ... def assert_unordered_result(self, result, cls, *expected): ... - def sql_execution_asserter(self, db: Incomplete | None = ...): ... + def sql_execution_asserter(self, db: Incomplete | None = None): ... def assert_sql_execution(self, db, callable_, *rules): ... def assert_sql(self, db, callable_, rules): ... def assert_sql_count(self, db, callable_, count) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi index c02391805e7c..c7534746d038 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi @@ -14,7 +14,7 @@ class CursorSQL(SQLMatchRule): statement: Any params: Any consume_statement: Any - def __init__(self, statement, params: Incomplete | None = ..., consume_statement: bool = ...) -> None: ... + def __init__(self, statement, params: Incomplete | None = None, consume_statement: bool = True) -> None: ... errormessage: Any is_consumed: bool def process_statement(self, execute_observed) -> None: ... @@ -23,7 +23,7 @@ class CompiledSQL(SQLMatchRule): statement: Any params: Any dialect: Any - def __init__(self, statement, params: Incomplete | None = ..., dialect: str = ...) -> None: ... + def __init__(self, statement, params: Incomplete | None = None, dialect: str = "default") -> None: ... is_consumed: bool errormessage: Any def process_statement(self, execute_observed) -> None: ... @@ -33,7 +33,7 @@ class RegexSQL(CompiledSQL): orig_regex: Any params: Any dialect: Any - def __init__(self, regex, params: Incomplete | None = ..., dialect: str = ...) -> None: ... + def __init__(self, regex, params: Incomplete | None = None, dialect: str = "default") -> None: ... class DialectSQL(CompiledSQL): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi index 4f0abf91803a..1ef8da6dba4c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi @@ -30,7 +30,7 @@ def assert_conns_closed(fn, *args, **kw) -> None: ... def rollback_open_connections(fn, *args, **kw) -> None: ... def close_first(fn, *args, **kw) -> None: ... def close_open_connections(fn, *args, **kw) -> None: ... -def all_dialects(exclude: Incomplete | None = ...) -> None: ... +def all_dialects(exclude: Incomplete | None = None) -> None: ... class ReconnectFixture: dbapi: Any @@ -39,34 +39,34 @@ class ReconnectFixture: def __init__(self, dbapi) -> None: ... def __getattr__(self, key: str): ... def connect(self, *args, **kwargs): ... - def shutdown(self, stop: bool = ...) -> None: ... + def shutdown(self, stop: bool = False) -> None: ... def restart(self) -> None: ... -def reconnecting_engine(url: Incomplete | None = ..., options: Incomplete | None = ...): ... +def reconnecting_engine(url: Incomplete | None = None, options: Incomplete | None = None): ... @overload def testing_engine( # type: ignore[misc] - url: URL | str | None = ..., - options: Mapping[str, Any] | None = ..., - future: bool | None = ..., - asyncio: Literal[False] = ..., - transfer_staticpool: bool = ..., + url: URL | str | None = None, + options: Mapping[str, Any] | None = None, + future: bool | None = None, + asyncio: Literal[False] = False, + transfer_staticpool: bool = False, ) -> Engine: ... @overload def testing_engine( - url: URL | str | None = ..., - options: Mapping[str, Any] | None = ..., - future: bool | None = ..., - asyncio: Literal[True] = ..., - transfer_staticpool: bool = ..., + url: URL | str | None = None, + options: Mapping[str, Any] | None = None, + future: bool | None = None, + asyncio: Literal[True] = True, + transfer_staticpool: bool = False, ) -> AsyncEngine: ... -def mock_engine(dialect_name: Incomplete | None = ...): ... +def mock_engine(dialect_name: Incomplete | None = None): ... class DBAPIProxyCursor: engine: Any connection: Any cursor: Any def __init__(self, engine, conn, *args, **kwargs) -> None: ... - def execute(self, stmt, parameters: Incomplete | None = ..., **kw): ... + def execute(self, stmt, parameters: Incomplete | None = None, **kw): ... def executemany(self, stmt, params, **kw): ... def __iter__(self): ... def __getattr__(self, key: str): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi index 7041a0266bc8..f9956ef44058 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete from typing import Any -def skip_if(predicate, reason: Incomplete | None = ...): ... -def fails_if(predicate, reason: Incomplete | None = ...): ... +def skip_if(predicate, reason: Incomplete | None = None): ... +def fails_if(predicate, reason: Incomplete | None = None): ... class compound: fails: Any @@ -22,17 +22,17 @@ class compound: def requires_tag(tagname): ... def tags(tagnames): ... -def only_if(predicate, reason: Incomplete | None = ...): ... -def succeeds_if(predicate, reason: Incomplete | None = ...): ... +def only_if(predicate, reason: Incomplete | None = None): ... +def succeeds_if(predicate, reason: Incomplete | None = None): ... class Predicate: @classmethod - def as_predicate(cls, predicate, description: Incomplete | None = ...): ... + def as_predicate(cls, predicate, description: Incomplete | None = None): ... class BooleanPredicate(Predicate): value: Any description: Any - def __init__(self, value, description: Incomplete | None = ...) -> None: ... + def __init__(self, value, description: Incomplete | None = None) -> None: ... def __call__(self, config): ... class SpecPredicate(Predicate): @@ -41,7 +41,7 @@ class SpecPredicate(Predicate): spec: Any description: Any def __init__( - self, db, op: Incomplete | None = ..., spec: Incomplete | None = ..., description: Incomplete | None = ... + self, db, op: Incomplete | None = None, spec: Incomplete | None = None, description: Incomplete | None = None ) -> None: ... def __call__(self, config): ... @@ -51,30 +51,30 @@ class LambdaPredicate(Predicate): kw: Any description: Any def __init__( - self, lambda_, description: Incomplete | None = ..., args: Incomplete | None = ..., kw: Incomplete | None = ... + self, lambda_, description: Incomplete | None = None, args: Incomplete | None = None, kw: Incomplete | None = None ): ... def __call__(self, config): ... class NotPredicate(Predicate): predicate: Any description: Any - def __init__(self, predicate, description: Incomplete | None = ...) -> None: ... + def __init__(self, predicate, description: Incomplete | None = None) -> None: ... def __call__(self, config): ... class OrPredicate(Predicate): predicates: Any description: Any - def __init__(self, predicates, description: Incomplete | None = ...) -> None: ... + def __init__(self, predicates, description: Incomplete | None = None) -> None: ... def __call__(self, config): ... def db_spec(*dbs): ... def open(): ... def closed(): ... -def fails(reason: Incomplete | None = ...): ... +def fails(reason: Incomplete | None = None): ... def future(fn, *arg): ... -def fails_on(db, reason: Incomplete | None = ...): ... +def fails_on(db, reason: Incomplete | None = None): ... def fails_on_everything_except(*dbs): ... -def skip(db, reason: Incomplete | None = ...): ... -def only_on(dbs, reason: Incomplete | None = ...): ... -def exclude(db, op, spec, reason: Incomplete | None = ...): ... +def skip(db, reason: Incomplete | None = None): ... +def only_on(dbs, reason: Incomplete | None = None): ... +def exclude(db, op, spec, reason: Incomplete | None = None): ... def against(config, *queries): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi index 5d3f8927da9f..c2aa3d0d0525 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi @@ -9,7 +9,7 @@ class ProfileStatsFile: data: Any dump: Any sort: Any - def __init__(self, filename, sort: str = ..., dump: Incomplete | None = ...): ... + def __init__(self, filename, sort: str = "cumulative", dump: Incomplete | None = None): ... @property def platform_key(self): ... def has_stats(self): ... @@ -17,5 +17,5 @@ class ProfileStatsFile: def reset_count(self) -> None: ... def replace(self, callcount) -> None: ... -def function_call_count(variance: float = ..., times: int = ..., warmup: int = ...): ... -def count_functions(variance: float = ...) -> None: ... +def function_call_count(variance: float = 0.05, times: int = 1, warmup: int = 0): ... +def count_functions(variance: float = 0.05) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi index 0da8a3883e94..907653ac540f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi @@ -2,10 +2,10 @@ from _typeshed import Incomplete from typing import Any def non_refcount_gc_collect(*args) -> None: ... # only present on Python implementations with non-refcount gc -def gc_collect(generation: int = ...) -> None: ... +def gc_collect(generation: int = 2) -> None: ... def lazy_gc() -> None: ... def picklers(): ... -def random_choices(population, k: int = ...): ... +def random_choices(population, k: int = 1): ... def round_decimal(value, prec): ... class RandomSet(set[Any]): @@ -26,7 +26,7 @@ def provide_metadata(fn, *args, **kw): ... def flag_combinations(*combinations): ... def lambda_combinations(lambda_arg_sets, **kw): ... def resolve_lambda(__fn, **kw): ... -def metadata_fixture(ddl: str = ...): ... +def metadata_fixture(ddl: str = "function"): ... def force_drop_names(*names): ... class adict(dict[Any, Any]): @@ -35,5 +35,5 @@ class adict(dict[Any, Any]): get_all: Any def drop_all_tables_from_metadata(metadata, engine_or_connection) -> None: ... -def drop_all_tables(engine, inspector, schema: Incomplete | None = ..., include_names: Incomplete | None = ...) -> None: ... +def drop_all_tables(engine, inspector, schema: Incomplete | None = None, include_names: Incomplete | None = None) -> None: ... def teardown_events(event_cls): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi index 9aa4255ceaf6..7c72efd57763 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi @@ -4,4 +4,4 @@ class SATestSuiteWarning(sa_exc.SAWarning): ... def warn_test_suite(message) -> None: ... def setup_filters() -> None: ... -def assert_warnings(fn, warning_msgs, regex: bool = ...): ... +def assert_warnings(fn, warning_msgs, regex: bool = False): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index 20f5cf724e21..7fde0fc12e9c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -68,11 +68,11 @@ class ImmutableProperties(ImmutableContainer, Properties[_T], Generic[_T]): ... OrderedDict = dict -def sort_dictionary(d, key: Incomplete | None = ...): ... +def sort_dictionary(d, key: Incomplete | None = None): ... class OrderedSet(set[_T], Generic[_T]): @overload - def __init__(self, d: None = ...) -> None: ... + def __init__(self, d: None = None) -> None: ... @overload def __init__(self, d: Iterable[_T]) -> None: ... def add(self, element: _T) -> None: ... @@ -101,7 +101,7 @@ class OrderedSet(set[_T], Generic[_T]): __isub__ = difference_update # type: ignore[assignment] class IdentitySet: - def __init__(self, iterable: Incomplete | None = ...) -> None: ... + def __init__(self, iterable: Incomplete | None = None) -> None: ... def add(self, value) -> None: ... def __contains__(self, value): ... def remove(self, value) -> None: ... @@ -140,14 +140,14 @@ class IdentitySet: def __hash__(self) -> int: ... class WeakSequence: - def __init__(self, _WeakSequence__elements: Iterable[Incomplete] = ...) -> None: ... + def __init__(self, _WeakSequence__elements: Iterable[Incomplete] = ()) -> None: ... def append(self, item) -> None: ... def __len__(self) -> int: ... def __iter__(self): ... def __getitem__(self, index): ... class OrderedIdentitySet(IdentitySet): - def __init__(self, iterable: Incomplete | None = ...) -> None: ... + def __init__(self, iterable: Incomplete | None = None) -> None: ... class PopulateDict(dict[Any, Any]): creator: Any @@ -168,28 +168,28 @@ column_dict = dict # or pyright complains ordered_column_set = OrderedSet[_T] # noqa: Y026 -def unique_list(seq: Iterable[_T], hashfunc: Callable[[_T], Any] | None = ...) -> list[_T]: ... +def unique_list(seq: Iterable[_T], hashfunc: Callable[[_T], Any] | None = None) -> list[_T]: ... class UniqueAppender: data: Any - def __init__(self, data, via: Incomplete | None = ...) -> None: ... + def __init__(self, data, via: Incomplete | None = None) -> None: ... def append(self, item) -> None: ... def __iter__(self): ... def coerce_generator_arg(arg): ... -def to_list(x, default: Incomplete | None = ...): ... +def to_list(x, default: Incomplete | None = None): ... def has_intersection(set_, iterable): ... def to_set(x): ... def to_column_set(x): ... -def update_copy(d, _new: Incomplete | None = ..., **kw): ... +def update_copy(d, _new: Incomplete | None = None, **kw): ... def flatten_iterator(x) -> None: ... class LRUCache(dict[Any, Any]): capacity: Any threshold: Any size_alert: Any - def __init__(self, capacity: int = ..., threshold: float = ..., size_alert: Incomplete | None = ...) -> None: ... - def get(self, key, default: Incomplete | None = ...): ... + def __init__(self, capacity: int = 100, threshold: float = 0.5, size_alert: Incomplete | None = None) -> None: ... + def get(self, key, default: Incomplete | None = None): ... def __getitem__(self, key): ... def values(self): ... def setdefault(self, key, value): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi index 502245182610..4a8d24e50ee1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi @@ -8,7 +8,7 @@ from .langhelpers import memoized_property def is_exit_exception(e): ... def await_only(awaitable: Coroutine[Any, Any, Any]) -> Any: ... def await_fallback(awaitable: Coroutine[Any, Any, Any]) -> Any: ... -async def greenlet_spawn(fn: Callable[..., Any], *args, _require_await: bool = ..., **kwargs) -> Any: ... +async def greenlet_spawn(fn: Callable[..., Any], *args, _require_await: bool = False, **kwargs) -> Any: ... class AsyncAdaptedLock: @memoized_property diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi index eaabad39009d..f1e73ecf3a88 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi @@ -3,7 +3,7 @@ from typing import Any class _ModuleRegistry: module_registry: Any prefix: Any - def __init__(self, prefix: str = ...) -> None: ... + def __init__(self, prefix: str = "sqlalchemy.") -> None: ... def preload_module(self, *deps): ... def import_prefix(self, path) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi index 77dfab5c9664..02ce27adc2f5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi @@ -59,7 +59,7 @@ class FullArgSpec(NamedTuple): class nullcontext: enter_result: Any - def __init__(self, enter_result: Incomplete | None = ...) -> None: ... + def __init__(self, enter_result: Incomplete | None = None) -> None: ... def __enter__(self): ... def __exit__(self, *excinfo: Unused) -> None: ... @@ -86,18 +86,18 @@ def b64encode(x): ... def decode_backslashreplace(text, encoding): ... def cmp(a, b): ... def raise_( - exception, with_traceback: Incomplete | None = ..., replace_context: Incomplete | None = ..., from_: bool = ... + exception, with_traceback: Incomplete | None = None, replace_context: Incomplete | None = None, from_: bool = False ) -> None: ... def u(s): ... def ue(s): ... def inspect_formatargspec( args, - varargs: Incomplete | None = ..., - varkw: Incomplete | None = ..., - defaults: Incomplete | None = ..., - kwonlyargs=..., - kwonlydefaults=..., - annotations=..., + varargs: Incomplete | None = None, + varkw: Incomplete | None = None, + defaults: Incomplete | None = None, + kwonlyargs=(), + kwonlydefaults={}, + annotations={}, formatarg=..., formatvarargs=..., formatvarkw=..., @@ -107,6 +107,6 @@ def inspect_formatargspec( ): ... def dataclass_fields(cls): ... def local_dataclass_fields(cls): ... -def raise_from_cause(exception, exc_info: Incomplete | None = ...) -> None: ... -def reraise(tp, value, tb: Incomplete | None = ..., cause: Incomplete | None = ...) -> None: ... +def raise_from_cause(exception, exc_info: Incomplete | None = None) -> None: ... +def reraise(tp, value, tb: Incomplete | None = None, cause: Incomplete | None = None) -> None: ... def with_metaclass(meta, *bases, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi b/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi index ca733b24aff0..139b2b3ad029 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi @@ -8,18 +8,20 @@ from .langhelpers import ( SQLALCHEMY_WARN_20: bool -def warn_deprecated(msg, version, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... -def warn_deprecated_limited(msg, args, version, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... -def warn_deprecated_20(msg, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... -def deprecated_cls(version, message, constructor: str = ...): ... -def deprecated_20_cls(clsname, alternative: Incomplete | None = ..., constructor: str = ..., becomes_legacy: bool = ...): ... +def warn_deprecated(msg, version, stacklevel: int = 3, code: Incomplete | None = None) -> None: ... +def warn_deprecated_limited(msg, args, version, stacklevel: int = 3, code: Incomplete | None = None) -> None: ... +def warn_deprecated_20(msg, stacklevel: int = 3, code: Incomplete | None = None) -> None: ... +def deprecated_cls(version, message, constructor: str = "__init__"): ... +def deprecated_20_cls( + clsname, alternative: Incomplete | None = None, constructor: str = "__init__", becomes_legacy: bool = False +): ... def deprecated( version, - message: Incomplete | None = ..., - add_deprecation_to_docstring: bool = ..., - warning: Incomplete | None = ..., - enable_warnings: bool = ..., + message: Incomplete | None = None, + add_deprecation_to_docstring: bool = True, + warning: Incomplete | None = None, + enable_warnings: bool = True, ): ... def moved_20(message, **kw): ... -def deprecated_20(api_name, alternative: Incomplete | None = ..., becomes_legacy: bool = ..., **kw): ... +def deprecated_20(api_name, alternative: Incomplete | None = None, becomes_legacy: bool = False, **kw): ... def deprecated_params(**specs): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index 9391fb90829a..a1a933f9cdde 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -12,7 +12,7 @@ def md5_hex(x): ... class safe_reraise: warn_only: Any - def __init__(self, warn_only: bool = ...) -> None: ... + def __init__(self, warn_only: bool = False) -> None: ... def __enter__(self) -> None: ... def __exit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None @@ -25,34 +25,34 @@ def method_is_overridden(instance_or_cls, against_method): ... def decode_slice(slc): ... def map_bits(fn, n) -> None: ... def decorator(target): ... -def public_factory(target, location, class_location: Incomplete | None = ...): ... +def public_factory(target, location, class_location: Incomplete | None = None): ... class PluginLoader: group: Any impls: Any auto_fn: Any - def __init__(self, group, auto_fn: Incomplete | None = ...) -> None: ... + def __init__(self, group, auto_fn: Incomplete | None = None) -> None: ... def clear(self) -> None: ... def load(self, name): ... def register(self, name, modulepath, objname) -> None: ... -def get_cls_kwargs(cls, _set: Incomplete | None = ...): ... +def get_cls_kwargs(cls, _set: Incomplete | None = None): ... def get_func_kwargs(func): ... -def get_callable_argspec(fn, no_self: bool = ..., _is_init: bool = ...): ... -def format_argspec_plus(fn, grouped: bool = ...): ... -def format_argspec_init(method, grouped: bool = ...): ... +def get_callable_argspec(fn, no_self: bool = False, _is_init: bool = False): ... +def format_argspec_plus(fn, grouped: bool = True): ... +def format_argspec_init(method, grouped: bool = True): ... def create_proxy_methods( - target_cls, target_cls_sphinx_name, proxy_cls_sphinx_name, classmethods=..., methods=..., attributes=... + target_cls, target_cls_sphinx_name, proxy_cls_sphinx_name, classmethods=(), methods=(), attributes=() ): ... def getargspec_init(method): ... def unbound_method_to_callable(func_or_cls): ... -def generic_repr(obj, additional_kw=..., to_inspect: Incomplete | None = ..., omit_kwarg=...): ... +def generic_repr(obj, additional_kw=(), to_inspect: Incomplete | None = None, omit_kwarg=()): ... class portable_instancemethod: target: Any name: Any kwargs: Any - def __init__(self, meth, kwargs=...) -> None: ... + def __init__(self, meth, kwargs=()) -> None: ... def __call__(self, *arg, **kw): ... def class_hierarchy(cls): ... @@ -60,19 +60,19 @@ def iterate_attributes(cls) -> None: ... def monkeypatch_proxied_specials( into_cls, from_cls, - skip: Incomplete | None = ..., - only: Incomplete | None = ..., - name: str = ..., - from_instance: Incomplete | None = ..., + skip: Incomplete | None = None, + only: Incomplete | None = None, + name: str = "self.proxy", + from_instance: Incomplete | None = None, ) -> None: ... def methods_equivalent(meth1, meth2): ... -def as_interface(obj, cls: Incomplete | None = ..., methods: Incomplete | None = ..., required: Incomplete | None = ...): ... +def as_interface(obj, cls: Incomplete | None = None, methods: Incomplete | None = None, required: Incomplete | None = None): ... class memoized_property(Generic[_R]): fget: Callable[..., _R] __doc__: str __name__: str - def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... + def __init__(self, fget: Callable[..., _R], doc: str | None = None) -> None: ... @overload def __get__(self, obj: None, cls: Unused) -> Self: ... @overload @@ -87,7 +87,7 @@ class HasMemoized: fget: Callable[..., _R] __doc__: str __name__: str - def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... + def __init__(self, fget: Callable[..., _R], doc: str | None = None) -> None: ... @overload def __get__(self, obj: None, cls: Unused) -> Self: ... @overload @@ -102,11 +102,11 @@ class MemoizedSlots: def asbool(obj): ... def bool_or_str(*text): ... def asint(value): ... -def coerce_kw_type(kw, key, type_, flexi_bool: bool = ..., dest: Incomplete | None = ...) -> None: ... +def coerce_kw_type(kw, key, type_, flexi_bool: bool = True, dest: Incomplete | None = None) -> None: ... def constructor_key(obj, cls): ... def constructor_copy(obj, cls, *args, **kw): ... def counter(): ... -def duck_type_collection(specimen, default: Incomplete | None = ...): ... +def duck_type_collection(specimen, default: Incomplete | None = None): ... def assert_arg_type(arg, argtype, name): ... def dictlike_iteritems(dictlike): ... @@ -134,28 +134,28 @@ class hybridmethod: class _symbol(int): def __new__( # noqa: Y034 # Excplicitely instanciates _symbol - self, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ... + self, name, doc: Incomplete | None = None, canonical: Incomplete | None = None ) -> _symbol: ... def __reduce__(self): ... class symbol: symbols: Any def __new__( # type: ignore[misc] # Excplicitely instanciates _symbol - cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ... + cls, name, doc: Incomplete | None = None, canonical: Incomplete | None = None ) -> _symbol: ... @classmethod - def parse_user_argument(cls, arg, choices, name, resolve_symbol_names: bool = ...): ... + def parse_user_argument(cls, arg, choices, name, resolve_symbol_names: bool = False): ... def set_creation_order(instance) -> None: ... def warn_exception(func, *args, **kwargs): ... -def ellipses_string(value, len_: int = ...): ... +def ellipses_string(value, len_: int = 25): ... class _hash_limit_string(compat.text_type): def __new__(cls, value, num, args): ... def __hash__(self) -> int: ... def __eq__(self, other): ... -def warn(msg, code: Incomplete | None = ...) -> None: ... +def warn(msg, code: Incomplete | None = None) -> None: ... def warn_limited(msg, args) -> None: ... def only_once(fn, retry_on_exception): ... def chop_traceback(tb, exclude_prefix=..., exclude_suffix=...): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi b/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi index 7a26c25d72c7..852018369726 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi @@ -9,27 +9,27 @@ class Queue: not_empty: Any not_full: Any use_lifo: Any - def __init__(self, maxsize: int = ..., use_lifo: bool = ...) -> None: ... + def __init__(self, maxsize: int = 0, use_lifo: bool = False) -> None: ... def qsize(self): ... def empty(self): ... def full(self): ... - def put(self, item, block: bool = ..., timeout: Incomplete | None = ...) -> None: ... + def put(self, item, block: bool = True, timeout: Incomplete | None = None) -> None: ... def put_nowait(self, item): ... - def get(self, block: bool = ..., timeout: Incomplete | None = ...): ... + def get(self, block: bool = True, timeout: Incomplete | None = None): ... def get_nowait(self): ... class AsyncAdaptedQueue: await_: Any use_lifo: Any maxsize: Any - def __init__(self, maxsize: int = ..., use_lifo: bool = ...) -> None: ... + def __init__(self, maxsize: int = 0, use_lifo: bool = False) -> None: ... def empty(self): ... def full(self): ... def qsize(self): ... def put_nowait(self, item): ... - def put(self, item, block: bool = ..., timeout: Incomplete | None = ...): ... + def put(self, item, block: bool = True, timeout: Incomplete | None = None): ... def get_nowait(self): ... - def get(self, block: bool = ..., timeout: Incomplete | None = ...): ... + def get(self, block: bool = True, timeout: Incomplete | None = None): ... class FallbackAsyncAdaptedQueue(AsyncAdaptedQueue): await_: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi b/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi index 04428e1ba790..7f54e1a0574c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi @@ -1,3 +1,3 @@ def sort_as_subsets(tuples, allitems) -> None: ... -def sort(tuples, allitems, deterministic_order: bool = ...) -> None: ... +def sort(tuples, allitems, deterministic_order: bool = True) -> None: ... def find_cycles(tuples, allitems): ... From 55b20edac38c58efbe7d7d7e2b840c979b75384e Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 14 Apr 2023 17:41:45 -0400 Subject: [PATCH 18/19] Apply suggestions from code review Co-authored-by: Jelle Zijlstra --- stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index a1a933f9cdde..5d85655e3786 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -133,14 +133,14 @@ class hybridmethod: def classlevel(self, func): ... class _symbol(int): - def __new__( # noqa: Y034 # Excplicitely instanciates _symbol + def __new__( # noqa: Y034 # Excplicitly instantiates _symbol self, name, doc: Incomplete | None = None, canonical: Incomplete | None = None ) -> _symbol: ... def __reduce__(self): ... class symbol: symbols: Any - def __new__( # type: ignore[misc] # Excplicitely instanciates _symbol + def __new__( # type: ignore[misc] # Explicitly instantiates _symbol cls, name, doc: Incomplete | None = None, canonical: Incomplete | None = None ) -> _symbol: ... @classmethod From f182bbb1dbfca4ed96efb25f8f701bd01f12870c Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 14 Apr 2023 23:21:43 +0100 Subject: [PATCH 19/19] 'Nother typo --- stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index 5d85655e3786..a18aa1a09aa1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -133,7 +133,7 @@ class hybridmethod: def classlevel(self, func): ... class _symbol(int): - def __new__( # noqa: Y034 # Excplicitly instantiates _symbol + def __new__( # noqa: Y034 # Explicitly instantiates _symbol self, name, doc: Incomplete | None = None, canonical: Incomplete | None = None ) -> _symbol: ... def __reduce__(self): ...