Skip to content

Commit 064f6d1

Browse files
authored
Upgrade to Pandas 2.x (#658)
* Upgrade to Pandas 2.x * Retain 3.8 compatibility * update changelog
1 parent fba675a commit 064f6d1

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Starting with v1.31.6, this file will contain a record of major features and upd
77
- Added `%create_graph_snapshot` line magic ([Link to PR](https://github.com/aws/graph-notebook/pull/653))
88
- Added better `%reset` user messaging on status check timeout ([Link to PR](https://github.com/aws/graph-notebook/pull/652))
99
- Modified the `%reset --snapshot` option to use the CreateGraphSnapshot API ([Link to PR](https://github.com/aws/graph-notebook/pull/654))
10+
- Upgraded `pandas` dependency to 2.x ([Link to PR](https://github.com/aws/graph-notebook/pull/658))
1011
- Upgraded `setuptools` dependency to 70.x ([Link to PR](https://github.com/aws/graph-notebook/pull/649))
1112
- 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))
1213
- Updated sample SageMaker Lifecycle scripts ([Link to PR](https://github.com/aws/graph-notebook/pull/657))

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ nbconvert>=6.3.0,<=7.2.8
2020
jedi>=0.18.1,<=0.18.2
2121
markupsafe<2.1.0
2222
itables>=2.0.0,<=2.1.0
23-
pandas>=1.3.5,<=1.5.3
23+
pandas>=2.0.0,<=2.2.2
2424
numpy<1.24.0
2525
nest_asyncio>=1.5.5,<=1.5.6
2626
async-timeout>=4.0,<5.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def get_version():
8888
'nbconvert>=6.3.0,<=7.2.8',
8989
'jedi>=0.18.1,<=0.18.2',
9090
'itables>=2.0.0,<=2.1.0',
91-
'pandas>=1.3.5,<=1.5.3',
91+
'pandas>=2.0.0,<=2.2.2',
9292
'numpy<1.24.0',
9393
'nest_asyncio>=1.5.5,<=1.5.6',
9494
'async-timeout>=4.0,<5.0'

src/graph_notebook/magics/graph_magic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def oc_results_df(oc_res, oc_res_format: str = None):
244244
if rows_and_columns:
245245
results_df = pd.DataFrame(rows_and_columns['rows'])
246246
results_df = results_df.astype(str)
247-
results_df = results_df.applymap(lambda x: encode_html_chars(x))
247+
results_df = results_df.map(lambda x: encode_html_chars(x))
248248
col_0_value = range(1, len(results_df) + 1)
249249
results_df.insert(0, "#", col_0_value)
250250
for col_index, col_name in enumerate(rows_and_columns['columns']):
@@ -292,7 +292,7 @@ def encode_html_chars(result):
292292

293293
def decode_html_chars(results_df: pd.DataFrame = None) -> pd.DataFrame:
294294
for k, v in iter(DT_HTML_CHAR_MAP.items()):
295-
results_df = results_df.applymap(lambda x: x.replace(v, k))
295+
results_df = results_df.map(lambda x: x.replace(v, k))
296296

297297
return results_df
298298

@@ -896,7 +896,7 @@ def sparql(self, line='', cell='', local_ns: dict = None):
896896
if rows_and_columns is not None:
897897
results_df = pd.DataFrame(rows_and_columns['rows'])
898898
results_df = results_df.astype(str)
899-
results_df = results_df.applymap(lambda x: encode_html_chars(x))
899+
results_df = results_df.map(lambda x: encode_html_chars(x))
900900
results_df.insert(0, "#", range(1, len(results_df) + 1))
901901
for col_index, col_name in enumerate(rows_and_columns['columns']):
902902
try:

0 commit comments

Comments
 (0)