fix: count(), tally(), and summarise() on keyed tables and zoomed dm now set counted/grouped columns as primary key#2389
fix: count(), tally(), and summarise() on keyed tables and zoomed dm now set counted/grouped columns as primary key#2389
count(), tally(), and summarise() on keyed tables and zoomed dm now set counted/grouped columns as primary key#2389Conversation
…columns as primary key Co-authored-by: krlmlr <[email protected]>
count() and tally() on keyed tables now set counted/grouped columns as primary key
|
@copilot: Also fix for zooming, with tests. |
…umns as primary key Co-authored-by: krlmlr <[email protected]>
Co-authored-by: krlmlr <[email protected]>
Fixed in b138227. Both |
count() and tally() on keyed tables now set counted/grouped columns as primary keycount() and tally() on keyed tables and zoomed dm now set counted/grouped columns as primary key
|
@copilot: Add tests (and implement if needed) for |
Co-authored-by: krlmlr <[email protected]>
Fixed in b416792. |
count() and tally() on keyed tables and zoomed dm now set counted/grouped columns as primary keycount(), tally(), and summarise() on keyed tables and zoomed dm now set counted/grouped columns as primary key
|
This should become easier when zooming is implemented with keyed tables: #2391. Keeping open as reference and to review tests. |
count()ondm_keyed_tbldropped all primary keys instead of setting the counted columns as the new PK. Similarly,tally()andsummarise()ignored group vars. The same issue affected zoomed dm objects viadm_update_zoomed()anddm_insert_zoomed().count.dm_keyed_tbl(): Determine counting columns viagroup_by()+group_vars()on the...args, pass as newpk— mirrors the approach insummarise.dm_keyed_tbl()tally.dm_keyed_tbl(): Usegroup_vars(x)as newpk, consistent withsummarisecount.dm_zoomed(): Set counted columns as new PK via anew_pkattribute, picked up byupdate_zoomed_pk()duringdm_update_zoomed()/dm_insert_zoomed()tally.dm_zoomed(): Set group vars as new PK via the same mechanismsummarise.dm_zoomed(): Set group vars as new PK via the same mechanism (previously only preserved original PK if group columns matched, but did not set non-PK group columns as new PK)replace_zoomed_tbl(): Transfernew_pkattribute from zoomed table to col_tracker (keeping zoomed table clean)update_zoomed_pk(): Check fornew_pkattribute on tracked_cols before falling back to existing PK-preservation logiccount(),tally(), andsummarise()summarise()PK behaviorOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.