dssg / triage

General Purpose Risk Modeling and Prediction Toolkit for Policy and Social Good Problems
Other
182 stars 61 forks source link

Scheduled monthly dependency update for May #847

Closed pyup-bot closed 3 years ago

pyup-bot commented 3 years ago

Update pymdown-extensions from 7.1 to 8.1.1.

Changelog ### 8.1.1 ``` - **FIX**: Ensure content immediately before Details content or Tabbed content gets preserved. - **FIX**: StripHTML: Fix some corner cases related to stripping comments. ``` ### 8.1 ``` - **NEW**: Drop support for Python 3.5. - **NEW**: Officially support Python 3.9. - **NEW**: Tabbed titles can now have simple Markdown in them which can be parsed and rendered (like emoji, bold, etc.). - **FIX**: Avoid parsing script tags in PathConverter and B64 extensions. ``` ### 8.0.1 ``` - **FIX**: Fix issue with `pymdownx-inline` an Pygments 2.7+. ``` ### 8.0 ``` Please see [Release Notes](./releases/8.0.md8.0) for details on upgrading to 8.0. - **NEW**: Added SaneHeaders extension. - **NEW**: SuperFences \& InlineHilite: gracefully handle failing custom formatters and/or validators. Users should add their own debug code to their formatter/validator if they suspect it isn't working. - **NEW**: SuperFences: if a custom fence validator fails, try the next custom fence until all are exhausted. - **NEW**: SuperFences: no longer allow custom options in the form `key=` (no value). Only keys with values or keys with no value and no `=` are accepted. Keys with no value will now assume the value to be the key name. - **NEW**: SuperFences: if `attr_list` extension is enabled, fenced code that use brace attribute list style headers (` {lang id .class attr=value}`) will attach arbitrary attributes that are included in the header to the code element. - **NEW**: SuperFences: when Pygments is disabled, options (such as `linenums`) included in fenced code headers no longer do anything. If `attr_list` is enabled, and the brace header is used, such options will be treated as HTML attributes. JavaScript highlighter options should be defined in the brace header form with `attr_list` enabled in order to generate appropriate, compatible HTML with the chosen JavaScript highlighter. - **NEW**: SuperFences: backwards incompatible changes where made to custom fence API. See [Release Notes](./releases/8.0.md8.0) for instructions on how to migrate to the new API. Some temporary support for most of the old format is in place, but is deprecated. - **NEW**: SuperFences: has removed legacy code tab feature. Associated `legacy_tab_classes` option has been removed. Please use the Tabbed extension to create general purpose tabs for code blocks or other content. - **NEW**: Highlight: add new option `language_prefix` which controls the prefix applied to language classes when Pygments is not being used. - **NEW**: Highlight: A new option called `code_attr_on_pre` was added to the Highlight extension and controls whether language classes, and any ids, attributes, and classes that are defined in fenced code attribute list style headers, are attached to the code element or pre element. This has effect when using Pygments. - **NEW**: Highlight: option `linenums` now defaults to `None` and accepts `None`, `True`, or `False`. `None` is disabled by default, but can be enabled per code block. `True` enables line numbers globally. `False` disables globally and cannot be enabled manually per code block. - **NEW**: ExtraRawHTML: remove extension. - **FIX**: Fix issues with complex emphasis combinations in BetterEm. - **FIX**: Details: fix corner cases related to extension and lists. - **FIX**: Tabbed: fix corner cases related to extension and lists. - **FIX**: EscapeAll: Handle HTML entities special. - **FIX**: SuperFences: Fix parameter unpacking bug. ```
Links - PyPI: https://pypi.org/project/pymdown-extensions - Changelog: https://pyup.io/changelogs/pymdown-extensions/ - Repo: https://github.com/facelessuser/pymdown-extensions

Update mkdocs-material from 7.0.6 to 7.1.3.

Changelog ### 7.1.3 ``` * Fixed 2586: Empty table of contents shown (7.1.2 regression) ``` ### 7.1.2 ``` * Fixed 2554: List markers sometimes overlap floated elements * Fixed 2563: Adding a class to a h1 breaks the table of contents * Fixed 2566: Back-to-top button clickable when invisible mkdocs-material-7.1.1+insiders-2.6.0 (2021-04-11) * Stay on page when switching versions ``` ### 7.1.1 ``` * Fixed 2501: Nested definition lists compound bottom margin * Fixed 2508: Switch extracopyright block to template variable * Fixed 2533: Search (and other parts) not working in Safari <14 * Fixed 2538: Visual quirk when opening language selector ``` ### 7.1.0 ``` * Added support for color palette toggle * Added support for back-to-top button * Added latest release to repository info (GitHub) * Slight facelift of repository info (lighter fonts, spacing and icons) mkdocs-material-7.0.7+insiders-2.5.0 (2021-03-28) * Added support for version warning ``` ### 7.0.7 ``` * Updated Hungarian translations * Fixed 2466: Docker image not based on latest Python and Alpine * Fixed 2488: Inconsistent header shadow behavior * Fixed 2492: Inline code blocks in admonition titles missing background mkdocs-material-7.0.6+insiders-2.4.0 (2021-03-20) * Added support for custom admonition icons * Fixed 2444: Code block annotations with extra comments have wrong index mkdocs-material-7.0.6+insiders-2.3.1 (2021-03-14) * Fixed anchor offset for permalinks when using sticky navigation tabs ```
Links - PyPI: https://pypi.org/project/mkdocs-material - Changelog: https://pyup.io/changelogs/mkdocs-material/ - Repo: https://squidfunk.github.io/mkdocs-material/

Update mkdocstrings from 0.12.0 to 0.15.0.

The bot wasn't able to find a changelog for this release. Got an idea?

Links - PyPI: https://pypi.org/project/mkdocstrings - Repo: https://github.com/mkdocstrings/mkdocstrings

Update black from 19.10b0 to 21.4b2.

