From 730ce657c1bf9b6f06deeb52af7cf3929a32a687 Mon Sep 17 00:00:00 2001 From: Adriel Martins Date: Tue, 27 Feb 2024 19:15:48 -0300 Subject: [PATCH] fix: replacing pd.DataFrame.append with pd.concat --- ...ral_static_graph_default_implementation.py | 51 +++++++++++-------- setup.py | 3 +- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/autogl/data/graph/_general_static_graph/_general_static_graph_default_implementation.py b/autogl/data/graph/_general_static_graph/_general_static_graph_default_implementation.py index bf35424..f900049 100644 --- a/autogl/data/graph/_general_static_graph/_general_static_graph_default_implementation.py +++ b/autogl/data/graph/_general_static_graph/_general_static_graph_default_implementation.py @@ -621,16 +621,20 @@ def _set_edges( if edge_t in (Ellipsis, None): if len(self.__heterogeneous_edges_data_frame) == 0: self.__heterogeneous_edges_data_frame: pd.DataFrame = ( - self.__heterogeneous_edges_data_frame.append( - pd.DataFrame( - { - 's': [''], 'r': [''], 't': [''], - 'edges': [ - edges if isinstance(edges, HomogeneousEdgesContainer) - else HomogeneousEdgesContainerImplementation(edges) - ] - } - ) + pd.concat( + [ + self.__heterogeneous_edges_data_frame, + pd.DataFrame( + { + 's': [''], 'r': [''], 't': [''], + 'edges': [ + edges if isinstance(edges, HomogeneousEdgesContainer) + else HomogeneousEdgesContainerImplementation(edges) + ] + } + ) + ] + ) ) elif len(self.__heterogeneous_edges_data_frame) == 1: @@ -680,20 +684,23 @@ def _set_edges( ] ) == 0: self.__heterogeneous_edges_data_frame: pd.DataFrame = ( - self.__heterogeneous_edges_data_frame.append( - pd.DataFrame( - { - 's': [__edge_t[0]], - 'r': [__edge_t[1]], - 't': [__edge_t[2]], - 'edges': [ - edges if isinstance(edges, HomogeneousEdgesContainer) - else HomogeneousEdgesContainerImplementation(edges) - ] - } + pd.concat( + [ + self.__heterogeneous_edges_data_frame, + pd.DataFrame( + { + 's': [__edge_t[0]], + 'r': [__edge_t[1]], + 't': [__edge_t[2]], + 'edges': [ + edges if isinstance(edges, HomogeneousEdgesContainer) + else HomogeneousEdgesContainerImplementation(edges) + ] + } + ) + ] ) ) - ) elif len( self.__heterogeneous_edges_data_frame.loc[ (self.__heterogeneous_edges_data_frame['s'] == __edge_t[0]) & diff --git a/setup.py b/setup.py index 2be1c92..6a53733 100644 --- a/setup.py +++ b/setup.py @@ -55,6 +55,7 @@ 'scipy', 'tabulate', 'tqdm', - 'nni==2.8' + 'nni==2.8', + "pandas >= 1.4.0, <= 2.2.1", ] ) \ No newline at end of file