From dbfbd9869093b7defdde201e296acfe16a7d1ae9 Mon Sep 17 00:00:00 2001 From: ptajvar Date: Tue, 5 Nov 2024 17:56:22 +0100 Subject: [PATCH] casting component to string before checking for match when constructing a graph from a pixel object. --- src/pixelator/pixeldataset/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pixelator/pixeldataset/__init__.py b/src/pixelator/pixeldataset/__init__.py index fc9a735b..0d196534 100644 --- a/src/pixelator/pixeldataset/__init__.py +++ b/src/pixelator/pixeldataset/__init__.py @@ -245,7 +245,7 @@ def graph( """ if component_id: potential_component = self.edgelist_lazy.filter( - pl.col("component") == component_id + pl.col("component").cast(pl.String) == component_id ) if potential_component.head(1).collect().is_empty(): raise KeyError(f"{component_id} not found in edgelist")