Changelog ### 21.4b2 ``` _Black_ - Fix crash if the user configuration directory is inaccessible. (2158) - Clarify [circumstances](https://github.com/psf/black/blob/master/docs/the_black_code_style.md#pragmatism) in which _Black_ may change the AST (2159) _Packaging_ - Install `primer.json` (used by `black-primer` by default) with black. (2154) ``` ### 21.4b1 ``` _Black_ - Fix crash on docstrings ending with "\ ". (2142) - Fix crash when atypical whitespace is cleaned out of dostrings (2120) - Reflect the `--skip-magic-trailing-comma` and `--experimental-string-processing` flags in the name of the cache file. Without this fix, changes in these flags would not take effect if the cache had already been populated. (2131) - Don't remove necessary parentheses from assignment expression containing assert / return statements. (2143) _Packaging_ - Bump pathspec to >= 0.8.1 to solve invalid .gitignore exclusion handling ``` ### 21.4b0 ``` _Black_ - Fixed a rare but annoying formatting instability created by the combination of optional trailing commas inserted by `Black` and optional parentheses looking at pre-existing "magic" trailing commas. This fixes issue 1629 and all of its many many duplicates. (2126) - `Black` now processes one-line docstrings by stripping leading and trailing spaces, and adding a padding space when needed to break up """". (1740) - `Black` now cleans up leading non-breaking spaces in comments (2092) - `Black` now respects `--skip-string-normalization` when normalizing multiline docstring quotes (1637) - `Black` no longer removes all empty lines between non-function code and decorators when formatting typing stubs. Now `Black` enforces a single empty line. (1646) - `Black` no longer adds an incorrect space after a parenthesized assignment expression in if/while statements (1655) - Added `--skip-magic-trailing-comma` / `-C` to avoid using trailing commas as a reason to split lines (1824) - fixed a crash when PWD=/ on POSIX (1631) - fixed "I/O operation on closed file" when using --diff (1664) - Prevent coloured diff output being interleaved with multiple files (1673) - Added support for PEP 614 relaxed decorator syntax on python 3.9 (1711) - Added parsing support for unparenthesized tuples and yield expressions in annotated assignments (1835) - added `--extend-exclude` argument (PR 2005) - speed up caching by avoiding pathlib (1950) - `--diff` correctly indicates when a file doesn't end in a newline (1662) - Added `--stdin-filename` argument to allow stdin to respect `--force-exclude` rules (1780) - Lines ending with `fmt: skip` will now be not formatted (1800) - PR 2053: Black no longer relies on typed-ast for Python 3.8 and higher - PR 2053: Python 2 support is now optional, install with `python3 -m pip install black[python2]` to maintain support. - Exclude `venv` directory by default (1683) - Fixed "Black produced code that is not equivalent to the source" when formatting Python 2 docstrings (2037) _Packaging_ - Self-contained native _Black_ binaries are now provided for releases via GitHub Releases (1743) ``` ### 20.8b1 ``` _Packaging_ - explicitly depend on Click 7.1.2 or newer as `Black` no longer works with versions older than 7.0 ``` ### 20.8b0 ``` _Black_ - re-implemented support for explicit trailing commas: now it works consistently within any bracket pair, including nested structures (1288 and duplicates) - `Black` now reindents docstrings when reindenting code around it (1053) - `Black` now shows colored diffs (1266) - `Black` is now packaged using 'py3' tagged wheels (1388) - `Black` now supports Python 3.8 code, e.g. star expressions in return statements (1121) - `Black` no longer normalizes capital R-string prefixes as those have a community-accepted meaning (1244) - `Black` now uses exit code 2 when specified configuration file doesn't exit (1361) - `Black` now works on AWS Lambda (1141) - added `--force-exclude` argument (1032) - removed deprecated `--py36` option (1236) - fixed `--diff` output when EOF is encountered (526) - fixed ` fmt: off` handling around decorators (560) - fixed unstable formatting with some ` type: ignore` comments (1113) - fixed invalid removal on organizing brackets followed by indexing (1575) - introduced `black-primer`, a CI tool that allows us to run regression tests against existing open source users of Black (1402) - introduced property-based fuzzing to our test suite based on Hypothesis and Hypothersmith (1566) - implemented experimental and disabled by default long string rewrapping (1132), hidden under a `--experimental-string-processing` flag while it's being worked on; this is an undocumented and unsupported feature, you lose Internet points for depending on it (1609) Vim plugin - prefer virtualenv packages over global packages (1383) ```
Links - PyPI: https://pypi.org/project/black - Changelog: https://pyup.io/changelogs/black/ - Repo: https://github.com/psf/black

Update wheel from 0.34.2 to 0.36.2.

Changelog ### 0.36.2 ``` - Updated vendored ``packaging`` library to v20.8 - Fixed wheel sdist missing ``LICENSE.txt`` - Don't use default ``macos/arm64`` deployment target in calculating the platform tag for fat binaries (PR by Ronald Oussoren) ``` ### 0.36.1 ``` - Fixed ``AssertionError`` when ``MACOSX_DEPLOYMENT_TARGET`` was set to ``11`` (PR by Grzegorz Bokota and François-Xavier Coudert) - Fixed regression introduced in 0.36.0 on Python 2.7 when a custom generator name was passed as unicode (Scikit-build) (``TypeError: 'unicode' does not have the buffer interface``) ``` ### 0.36.0 ``` - Added official Python 3.9 support - Updated vendored ``packaging`` library to v20.7 - Switched to always using LF as line separator when generating ``WHEEL`` files (on Windows, CRLF was being used instead) - The ABI tag is taken from the sysconfig SOABI value. On PyPy the SOABI value is ``pypy37-pp73`` which is not compliant with PEP 3149, as it should have both the API tag and the platform tag. This change future-proofs any change in PyPy's SOABI tag to make sure only the ABI tag is used by wheel. - Fixed regression and test for ``bdist_wheel --plat-name``. It was ignored for C extensions in v0.35, but the regression was not detected by tests. ``` ### 0.35.1 ``` - Replaced install dependency on ``packaging`` with a vendored copy of its ``tags`` module - Fixed ``bdist_wheel`` not working on FreeBSD due to mismatching platform tag name (it was not being converted to lowercase) ``` ### 0.35.0 ``` - Switched to the packaging_ library for computing wheel tags - Fixed a resource leak in ``WheelFile.open()`` (PR by Jon Dufresne) .. _packaging: https://pypi.org/project/packaging/ ```
Links - PyPI: https://pypi.org/project/wheel - Changelog: https://pyup.io/changelogs/wheel/ - Repo: https://github.com/pypa/wheel

Update alembic from 1.4.2 to 1.5.8.

