mysqlengine 0.1.11.4__cp311-cp311-macosx_10_9_universal2.whl → 0.1.11.6__cp311-cp311-macosx_10_9_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mysqlengine might be problematic. Click here for more details.

Binary file
mysqlengine/database.py CHANGED
@@ -2538,7 +2538,7 @@ class Table:
2538
2538
  :return <'str'>: The md5 hashed value in string.
2539
2539
  """
2540
2540
  return utils._hash_md5(obj)
2541
-
2541
+
2542
2542
  def hash_sha256(self, obj: Any) -> str:
2543
2543
  """SHA256 hash an object.
2544
2544
 
@@ -2592,6 +2592,15 @@ class Table:
2592
2592
  """
2593
2593
  return utils._chunk_df(df, size or -1, chunks or -1)
2594
2594
 
2595
+ def concat_df_columns(self, df: DataFrame) -> Series:
2596
+ """Concatenate DataFrame values to one single columns `<Series[str]>`.
2597
+
2598
+ ### Notice
2599
+ The new column `<Series>` should only be used for row comparison,
2600
+ since the values will be escaped to `<str>` for concatenation.
2601
+ """
2602
+ return Series(df.values.tolist(), index=df.index).apply(self._escape_item)
2603
+
2595
2604
  # Export & Import -----------------------------------------------------
2596
2605
  async def export_data(self, dir: str) -> int:
2597
2606
  """Export table data to a local directory.
@@ -6157,7 +6166,7 @@ class Database:
6157
6166
  :return <'str'>: The md5 hashed value in string.
6158
6167
  """
6159
6168
  return utils._hash_md5(obj)
6160
-
6169
+
6161
6170
  def hash_sha256(self, obj: Any) -> str:
6162
6171
  """SHA256 hash an object.
6163
6172
 
@@ -6211,6 +6220,15 @@ class Database:
6211
6220
  """
6212
6221
  return utils._chunk_df(df, size or -1, chunks or -1)
6213
6222
 
6223
+ def concat_df_columns(self, df: DataFrame) -> Series:
6224
+ """Concatenate DataFrame values to one single columns `<Series[str]>`.
6225
+
6226
+ ### Notice
6227
+ The new column `<Series>` should only be used for row comparison,
6228
+ since the values will be escaped to `<str>` for concatenation.
6229
+ """
6230
+ return Series(df.values.tolist(), index=df.index).apply(self._escape_item)
6231
+
6214
6232
  # Export & Import -----------------------------------------------------
6215
6233
  async def export_data(self, dir: str) -> int:
6216
6234
  """Export Database table data to a local directory synchronously.