From 8b32918ed2d48674ceb42ebb74e45f837e3b8034 Mon Sep 17 00:00:00 2001 From: Michael Chin Date: Tue, 30 Jul 2024 21:39:57 -0700 Subject: [PATCH 1/3] Upgrade to Pandas 2.x --- requirements.txt | 2 +- setup.py | 2 +- src/graph_notebook/magics/graph_magic.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 82c0708c..5295b846 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ nbconvert>=6.3.0,<=7.2.8 jedi>=0.18.1,<=0.18.2 markupsafe<2.1.0 itables>=2.0.0,<=2.1.0 -pandas>=1.3.5,<=1.5.3 +pandas>=2.1.0,<=2.2.2 numpy<1.24.0 nest_asyncio>=1.5.5,<=1.5.6 async-timeout>=4.0,<5.0 diff --git a/setup.py b/setup.py index 7705997f..2d0a8166 100644 --- a/setup.py +++ b/setup.py @@ -88,7 +88,7 @@ def get_version(): 'nbconvert>=6.3.0,<=7.2.8', 'jedi>=0.18.1,<=0.18.2', 'itables>=2.0.0,<=2.1.0', - 'pandas>=1.3.5,<=1.5.3', + 'pandas>=2.1.0,<=2.2.2', 'numpy<1.24.0', 'nest_asyncio>=1.5.5,<=1.5.6', 'async-timeout>=4.0,<5.0' diff --git a/src/graph_notebook/magics/graph_magic.py b/src/graph_notebook/magics/graph_magic.py index 7c9b5a0a..31b69acb 100644 --- a/src/graph_notebook/magics/graph_magic.py +++ b/src/graph_notebook/magics/graph_magic.py @@ -244,7 +244,7 @@ def oc_results_df(oc_res, oc_res_format: str = None): if rows_and_columns: results_df = pd.DataFrame(rows_and_columns['rows']) results_df = results_df.astype(str) - results_df = results_df.applymap(lambda x: encode_html_chars(x)) + results_df = results_df.map(lambda x: encode_html_chars(x)) col_0_value = range(1, len(results_df) + 1) results_df.insert(0, "#", col_0_value) for col_index, col_name in enumerate(rows_and_columns['columns']): @@ -292,7 +292,7 @@ def encode_html_chars(result): def decode_html_chars(results_df: pd.DataFrame = None) -> pd.DataFrame: for k, v in iter(DT_HTML_CHAR_MAP.items()): - results_df = results_df.applymap(lambda x: x.replace(v, k)) + results_df = results_df.map(lambda x: x.replace(v, k)) return results_df @@ -896,7 +896,7 @@ def sparql(self, line='', cell='', local_ns: dict = None): if rows_and_columns is not None: results_df = pd.DataFrame(rows_and_columns['rows']) results_df = results_df.astype(str) - results_df = results_df.applymap(lambda x: encode_html_chars(x)) + results_df = results_df.map(lambda x: encode_html_chars(x)) results_df.insert(0, "#", range(1, len(results_df) + 1)) for col_index, col_name in enumerate(rows_and_columns['columns']): try: From be71af2c5d8d911ff6537e4d7dab39d1ec5c9b52 Mon Sep 17 00:00:00 2001 From: Michael Chin Date: Tue, 30 Jul 2024 21:47:33 -0700 Subject: [PATCH 2/3] Retain 3.8 compatibility --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 5295b846..18f6b103 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ nbconvert>=6.3.0,<=7.2.8 jedi>=0.18.1,<=0.18.2 markupsafe<2.1.0 itables>=2.0.0,<=2.1.0 -pandas>=2.1.0,<=2.2.2 +pandas>=2.0.0,<=2.2.2 numpy<1.24.0 nest_asyncio>=1.5.5,<=1.5.6 async-timeout>=4.0,<5.0 diff --git a/setup.py b/setup.py index 2d0a8166..40a88f26 100644 --- a/setup.py +++ b/setup.py @@ -88,7 +88,7 @@ def get_version(): 'nbconvert>=6.3.0,<=7.2.8', 'jedi>=0.18.1,<=0.18.2', 'itables>=2.0.0,<=2.1.0', - 'pandas>=2.1.0,<=2.2.2', + 'pandas>=2.0.0,<=2.2.2', 'numpy<1.24.0', 'nest_asyncio>=1.5.5,<=1.5.6', 'async-timeout>=4.0,<5.0' From 65f5fb3dc8d7931f14180eff16e035768242edf7 Mon Sep 17 00:00:00 2001 From: Michael Chin Date: Tue, 30 Jul 2024 21:51:29 -0700 Subject: [PATCH 3/3] update changelog --- ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.md b/ChangeLog.md index 8ff54091..91b2bb88 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,7 @@ Starting with v1.31.6, this file will contain a record of major features and upd - Added `%create_graph_snapshot` line magic ([Link to PR](https://github.com/aws/graph-notebook/pull/653)) - Added better `%reset` user messaging on status check timeout ([Link to PR](https://github.com/aws/graph-notebook/pull/652)) - Modified the `%reset --snapshot` option to use the CreateGraphSnapshot API ([Link to PR](https://github.com/aws/graph-notebook/pull/654)) +- Upgraded `pandas` dependency to 2.x ([Link to PR](https://github.com/aws/graph-notebook/pull/658)) - Upgraded `setuptools` dependency to 70.x ([Link to PR](https://github.com/aws/graph-notebook/pull/649)) - Experimental support for Python 3.11 ([PR #1](https://github.com/aws/graph-notebook/pull/645)) ([PR #2](https://github.com/aws/graph-notebook/pull/656)) - Updated sample SageMaker Lifecycle scripts ([Link to PR](https://github.com/aws/graph-notebook/pull/657))