-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] fields: fix
_column.new()
by relying on to_field_args()
The implementation was based on the ill-defined method `same_parameters()` that compares arguments based on a heuristic. Instead, we now create a new column and check whether it is equivalent to `self` by comparing the arguments returned by `to_field_args()`. If that is the case, `self` is reused instead of the new column. The code refactoring also fixes the column reuse which was broken by the introduction of the parameter `compute` in commit 9333c62. Indeed, with that parameter, `same_parameters()` always returned False, since old-api columns do not have that parameter by default. The parameter has been renamed to `_computed_field`, and is no longer passed for creating columns.
- Loading branch information
Showing
2 changed files
with
16 additions
and
20 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