Skip to content

Commit 7f09c59

Browse files
authored
Merge pull request #158 from serv-c/drgroot-patch-1
fix: handle where predicate contains list
2 parents 77af075 + 30cc6a8 commit 7f09c59

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

servc/svc/com/storage/delta.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,14 @@ def overwrite(
129129
predicate: str | None = None
130130
filter = self._filters(partitions)
131131
if filter is not None:
132-
predicate = operator.join([" ".join(x) for x in filter])
132+
predicate_list: List[str] = []
133+
for tuple_value in filter:
134+
if isinstance(tuple_value[-1], list):
135+
in_list = ", ".join(tuple_value[-1])
136+
predicate_list.append(" ".join([tuple_value[0], tuple_value[1], f"({in_list})"]))
137+
else:
138+
predicate_list.append(" ".join(tuple_value))
139+
predicate = operator.join(predicate_list)
133140

134141
write_deltalake(
135142
table,

0 commit comments

Comments
 (0)