shahar1 commented on code in PR #44081:
URL: https://github.com/apache/airflow/pull/44081#discussion_r1845029040


##########
airflow/models/dagcode.py:
##########
@@ -194,4 +194,9 @@ def dag_fileloc_hash(full_filepath: str) -> int:
         import hashlib
 
         # Only 7 bytes because MySQL BigInteger can hold only 8 bytes (signed).
-        return struct.unpack(">Q", 
hashlib.sha1(full_filepath.encode("utf-8")).digest()[-8:])[0] >> 8
+        return (
+            struct.unpack(
+                ">Q", hashlib.sha1(full_filepath.encode("utf-8"), 
usedforsecurity=False).digest()[-8:]
+            )[0]
+            >> 8
+        )

Review Comment:
   Maybe adding a small unit test would be nice? (sanity check for the next 
time the algorithm changes)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to