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)) diff --git a/requirements.txt b/requirements.txt index 82c0708c..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>=1.3.5,<=1.5.3 +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 7705997f..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>=1.3.5,<=1.5.3', + '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/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: