-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dependencies: update
sqlalchemy-utils
dependency requirements (#4855)
In `767f57a02b1ba40421ab9b17a67b2532aff556c6` the `sqlalchemy` dependency was pinned to the `v1.3` minor version, because the recent `v1.4.0` release would break `sqlalchemy-utils`. The latter has now released `v0.37.0` which is compatible with `sqlalchemy==1.4`. In theory this would allows us to support `v1.4` as well, except our own code breaks with this version since we access quite a few protected attributes in the query builder implementation. Since `sqlalchemy-utils` does not follow semver, we have to pin it to the `0.37.x` series for now. Since version `0.37.0` and `0.37.1` were yanked as they did not specify the `python_requires` keyword, we set the lower boundary to `0.37.2`. The constructor of the `DbLog` class was simplified. Its only purpose is to make sure that the `_metadata` column is properly initialized. The column has an underscore prepended because otherwise it would clash with an attribute of the SqlAlchemy base class, however, the constructor takes just `metadata` so this has to be transferred. In addition, it should be initialized to an empty dict if it is `None`. All other initialization code that was in the constructor will be taken care of by simply calling the parent class' constructor. Finally, the `force_instant_defaults` listener of `sqlalchemy-utils` was updated in v0.37.5 which caused certain tests to fail. The fix ensured that the `kwargs` passed into the constructor of a model instance would be updated with the defaults of the column definitions that are set on the instance by the listener. The problem is that some of our models, e.g. `DbComment`, rely no distinguishing between the column value being explicitly passed by the caller or through default. Most notably this is for the `mtime` which our implementation wants to have undefined before storing, unless explicitly passed in the constructor. Due to the change in `sqlalchemy-utils` this distinction could no longer be made and so the only solution was to copy the original implementation of the listener utility.
- Loading branch information
Showing
8 changed files
with
32 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters