Skip to content

Several count errors #996

Description

@Pablolgn

Initial Checks

Summary

I found some bugs some are already fixed in duckdb but fails in pandas.

DuckDB fixes 5 of the 8 bugs

Case Pandas DuckDB
[aggr n := count() group by Id_2] NA, NA, NA, NA 3, 3, 3, 1
analytic count(Me_int over (partition by Id_2)), group D 1 0
analytic order by without partition by all 1 1…10
having + viral attribute KeyError: ['Va_str'] 💥 3, 3, 3
analytic over String with nulls TypeError: Invalid value '-1' 💥 3, 2, 2, 1

Present in both engines — 3 bugs

Case Expected Both
count(DS_1) 10 0
count(DS_1 group by Id_1) 3, 3, 3, 1 NA, NA, NA, NA
[aggr n := count(Me_int) group by Id_2], all-null group 0 NA

These three are the ones worth reporting: they are not backend-specific, they
are in the core. The first two are the same problem — count fails with a
dataset operand; with #component it works correctly on both engines.

Reproducible Example

DS_bug_1_ds_simple := count ( DS_1 );
DS_bug_2_ds_group  := count ( DS_1 group by Id_1 );
DS_bug_3_grupo_nulo := DS_1 [aggr n := count(Me_int) group by Id_2];
DS_bug_4_noarg     := DS_1 [aggr n := count() group by Id_2];
DS_bug_5_an_nulos  := DS_1 [calc n := count(Me_int over (partition by Id_2))];
DS_bug_6_an_sin_part := DS_1 [calc n := count(Me_num over (order by Id_2, Id_1))];
DS_bug_7_having    := DS_1 [aggr n := count(Me_num) group by Id_2 having count(Me_num) > 2];
DS_bug_8_an_string := DS_1 [calc n := count(Me_str over (partition by Id_2))];

Expected vs Actual

Expected: works fine

vtlengine version

1.9.2.rc4

Python version

No response

OS

No response

Additional Context

No response

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions