Skip to content

Commit

Permalink
BUG: use uuid4 instead of md5 for fake column in cross merge (pandas-…
Browse files Browse the repository at this point in the history
…dev#48029)

* BUG: use usedforsecurity for md5 in cross merge

* BUG: use usedforsecurity for md5 in cross merge

* Use uuid
  • Loading branch information
phofl committed Aug 11, 2022
1 parent 7c99031 commit 926b9ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v1.5.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@ Reshaping
- Bug in :func:`concat` not sorting the column names when ``None`` is included (:issue:`47331`)
- Bug in :func:`concat` with identical key leads to error when indexing :class:`MultiIndex` (:issue:`46519`)
- Bug in :func:`pivot_table` raising ``TypeError`` when ``dropna=True`` and aggregation column has extension array dtype (:issue:`47477`)
- Bug in :func:`merge` raising error for ``how="cross"`` when using ``FIPS`` mode in ssl library (:issue:`48024`)
- Bug in :meth:`DataFrame.join` with a list when using suffixes to join DataFrames with duplicate column names (:issue:`46396`)
- Bug in :meth:`DataFrame.pivot_table` with ``sort=False`` results in sorted index (:issue:`17041`)
- Bug in :meth:`concat` when ``axis=1`` and ``sort=False`` where the resulting Index was a :class:`Int64Index` instead of a :class:`RangeIndex` (:issue:`46675`)
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import copy
import datetime
from functools import partial
import hashlib
import string
from typing import (
TYPE_CHECKING,
Hashable,
cast,
)
import uuid
import warnings

import numpy as np
Expand Down Expand Up @@ -1311,7 +1311,7 @@ def _create_cross_configuration(
DataFrames with cross_col, the merge operation set to inner and the column
to join over.
"""
cross_col = f"_cross_{hashlib.md5().hexdigest()}"
cross_col = f"_cross_{uuid.uuid4()}"
how = "inner"
return (
left.assign(**{cross_col: 1}),
Expand Down

0 comments on commit 926b9ce

Please sign in to comment.