You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by yh...@apache.org on 2024/10/29 15:57:23 UTC

(beam) branch master updated: Suppress future warning affecting Dataflow notebook (#32957)

This is an automated email from the ASF dual-hosted git repository.

yhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new a5e09025dd0 Suppress future warning affecting Dataflow notebook (#32957)
a5e09025dd0 is described below

commit a5e09025dd053a5b893d086e3c15657f41970bb2
Author: Yi Hu <ya...@google.com>
AuthorDate: Tue Oct 29 11:57:15 2024 -0400

    Suppress future warning affecting Dataflow notebook (#32957)
    
    * Suppress future warning affecting Dataflow notebook
    
    * fix lint
---
 .../runners/interactive/display/pcoll_visualization.py            | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sdks/python/apache_beam/runners/interactive/display/pcoll_visualization.py b/sdks/python/apache_beam/runners/interactive/display/pcoll_visualization.py
index 693abb2aeee..d767a15a345 100644
--- a/sdks/python/apache_beam/runners/interactive/display/pcoll_visualization.py
+++ b/sdks/python/apache_beam/runners/interactive/display/pcoll_visualization.py
@@ -26,6 +26,7 @@ import base64
 import datetime
 import html
 import logging
+import warnings
 from datetime import timedelta
 from typing import Optional
 
@@ -350,7 +351,12 @@ class PCollectionVisualization(object):
     ]
     # String-ify the dictionaries for display because elements of type dict
     # cannot be ordered.
-    data = data.applymap(lambda x: str(x) if isinstance(x, dict) else x)
+    with warnings.catch_warnings():
+      # TODO(yathu) switch to use DataFrame.map when dropped pandas<2.1 support
+      warnings.filterwarnings(
+          "ignore", message="DataFrame.applymap has been deprecated")
+      data = data.applymap(lambda x: str(x) if isinstance(x, dict) else x)
+
     if updating_pv:
       # Only updates when data is not empty. Otherwise, consider it a bad
       # iteration and noop since there is nothing to be updated.