Skip to content

Commit

Permalink
fix unique id
Browse files Browse the repository at this point in the history
  • Loading branch information
lucascr91 committed Jul 12, 2023
1 parent a85e028 commit c5ce763
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pipelines/datasets/br_mercadolivre_ofertas/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ def generate_unique_id(text: str):
hash_object = hashlib.sha256(string_bytes)
hash_hex = hash_object.hexdigest()

# Take the first 12 digits of the hexadecimal hash
hash_digits = hash_hex[:12]

# Convert the hexadecimal digits to an integer
unique_id = int(hash_digits, 16)
unique_id = int(hash_hex, 16)

# Ensure the ID is positive
unique_id = str(int(abs(unique_id)))
Expand Down

0 comments on commit c5ce763

Please sign in to comment.