Changelog ### 1.5.8 ``` :released: March 23, 2021 .. change:: :tags: bug, environment :tickets: 816 Fixed regression caused by SQLAlchemy 1.4 where the "alembic current" command would fail due to changes in the ``URL`` object. .. changelog:: ``` ### 1.5.7 ``` :released: March 11, 2021 .. change:: :tags: bug, autogenerate :tickets: 813 Adjusted the recently added :paramref:`.EnvironmentContext.configure.include_name` hook to accommodate for additional object types such as "views" that don't have a parent table, to support third party recipes and extensions. Pull request courtesy Oliver Rice. .. changelog:: ``` ### 1.5.6 ``` :released: March 5, 2021 .. change:: :tags: bug, mssql, operations :tickets: 812 Fixed bug where the "existing_type" parameter, which the MSSQL dialect requires in order to change the nullability of a column in the absence of also changing the column type, would cause an ALTER COLUMN operation to incorrectly render a second ALTER statement without the nullability if a new type were also present, as the MSSQL-specific contract did not anticipate all three of "nullability", "type_" and "existing_type" being sent at the same time. .. change:: :tags: template :ticket: 805 Add async template to Alembic to bootstrap environments that use async DBAPI. Updated the cookbook to include a migration guide on how to adapt an existing enviroment for use with DBAPI drivers. .. changelog:: ``` ### 1.5.5 ``` :released: February 20, 2021 .. change:: :tags: bug Adjusted the use of SQLAlchemy's ".copy()" internals to use "._copy()" for version 1.4.0, as this method is being renamed. .. change:: :tags: bug, environment :tickets: 797 Added new config file option ``prepend_sys_path``, which is a series of paths that will be prepended to sys.path; the default value in newly generated alembic.ini files is ".". This fixes a long-standing issue where for some reason running the alembic command line would not place the local "." path in sys.path, meaning an application locally present in "." and importable through normal channels, e.g. python interpreter, pytest, etc. would not be located by Alembic, even though the ``env.py`` file is loaded relative to the current path when ``alembic.ini`` contains a relative path. To enable for existing installations, add the option to the alembic.ini file as follows:: sys.path path, will be prepended to sys.path if present. defaults to the current working directory. prepend_sys_path = . .. seealso:: :ref:`installation` - updated documentation reflecting that local installation of the project is not necessary if running the Alembic cli from the local path. .. changelog:: ``` ### 1.5.4 ``` :released: February 3, 2021 .. change:: :tags: bug, versioning :tickets: 789 Fixed bug in versioning model where a downgrade across a revision with a dependency on another branch, yet an ancestor is also dependent on that branch, would produce an erroneous state in the alembic_version table, making upgrades impossible without manually repairing the table. .. changelog:: ``` ### 1.5.3 ``` :released: January 29, 2021 .. change:: :tags: bug, autogenerate :tickets: 786 Changed the default ordering of "CREATE" and "DROP" statements indexes and unique constraints within the autogenerate process, so that for example in an upgrade() operation, a particular index or constraint that is to be replaced such as for a casing convention change will not produce any naming conflicts. For foreign key constraint objects, this is already how constraints are ordered, and for table objects, users would normally want to use :meth:`.Operations.rename_table` in any case. .. change:: :tags: bug, autogenerate, mssql :tickets: 787 Fixed assorted autogenerate issues with SQL Server: * ignore default reflected identity on primary_key columns * improve server default comparison .. change:: :tags: bug, mysql, autogenerate :tickets: 788 Fixed issue where autogenerate rendering of ``op.alter_column()`` would fail to include MySQL ``existing_nullable=False`` if the column were part of a primary key constraint within the table metadata. .. changelog:: ``` ### 1.5.2 ``` :released: January 20, 2021 .. change:: :tags: bug, versioning, regression :tickets: 784 Fixed regression where new "loop detection" feature introduced in :ticket:`757` produced false positives for revision names that have overlapping substrings between revision number and down revision and/or dependency, if the downrev/dependency were not in sequence form. .. change:: :tags: bug, environment :tickets: 782 Fixed regression where Alembic would fail to create a transaction properly if the :class:`sqlalchemy.engine.Connection` were a so-called "branched" connection, that is, one where the ``.connect()`` method had been called to create a "sub" connection. .. changelog:: ``` ### 1.5.1 ``` :released: January 19, 2021 .. change:: :tags: bug, installation, commands :tickets: 780 Fixed installation issue where the "templates" directory was not being installed, preventing commands like "list_templates" and "init" from working. .. changelog:: ``` ### 1.5.0 ``` :released: January 18, 2021 .. change:: :tags: usecase, operations :tickets: 730 Added support for rendering of "identity" elements on :class:`.Column` objects, supported in SQLAlchemy via the :class:`.Identity` element introduced in version 1.4. Adding columns with identity is supported on PostgreSQL, MSSQL and Oracle. Changing the identity options or removing it is supported only on PostgreSQL and Oracle. .. change:: :tags: changed, environment To accommodate SQLAlchemy 1.4 and 2.0, the migration model now no longer assumes that the SQLAlchemy Connection will autocommit an individual operation. This essentially means that for databases that use non-transactional DDL (pysqlite current driver behavior, MySQL), there is still a BEGIN/COMMIT block that will surround each individual migration. Databases that support transactional DDL should continue to have the same flow, either per migration or per-entire run, depending on the value of the :paramref:`.Environment.configure.transaction_per_migration` flag. .. change:: :tags: changed, environment A :class:`.CommandError` is raised if a ``sqlalchemy.engine.Engine`` is passed to the :meth:`.MigrationContext.configure` method instead of a ``sqlalchemy.engine.Connection`` object. Previously, this would be a warning only. .. change:: :tags: bug, operations :tickets: 753 Modified the ``add_column()`` operation such that the ``Column`` object in use is shallow copied to a new instance if that ``Column`` is already attached to a ``table()`` or ``Table``. This accommodates for the change made in SQLAlchemy issue 5618 which prohibits a ``Column`` from being associated with multiple ``table()`` objects. This resumes support for using a ``Column`` inside of an Alembic operation that already refers to a parent ``table()`` or ``Table`` as well as allows operation objects just autogenerated to work. .. change:: :tags: feature, autogenerate :tickets: 650 Added new hook :paramref:`.EnvironmentContext.configure.include_name`, which complements the :paramref:`.EnvironmentContext.configure.include_object` hook by providing a means of preventing objects of a certain name from being autogenerated **before** the SQLAlchemy reflection process takes place, and notably includes explicit support for passing each schema name when :paramref:`.EnvironmentContext.configure.include_schemas` is set to True. This is most important especially for enviroments that make use of :paramref:`.EnvironmentContext.configure.include_schemas` where schemas are actually databases (e.g. MySQL) in order to prevent reflection sweeps of the entire server. .. seealso:: :ref:`autogenerate_include_hooks` - new documentation section .. change:: :tags: removed, autogenerate The long deprecated :paramref:`.EnvironmentContext.configure.include_symbol` hook is removed. The :paramref:`.EnvironmentContext.configure.include_object` and :paramref:`.EnvironmentContext.configure.include_name` hooks both achieve the goals of this hook. .. change:: :tags: bug, autogenerate :tickets: 721 Added rendering for the ``Table.prefixes`` element to autogenerate so that the rendered Python code includes these directives. Pull request courtesy Rodrigo Ce Moretto. .. change:: :tags: bug, batch :tickets: 761 Added missing "create comment" feature for columns that are altered in batch migrations. .. change:: :tags: changed :tickets: 748 Alembic 1.5.0 now supports **Python 2.7 and Python 3.6 and above**, as well as **SQLAlchemy 1.3.0 and above**. Support is removed for Python 3 versions prior to 3.6 and SQLAlchemy versions prior to the 1.3 series. .. change:: :tags: bug, batch :tickets: 773 Made an adjustment to the PostgreSQL dialect to allow it to work more effectively in batch mode, where a datatype like Boolean or non-native Enum that may have embedded rules to generate CHECK constraints will be more correctly handled in that these constraints usually will not have been generated on the PostgreSQL backend; previously it would inadvertently assume they existed unconditionally in a special PG-only "drop constraint" step. .. change:: :tags: feature, versioning :tickets: 757 The revision tree is now checked for cycles and loops between revision files when the revision environment is loaded up. Scenarios such as a revision pointing to itself, or a revision that can reach itself via a loop, are handled and will raise the :class:`.CycleDetected` exception when the environment is loaded (expressed from the Alembic commandline as a failure message and nonzero return code). Previously, these situations were silently ignored up front, and the behavior of revision traversal would either be silently incorrect, or would produce errors such as :class:`.RangeNotAncestorError`. Pull request courtesy Koichiro Den. .. change:: :tags: usecase, commands Add ``__main__.py`` file to alembic package to support invocation with ``python -m alembic``. .. change:: :tags: removed, commands Removed deprecated ``--head_only`` option to the ``alembic current`` command .. change:: :tags: removed, operations Removed legacy parameter names from operations, these have been emitting warnings since version 0.8. In the case that legacy version files have not yet been updated, these can be modified directly in order to maintain compatibility: * :meth:`.Operations.drop_constraint` - "type" (use "type_") and "name" (use "constraint_name") * :meth:`.Operations.create_primary_key` - "cols" (use "columns") and "name" (use "constraint_name") * :meth:`.Operations.create_unique_constraint` - "name" (use "constraint_name"), "source" (use "table_name") and "local_cols" (use "columns") * :meth:`.Operations.batch_create_unique_constraint` - "name" (use "constraint_name") * :meth:`.Operations.create_foreign_key` - "name" (use "constraint_name"), "source" (use "source_table"), "referent" (use "referent_table") * :meth:`.Operations.batch_create_foreign_key` - "name" (use "constraint_name"), "referent" (use "referent_table") * :meth:`.Operations.create_check_constraint` - "name" (use "constraint_name"), "source" (use "table_name") * :meth:`.Operations.batch_create_check_constraint` - "name" (use "constraint_name") * :meth:`.Operations.create_index` - "name" (use "index_name") * :meth:`.Operations.drop_index` - "name" (use "index_name"), "tablename" (use "table_name") * :meth:`.Operations.batch_drop_index` - "name" (use "index_name"), * :meth:`.Operations.create_table` - "name" (use "table_name") * :meth:`.Operations.drop_table` - "name" (use "table_name") * :meth:`.Operations.alter_column` - "name" (use "new_column_name") .. changelog:: ``` ### 1.4.3 ``` :released: September 11, 2020 .. change:: :tags: bug, sqlite, batch :tickets: 711 Added support to drop named CHECK constraints that are specified as part of a column, rather than table wide. Previously, only constraints associated with the table were considered. .. change:: :tags: bug, ops, mysql :tickets: 736 Fixed issue where the MySQL dialect would not correctly render the server default of a column in an alter operation, if the operation were programmatically generated from an autogenerate pass as it would not accommodate for the full structure of the DefaultClause construct. .. change:: :tags: bug, sqlite, batch :tickets: 697 Fixed issue where the CAST applied to a JSON column when copying a SQLite table during batch mode would cause the data to be lost, as SQLite's CAST with JSON appears to convert the data to the value "0". The CAST is now skipped in a dialect-specific manner, including for JSON columns on SQLite. Pull request courtesy Sebastián Ramírez. .. change:: :tags: bug, commands :tickets: 694 The ``alembic current`` command no longer creates an ``alembic_version`` table in the database if one does not exist already, returning no version as the current version. This allows checking for migrations in parallel without introducing race conditions. Pull request courtesy Nikolay Edigaryev. .. change:: :tags: bug, batch Fixed issue where columns in a foreign-key referenced table would be replaced with null-type columns during a batch operation; while this did not generally have any side effects, it could theoretically impact a batch operation that also targets that table directly and also would interfere with future changes to the ``.append_column()`` method to disallow implicit replacement of columns. .. change:: :tags: bug, mssql :tickets: 716 Fixed issue where the ``mssql_drop_foreign_key=True`` flag on ``op.drop_column`` would lead to incorrect syntax error due to a typo in the SQL emitted, same typo was present in the test as well so it was not detected. Pull request courtesy Oleg Shigorin. .. changelog:: ```
Links - PyPI: https://pypi.org/project/alembic - Changelog: https://pyup.io/changelogs/alembic/ - Homepage: https://alembic.sqlalchemy.org - Docs: https://pythonhosted.org/alembic/

