Skip to content

Commit

Permalink
Avoid negative hashes in lambda names, refs #543
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed May 8, 2023
1 parent dab2388 commit c764a9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sqlite_utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -2689,7 +2689,7 @@ def convert_value(v):

fn_name = fn.__name__
if fn_name == "<lambda>":
fn_name = f"lambda_{hash(fn)}"
fn_name = f"lambda_{abs(hash(fn))}"
self.db.register_function(convert_value, name=fn_name)
sql = "update [{table}] set {sets}{where};".format(
table=self.name,
Expand Down

0 comments on commit c764a9e

Please sign in to comment.