From bdc8393afd9fc390e791ec0b97383cb8de02821c Mon Sep 17 00:00:00 2001 From: mravi Date: Mon, 23 Dec 2024 20:56:10 -0800 Subject: [PATCH 1/3] Suppress DataFrame.applymap deprecation warning --- .../runners/interactive/display/pcoll_visualization.py | 6 +++++- 1 file changed, 5 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 d767a15a345d..bfdfe9b453fc 100644 --- a/sdks/python/apache_beam/runners/interactive/display/pcoll_visualization.py +++ b/sdks/python/apache_beam/runners/interactive/display/pcoll_visualization.py @@ -420,7 +420,11 @@ def _display_dataframe(self, data, update=None): format_window_info_in_dataframe(data) # Convert the dataframe into rows, each row looks like # [column_1_val, column_2_val, ...]. - rows = data.applymap(lambda x: str(x)).to_dict('split')['data'] + with warnings.catch_warnings(): + warnings.filterwarnings( + "ignore", message=".*DataFrame.applymap has been deprecated.*") + rows = data.applymap(lambda x: str(x)).to_dict('split')['data'] + # Convert each row into dict where keys are column index in the datatable # to be rendered and values are data from the dataframe. Column index 0 is # left out to hold the int index (not part of the data) from dataframe. From 830aa4ed51bdd37bb7ec2ee7e61bdc83438e8498 Mon Sep 17 00:00:00 2001 From: mravi Date: Mon, 23 Dec 2024 21:12:56 -0800 Subject: [PATCH 2/3] fixup: lint --- .../runners/interactive/display/pcoll_visualization.py | 1 - 1 file changed, 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 bfdfe9b453fc..4bf2e8984634 100644 --- a/sdks/python/apache_beam/runners/interactive/display/pcoll_visualization.py +++ b/sdks/python/apache_beam/runners/interactive/display/pcoll_visualization.py @@ -424,7 +424,6 @@ def _display_dataframe(self, data, update=None): warnings.filterwarnings( "ignore", message=".*DataFrame.applymap has been deprecated.*") rows = data.applymap(lambda x: str(x)).to_dict('split')['data'] - # Convert each row into dict where keys are column index in the datatable # to be rendered and values are data from the dataframe. Column index 0 is # left out to hold the int index (not part of the data) from dataframe. From f0801f3c5405c16e68f6e406166c9a0d54801871 Mon Sep 17 00:00:00 2001 From: mravi Date: Wed, 25 Dec 2024 16:18:14 -0800 Subject: [PATCH 3/3] Trigger Build