Skip to content

Commit cde6ab1

Browse files
committed
clip seq to avoid overflows and add warning for missing table deps
1 parent 8b62404 commit cde6ab1

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

src/pasteur/table.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,12 @@ def _reverse_chunk(
555555
)
556556
tt = t.reverse(cached_table, cached_ctx, ref_col, cached_ids)
557557
elif isinstance(t, RefTransformer):
558+
for r in cref:
559+
if r.table:
560+
assert (
561+
r.table in parent_tables
562+
), f"Table '{self.name}' depends on table '{r.table}', but it was not specified in the parameter 'trn_deps' of the view."
563+
558564
ref_col = _calc_joined_refs(
559565
self.name,
560566
get_parent,
@@ -1161,11 +1167,14 @@ def transform(
11611167
parent: pd.concat(
11621168
[
11631169
ctx,
1164-
ids.join(seq)
1165-
.groupby(self.parent)[cast(str, seq.name)]
1166-
.max()
1167-
.rename(self.col_n)
1168-
+ 1,
1170+
(
1171+
ids.join(seq)
1172+
.groupby(self.parent)[cast(str, seq.name)]
1173+
.max()
1174+
+ 1
1175+
)
1176+
.clip(upper=self.max_len)
1177+
.rename(self.col_n),
11691178
],
11701179
axis=1,
11711180
)

0 commit comments

Comments
 (0)