MCPcopy Create free account
hub / github.com/Pometry/Raphtory / test_to_df

Function test_to_df

python/tests/test_export.py:1125–1183  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1123
1124
1125def test_to_df():
1126 g = build_graph()
1127
1128 compare_df(
1129 g.edges.to_df(),
1130 pd.read_json(base_dir / "expected/dataframe_output/edge_df_all.json"),
1131 )
1132
1133 compare_df(
1134 g.edges.to_df(include_property_history=False),
1135 pd.read_json(base_dir / "expected/dataframe_output/edge_df_no_props.json"),
1136 )
1137
1138 compare_df(
1139 g.edges.to_df(explode=False),
1140 pd.read_json(base_dir / "expected/dataframe_output/edge_df_no_explode.json"),
1141 )
1142
1143 compare_df(
1144 g.edges.to_df(convert_datetime=False),
1145 pd.read_json(base_dir / "expected/dataframe_output/edge_df_no_datetime.json"),
1146 )
1147
1148 compare_df(
1149 g.edges.to_df(explode=True),
1150 pd.read_json(base_dir / "expected/dataframe_output/edge_df_explode.json"),
1151 )
1152
1153 compare_df(
1154 g.edges.explode().to_df(),
1155 pd.read_json(base_dir / "expected/dataframe_output/edge_df_explode.json"),
1156 )
1157
1158 # compare_df(
1159 # g.edges.to_df(explode=True, convert_datetime=True),
1160 # pd.read_json(base_dir / "expected/dataframe_output/edge_df_explode_datetime.json")
1161 # )
1162
1163 compare_df(
1164 g.edges.to_df(explode=True, include_property_history=True),
1165 pd.read_json(
1166 base_dir / "expected/dataframe_output/edge_df_explode_no_hist.json"
1167 ),
1168 )
1169
1170 compare_df(
1171 g.nodes.to_df(include_property_history=False),
1172 pd.read_json(base_dir / "expected/dataframe_output/node_df_no_hist.json"),
1173 )
1174
1175 compare_df(
1176 g.nodes.to_df(include_property_history=True),
1177 pd.read_json(base_dir / "expected/dataframe_output/node_df_no_explode.json"),
1178 )
1179
1180 compare_df(
1181 g.nodes.to_df(convert_datetime=False, include_property_history=True),
1182 pd.read_json(base_dir / "expected/dataframe_output/node_df_no_datetime.json"),

Callers

nothing calls this directly

Calls 4

compare_dfFunction · 0.85
build_graphFunction · 0.70
to_dfMethod · 0.45
explodeMethod · 0.45

Tested by

no test coverage detected