Update SQLAlchemy from 1.3.18 to 1.4.12.

Changelog ### 1.4.12 ``` :released: April 29, 2021 .. change:: :tags: bug, orm, regression, caching :tickets: 6391 Fixed critical regression where bound parameter tracking as used in the SQL caching system could fail to track all parameters for the case where the same SQL expression containing a parameter were used in an ORM-related query using a feature such as class inheritance, which was then embedded in an enclosing expression which would make use of that same expression multiple times, such as a UNION. The ORM would individually copy the individual SELECT statements as part of compilation with class inheritance, which then embedded in the enclosing statement would fail to accommodate for all parameters. The logic that tracks this condition has been adjusted to work for multiple copies of a parameter. .. change:: :tags: bug, sql :tickets: 6258 6397 Revised the "EMPTY IN" expression to no longer rely upon using a subquery, as this was causing some compatibility and performance problems. The new approach for selected databases takes advantage of using a NULL-returning IN expression combined with the usual "1 != 1" or "1 = 1" expression appended by AND or OR. The expression is now the default for all backends other than SQLite, which still had some compatibility issues regarding tuple "IN" for older SQLite versions. Third party dialects can still override how the "empty set" expression renders by implementing a new compiler method ``def visit_empty_set_op_expr(self, type_, expand_op)``, which takes precedence over the existing ``def visit_empty_set_expr(self, element_types)`` which remains in place. .. change:: :tags: bug, orm :tickets: 6350 Fixed two distinct issues mostly affecting :class:`_hybrid.hybrid_property`, which would come into play under common mis-configuration scenarios that were silently ignored in 1.3, and now failed in 1.4, where the "expression" implementation would return a non :class:`_sql.ClauseElement` such as a boolean value. For both issues, 1.3's behavior was to silently ignore the mis-configuration and ultimately attempt to interpret the value as a SQL expression, which would lead to an incorrect query. * Fixed issue regarding interaction of the attribute system with hybrid_property, where if the ``__clause_element__()`` method of the attribute returned a non-:class:`_sql.ClauseElement` object, an internal ``AttributeError`` would lead the attribute to return the ``expression`` function on the hybrid_property itself, as the attribute error was against the name ``.expression`` which would invoke the ``__getattr__()`` method as a fallback. This now raises explicitly. In 1.3 the non-:class:`_sql.ClauseElement` was returned directly. * Fixed issue in SQL argument coercions system where passing the wrong kind of object to methods that expect column expressions would fail if the object were altogether not a SQLAlchemy object, such as a Python function, in cases where the object were not just coerced into a bound value. Again 1.3 did not have a comprehensive argument coercion system so this case would also pass silently. .. change:: :tags: bug, orm :tickets: 6378 Fixed issue where using a :class:`_sql.Select` as a subquery in an ORM context would modify the :class:`_sql.Select` in place to disable eagerloads on that object, which would then cause that same :class:`_sql.Select` to not eagerload if it were then re-used in a top-level execution context. .. change:: :tags: bug, regression, sql :tickets: 6343 Fixed regression where usage of the :func:`_sql.text` construct inside the columns clause of a :class:`_sql.Select` construct, which is better handled by using a :func:`_sql.literal_column` construct, would nonetheless prevent constructs like :func:`_sql.union` from working correctly. Other use cases, such as constructing subuqeries, continue to work the same as in prior versions where the :func:`_sql.text` construct is silently omitted from the collection of exported columns. Also repairs similar use within the ORM. .. change:: :tags: bug, regression, sql :tickets: 6261 Fixed regression involving legacy methods such as :meth:`_sql.Select.append_column` where internal assertions would fail. .. change:: :tags: usecase, sqlite :tickets: 6379 Default to using ``SingletonThreadPool`` for in-memory SQLite databases created using URI filenames. Previously the default pool used was the ``NullPool`` that precented sharing the same database between multiple engines. .. change:: :tags: bug, regression, sql :tickets: 6300 Fixed regression caused by :ticket:`5395` where tuning back the check for sequences in :func:`_sql.select` now caused failures when doing 2.0-style querying with a mapped class that also happens to have an ``__iter__()`` method. Tuned the check some more to accommodate this as well as some other interesting ``__iter__()`` scenarios. .. change:: :tags: bug, mssql, schema :tickets: 6345 Add :meth:`_types.TypeEngine.as_generic` support for :class:`sqlalchemy.dialects.mysql.BIT` columns, mapping them to :class:`_sql.sqltypes.Boolean`. .. change:: :tags: bug, orm, regression :tickets: 6360, 6359 Fixed issue where the new :ref:`autobegin <session_autobegin>` behavior failed to "autobegin" in the case where an existing persistent object has an attribute change, which would then impact the behavior of :meth:`_orm.Session.rollback` in that no snapshot was created to be rolled back. The "attribute modify" mechanics have been updated to ensure "autobegin", which does not perform any database work, does occur when persistent attributes change in the same manner as when :meth:`_orm.Session.add` is called. This is a regression as in 1.3, the rollback() method always had a transaction to roll back and would expire every time. .. change:: :tags: bug, mssql, regression :tickets: 6366 Fixed regression caused by :ticket:`6306` which added support for ``DateTime(timezone=True)``, where the previous behavior of the pyodbc driver of implicitly dropping the tzinfo from a timezone-aware date when INSERTing into a timezone-naive DATETIME column were lost, leading to a SQL Server error when inserting timezone-aware datetime objects into timezone-native database columns. .. change:: :tags: orm, bug, regression :tickets: 6386 Fixed regression in ORM where using hybrid property to indicate an expression from a different entity would confuse the column-labeling logic in the ORM and attempt to derive the name of the hybrid from that other class, leading to an attribute error. The owning class of the hybrid attribute is now tracked along with the name. .. change:: :tags: orm, bug, regression :tickets: 6401 Fixed regression in hybrid_property where a hybrid against a SQL function would generate an ``AttributeError`` when attempting to generate an entry for the ``.c`` collection of a subquery in some cases; among other things this would impact its use in cases like that of ``Query.count()``. .. change:: :tags: bug, postgresql :tickets: 6373 Fixed very old issue where the :class:`_types.Enum` datatype would not inherit the :paramref:`_schema.MetaData.schema` parameter of a :class:`_schema.MetaData` object when that object were passed to the :class:`_types.Enum` using :paramref:`_types.Enum.metadata`. .. change:: :tags: bug, orm, dataclasses :tickets: 6346 Adjusted the declarative scan for dataclasses so that the inheritance behavior of :func:`_orm.declared_attr` established on a mixin, when using the new form of having it inside of a ``dataclasses.field()`` construct and not actually a descriptor attribute on the class, correctly accommodates the case when the target class to be mapped is a subclass of an existing mapped class which has already mapped that :func:`_orm.declared_attr`, and therefore should not be re-applied to this class. .. change:: :tags: bug, schema, mysql, mariadb, oracle, postgresql :tickets: 6338 Ensure that the MySQL and MariaDB dialect ignore the :class:`_sql.Identity` construct while rendering the ``AUTO_INCREMENT`` keyword in a create table. The Oracle and PostgreSQL compiler was updated to not render :class:`_sql.Identity` if the database version does not support it (Oracle < 12 and PostgreSQL < 10). Previously it was rendered regardless of the database version. .. change:: :tags: bug, orm :tickets: 6353 Fixed an issue with the (deprecated in 1.4) :meth:`_schema.ForeignKeyConstraint.copy` method that caused an error when invoked with the ``schema`` argument. .. change:: :tags: bug, engine :tickets: 6361 Fixed issue where usage of an explicit :class:`.Sequence` would produce inconsistent "inline" behavior for an :class:`.Insert` construct that includes multiple values phrases; the first seq would be inline but subsequent ones would be "pre-execute", leading to inconsistent sequence ordering. The sequence expressions are now fully inline. .. changelog:: ``` ### 1.4.11 ``` :released: April 21, 2021 .. change:: :tags: bug, engine, regression :tickets: 6337 Fixed critical regression caused by the change in :ticket:`5497` where the connection pool "init" phase no longer occurred within mutexed isolation, allowing other threads to proceed with the dialect uninitialized, which could then impact the compilation of SQL statements. .. change:: :tags: bug, orm, regression, declarative :tickets: 6331 Fixed regression where recent changes to support Python dataclasses had the inadvertent effect that an ORM mapped class could not successfully override the ``__new__()`` method. .. changelog:: ``` ### 1.4.10 ``` :released: April 20, 2021 .. change:: :tags: bug, declarative, regression :tickets: 6291 Fixed :func:`_declarative.instrument_declarative` that called a non existing registry method. .. change:: :tags: bug, orm :tickets: 6320 Fixed bug in new :func:`_orm.with_loader_criteria` feature where using a mixin class with :func:`_orm.declared_attr` on an attribute that were accessed inside the custom lambda would emit a warning regarding using an unmapped declared attr, when the lambda callable were first initialized. This warning is now prevented using special instrumentation for this lambda initialization step. .. change:: :tags: usecase, mssql :tickets: 6306 The :paramref:`_types.DateTime.timezone` parameter when set to ``True`` will now make use of the ``DATETIMEOFFSET`` column type with SQL Server when used to emit DDL, rather than ``DATETIME`` where the flag was silently ignored. .. change:: :tags: orm, bug, regression :tickets: 6326 Fixed additional regression caused by the "eagerloaders on refresh" feature added in :ticket:`1763` where the refresh operation historically would set ``populate_existing``, which given the new feature now overwrites pending changes on eagerly loaded objects when autoflush is false. The populate_existing flag has been turned off for this case and a more specific method used to ensure the correct attributes refreshed. .. change:: :tags: bug, orm, result :tickets: 6299 Fixed an issue when using 2.0 style execution that prevented using :meth:`_result.Result.scalar_one` or :meth:`_result.Result.scalar_one_or_none` after calling :meth:`_result.Result.unique`, for the case where the ORM is returning a single-element row in any case. .. change:: :tags: bug, sql :tickets: 6327 Fixed issue in SQL compiler where the bound parameters set up for a :class:`.Values` construct wouldn't be positionally tracked correctly if inside of a :class:`_sql.CTE`, affecting database drivers that support VALUES + ctes and use positional parameters such as SQL Server in particular as well as asyncpg. The fix also repairs support for compiler flags such as ``literal_binds``. .. change:: :tags: bug, schema :tickets: 6287 Fixed issue where :func:`_functions.next_value` was not deriving its type from the corresponding :class:`_schema.Sequence`, instead hardcoded to :class:`_types.Integer`. The specific numeric type is now used. .. change:: :tags: bug, mypy :tickets: 6255 Fixed issue where mypy plugin would not correctly interpret an explicit :class:`_orm.Mapped` annotation in conjunction with a :func:`_orm.relationship` that refers to a class by string name; the correct annotation would be downgraded to a less specific one leading to typing errors. .. change:: :tags: bug, sql :tickets: 6256 Repaired and solidified issues regarding custom functions and other arbitrary expression constructs which within SQLAlchemy's column labeling mechanics would seek to use ``str(obj)`` to get a string representation to use as an anonymous column name in the ``.c`` collection of a subquery. This is a very legacy behavior that performs poorly and leads to lots of issues, so has been revised to no longer perform any compilation by establishing specific methods on :class:`.FunctionElement` to handle this case, as SQL functions are the only use case that it came into play. An effect of this behavior is that an unlabeled column expression with no derivable name will be given an arbitrary label starting with the prefix ``"_no_label"`` in the ``.c`` collection of a subquery; these were previously being represented either as the generic stringification of that expression, or as an internal symbol. .. change:: :tags: usecase, orm :ticketS: 6301 Altered some of the behavior repaired in :ticket:`6232` where the ``immediateload`` loader strategy no longer goes into recursive loops; the modification is that an eager load (joinedload, selectinload, or subqueryload) from A->bs->B which then states ``immediateload`` for a simple manytoone B->a->A that's in the identity map will populate the B->A, so that this attribute is back-populated when the collection of A/A.bs are loaded. This allows the objects to be functional when detached. .. changelog:: ``` ### 1.4.9 ``` :released: April 17, 2021 .. change:: :tags: bug, sql, regression :tickets: 6290 Fixed regression where an empty in statement on a tuple would result in an error when compiled with the option ``literal_binds=True``. .. change:: :tags: bug, regression, orm, performance, sql :tickets: 6304 Fixed a critical performance issue where the traversal of a :func:`_sql.select` construct would traverse a repetitive product of the represented FROM clauses as they were each referred towards by columns in the columns clause; for a series of nested subqueries with lots of columns this could cause a large delay and significant memory growth. This traversal is used by a wide variety of SQL and ORM functions, including by the ORM :class:`_orm.Session` when it's configured to have "table-per-bind", which while this is not a common use case, it seems to be what Flask-SQLAlchemy is hardcoded as using, so the issue impacts Flask-SQLAlchemy users. The traversal has been repaired to uniqify on FROM clauses which was effectively what would happen implicitly with the pre-1.4 architecture. .. change:: :tags: bug, postgresql, sql, regression :tickets: 6303 Fixed an argument error in the default and PostgreSQL compilers that would interfere with an UPDATE..FROM or DELETE..FROM..USING statement that was then SELECTed from as a CTE. .. change:: :tags: bug, orm, regression :tickets: 6272 Fixed regression where an attribute that is mapped to a :func:`_orm.synonym` could not be used in column loader options such as :func:`_orm.load_only`. .. change:: :tags: usecase, orm :tickets: 6267 Established support for :func:`_orm.synoynm` in conjunction with hybrid property, assocaitionproxy is set up completely, including that synonyms can be established linking to these constructs which work fully. This is a behavior that was semi-explicitly disallowed previously, however since it did not fail in every scenario, explicit support for assoc proxy and hybrids has been added. .. changelog:: ``` ### 1.4.8 ``` :released: April 15, 2021 .. change:: :tags: change, mypy Updated Mypy plugin to only use the public plugin interface of the semantic analyzer. .. change:: :tags: bug, mssql, regression :tickets: 6265 Fixed an additional regression in the same area as that of :ticket:`6173`, :ticket:`6184`, where using a value of 0 for OFFSET in conjunction with LIMIT with SQL Server would create a statement using "TOP", as was the behavior in 1.3, however due to caching would then fail to respond accordingly to other values of OFFSET. If the "0" wasn't first, then it would be fine. For the fix, the "TOP" syntax is now only emitted if the OFFSET value is omitted entirely, that is, :meth:`_sql.Select.offset` is not used. Note that this change now requires that if the "with_ties" or "percent" modifiers are used, the statement can't specify an OFFSET of zero, it now needs to be omitted entirely. .. change:: :tags: bug, engine The :meth:`_engine.Dialect.has_table` method now raises an informative exception if a non-Connection is passed to it, as this incorrect behavior seems to be common. This method is not intended for external use outside of a dialect. Please use the :meth:`.Inspector.has_table` method or for cross-compatibility with older SQLAlchemy versions, the :meth:`_engine.Engine.has_table` method. .. change:: :tags: bug, regression, sql :tickets: 6249 Fixed regression where the :class:`_sql.BindParameter` object would not properly render for an IN expression (i.e. using the "post compile" feature in 1.4) if the object were copied from either an internal cloning operation, or from a pickle operation, and the parameter name contained spaces or other special characters. .. change:: :tags: bug, mypy :tickets: 6205 Revised the fix for ``OrderingList`` from version 1.4.7 which was testing against the incorrect API. .. change:: :tags: bug, asyncio :tickets: 6220 Fix typo that prevented setting the ``bind`` attribute of an :class:`_asyncio.AsyncSession` to the correct value. .. change:: :tags: feature, sql :tickets: 3314 The tuple returned by :attr:`.CursorResult.inserted_primary_key` is now a :class:`_result.Row` object with a named tuple interface on top of the existing tuple interface. .. change:: :tags: bug, regression, sql, sqlite :tickets: 6254 Fixed regression where the introduction of the INSERT syntax "INSERT... VALUES (DEFAULT)" was not supported on some backends that do however support "INSERT..DEFAULT VALUES", including SQLite. The two syntaxes are now each individually supported or non-supported for each dialect, for example MySQL supports "VALUES (DEFAULT)" but not "DEFAULT VALUES". Support for Oracle has also been enabled. .. change:: :tags: bug, regression, orm :tickets: 6259 Fixed a cache leak involving the :func:`_orm.with_expression` loader option, where the given SQL expression would not be correctly considered as part of the cache key. Additionally, fixed regression involving the corresponding :func:`_orm.query_expression` feature. While the bug technically exists in 1.3 as well, it was not exposed until 1.4. The "default expr" value of ``null()`` would be rendered when not needed, and additionally was also not adapted correctly when the ORM rewrites statements such as when using joined eager loading. The fix ensures "singleton" expressions like ``NULL`` and ``true`` aren't "adapted" to refer to columns in ORM statements, and additionally ensures that a :func:`_orm.query_expression` with no default expression doesn't render in the statement if a :func:`_orm.with_expression` isn't used. .. change:: :tags: bug, orm :tickets: 6252 Fixed issue in the new feature of :meth:`_orm.Session.refresh` introduced by :ticket:`1763` where eagerly loaded relationships are also refreshed, where the ``lazy="raise"`` and ``lazy="raise_on_sql"`` loader strategies would interfere with the :func:`_orm.immediateload` loader strategy, thus breaking the feature for relationships that were loaded with :func:`_orm.selectinload`, :func:`_orm.subqueryload` as well. .. changelog:: ``` ### 1.4.7 ``` :released: April 9, 2021 .. change:: :tags: bug, sql, regression :tickets: 6222 Enhanced the "expanding" feature used for :meth:`_sql.ColumnOperators.in_` operations to infer the type of expression from the right hand list of elements, if the left hand side does not have any explicit type set up. This allows the expression to support stringification among other things. In 1.3, "expanding" was not automatically used for :meth:`_sql.ColumnOperators.in_` expressions, so in that sense this change fixes a behavioral regression. .. change:: :tags: bug, mypy Fixed issue in Mypy plugin where the plugin wasn’t inferring the correct type for columns of subclasses that don’t directly descend from ``TypeEngine``, in particular that of ``TypeDecorator`` and ``UserDefinedType``. .. change:: :tags: bug, orm, regression :tickets: 6221 Fixed regression where the :func:`_orm.subqueryload` loader strategy would fail to correctly accommodate sub-options, such as a :func:`_orm.defer` option on a column, if the "path" of the subqueryload were more than one level deep. .. change:: :tags: bug, sql Fixed the "stringify" compiler to support a basic stringification of a "multirow" INSERT statement, i.e. one with multiple tuples following the VALUES keyword. .. change:: :tags: bug, orm, regression :tickets: 6211 Fixed regression where the :func:`_orm.merge_frozen_result` function relied upon by the dogpile.caching example was not included in tests and began failing due to incorrect internal arguments. .. change:: :tags: bug, engine, regression :tickets: 6218 Fixed up the behavior of the :class:`_result.Row` object when dictionary access is used upon it, meaning converting to a dict via ``dict(row)`` or accessing members using strings or other objects i.e. ``row["some_key"]`` works as it would with a dictionary, rather than raising ``TypeError`` as would be the case with a tuple, whether or not the C extensions are in place. This was originally supposed to emit a 2.0 deprecation warning for the "non-future" case using :class:`_result.LegacyRow`, and was to raise ``TypeError`` for the "future" :class:`_result.Row` class. However, the C version of :class:`_result.Row` was failing to raise this ``TypeError``, and to complicate matters, the :meth:`_orm.Session.execute` method now returns :class:`_result.Row` in all cases to maintain consistency with the ORM result case, so users who didn't have C extensions installed would see different behavior in this one case for existing pre-1.4 style code. Therefore, in order to soften the overall upgrade scheme as most users have not been exposed to the more strict behavior of :class:`_result.Row` up through 1.4.6, :class:`_result.LegacyRow` and :class:`_result.Row` both provide for string-key access as well as support for ``dict(row)``, in all cases emitting the 2.0 deprecation warning when ``SQLALCHEMY_WARN_20`` is enabled. The :class:`_result.Row` object still uses tuple-like behavior for ``__contains__``, which is probably the only noticeable behavioral change compared to :class:`_result.LegacyRow`, other than the removal of dictionary-style methods ``values()`` and ``items()``. .. change:: :tags: bug, regression, orm :tickets: 6233 Fixed critical regression where the :class:`_orm.Session` could fail to "autobegin" a new transaction when a flush occurred without an existing transaction in place, implicitly placing the :class:`_orm.Session` into legacy autocommit mode which commit the transaction. The :class:`_orm.Session` now has a check that will prevent this condition from occurring, in addition to repairing the flush issue. Additionally, scaled back part of the change made as part of :ticket:`5226` which can run autoflush during an unexpire operation, to not actually do this in the case of a :class:`_orm.Session` using legacy :paramref:`_orm.Session.autocommit` mode, as this incurs a commit within a refresh operation. .. change:: :tags: change, tests Added a new flag to :class:`.DefaultDialect` called ``supports_schemas``; third party dialects may set this flag to ``False`` to disable SQLAlchemy's schema-level tests when running the test suite for a third party dialect. .. change:: :tags: bug, regression, schema :tickets: 6216 Fixed regression where usage of a token in the :paramref:`_engine.Connection.execution_options.schema_translate_map` dictionary which contained special characters such as braces would fail to be substituted properly. Use of square bracket characters ``[]`` is now explicitly disallowed as these are used as a delimiter character in the current implementation. .. change:: :tags: bug, regression, orm :tickets: 6215 Fixed regression where the ORM compilation scheme would assume the function name of a hybrid property would be the same as the attribute name in such a way that an ``AttributeError`` would be raised, when it would attempt to determine the correct name for each element in a result tuple. A similar issue exists in 1.3 but only impacts the names of tuple rows. The fix here adds a check that the hybrid's function name is actually present in the ``__dict__`` of the class or its superclasses before assigning this name; otherwise, the hybrid is considered to be "unnamed" and ORM result tuples will use the naming scheme of the underlying expression. .. change:: :tags: bug, orm, regression :tickets: 6232 Fixed critical regression caused by the new feature added as part of :ticket:`1763`, eager loaders are invoked on unexpire operations. The new feature makes use of the "immediateload" eager loader strategy as a substitute for a collection loading strategy, which unlike the other "post-load" strategies was not accommodating for recursive invocations between mutually-dependent relationships, leading to recursion overflow errors. .. changelog:: ``` ### 1.4.6 ``` :released: April 6, 2021 .. change:: :tags: bug, sql, regression, oracle, mssql :tickets: 6202 Fixed further regressions in the same area as that of :ticket:`6173` released in 1.4.5, where a "postcompile" parameter, again most typically those used for LIMIT/OFFSET rendering in Oracle and SQL Server, would fail to be processed correctly if the same parameter rendered in multiple places in the statement. .. change:: :tags: bug, orm, regression :tickets: 6203 Fixed regression where a deprecated form of :meth:`_orm.Query.join` were used, passing a series of entities to join from without any ON clause in a single :meth:`_orm.Query.join` call, would fail to function correctly. .. change:: :tags: bug, mypy :tickets: 6147 Applied a series of refactorings and fixes to accommodate for Mypy "incremental" mode across multiple files, which previously was not taken into account. In this mode the Mypy plugin has to accommodate Python datatypes expressed in other files coming in with less information than they have on a direct run. Additionally, a new decorator :func:`_orm.declarative_mixin` is added, which is necessary for the Mypy plugin to be able to definifitely identify a Declarative mixin class that is otherwise not used inside a particular Python file. .. seealso:: :ref:`mypy_declarative_mixins` .. change:: :tags: bug, mypy :tickets: 6205 Fixed issue where the Mypy plugin would fail to interpret the "collection_class" of a relationship if it were a callable and not a class. Also improved type matching and error reporting for collection-oriented relationships. .. change:: :tags: bug, sql :tickets: 6204 Executing a :class:`_sql.Subquery` using :meth:`_engine.Connection.execute` is deprecated and will emit a deprecation warning; this use case was an oversight that should have been removed from 1.4. The operation will now execute the underlying :class:`_sql.Select` object directly for backwards compatibility. Similarly, the :class:`_sql.CTE` class is also not appropriate for execution. In 1.3, attempting to execute a CTE would result in an invalid "blank" SQL statement being executed; since this use case was not working it now raises :class:`_exc.ObjectNotExecutableError`. Previously, 1.4 was attempting to execute the CTE as a statement however it was working only erratically. .. change:: :tags: bug, regression, orm :tickets: 6206 Fixed critical regression where the :meth:`_orm.Query.yield_per` method in the ORM would set up the internal :class:`_engine.Result` to yield chunks at a time, however made use of the new :meth:`_engine.Result.unique` method which uniques across the entire result. This would lead to lost rows since the ORM is using ``id(obj)`` as the uniquing function, which leads to repeated identifiers for new objects as already-seen objects are garbage collected. 1.3's behavior here was to "unique" across each chunk, which does not actually produce "uniqued" results when results are yielded in chunks. As the :meth:`_orm.Query.yield_per` method is already explicitly disallowed when joined eager loading is in place, which is the primary rationale for the "uniquing" feature, the "uniquing" feature is now turned off entirely when :meth:`_orm.Query.yield_per` is used. This regression only applies to the legacy :class:`_orm.Query` object; when u
pyup-bot commented 3 years ago

Closing this in favor of #849