diff --git a/spycy/spycy.py b/spycy/spycy.py index 71953ef..ce486f8 100755 --- a/spycy/spycy.py +++ b/spycy/spycy.py @@ -274,7 +274,6 @@ def get_var_expr(f): for alias, proj in group_by_keys.items(): expr = proj.oC_Expression() group_by_columns[alias] = self.evaluate_expr(expr) - def get_key(row): def get_tuple(value): if isinstance(value, Node): @@ -404,6 +403,13 @@ def _process_unwind(self, node: CypherParser.OC_UnwindContext): mask.append(value is not pd.NA and len(value) > 0) self.table = self.table[mask] self.table = self.table.explode(alias, ignore_index=True) + try: + new_col = self.table[alias] + if len(new_col): + casted_col = new_col.astype(type(new_col[0])) + self.table[alias] = casted_col + except (TypeError, ValueError): + pass def _build_intial_match_result_for_row( self, row: int, pgraph: pattern_graph.Graph