Secondary suppressions are lost when `split_tab = TRUE`
まだ誰も着手していません。
評価
調査の方向性
Start by reading tab_multi_manager() and the tab_rtauargus2() split branch, especially where split results are merged and the final suppression pattern is selected. Reproduce the provided example with split_tab = TRUE, then reverse the table order and inspect the intermediate column names. Done means primary and secondary suppressions are preserved in the returned tables regardless of input order, with regression coverage for repeated manager treatments.
索引モデルが issue の本文から書いたものです。
説明
Description
When split_tab = TRUE, tab_multi_manager() can silently drop secondary suppressions from the returned tables. The issue appears to depend on the order in which tables are processed.
In the example below, τ-Argus subtable logs report secondary suppressions, but these are not all reflected in the returned master table. Reversing the order of the input tables changes which table is affected, despite the underlying data remaining unchanged.
Steps to reproduce
library(rtauargus)
library(dplyr)
data("datatest2")
v <- names(datatest2)[1:5]
agg <- function(keep) {
datatest2 |>
summarise(
pizzas_tot_abs = sum(pizzas_tot_abs),
nb_obs_rnd = sum(nb_obs_rnd),
.by = all_of(keep)
) |>
mutate(is_secret_prim = nb_obs_rnd > 0 & nb_obs_rnd < 5)
}
t1 <- agg(v[1:4])
t2 <- agg(v[c(1:3, 5)])
res <- tab_multi_manager(
list_tables = list(t1 = t1, t2 = t2),
list_explanatory_vars = list(t1 = v[1:4], t2 = v[c(1:3, 5)]),
dir_name = "tauargus_files",
value = "pizzas_tot_abs",
freq = "nb_obs_rnd",
secret_var = "is_secret_prim",
totcode = "Total",
split_tab = TRUE
)
sapply(res, function(r) {
fin <- as.logical(r[[ncol(r)]])
prim <- as.logical(r$is_secret_prim)
c(
primaries = sum(prim),
secondaries = sum(fin & !prim, na.rm = TRUE)
)
})
Reversing the order of t1 and t2 in list_tables and list_explanatory_vars changes which table exhibits the problem.
Observed behavior
- τ-Argus subtable logs report secondary suppressions that are missing from the returned master table.
- The issue appears on subsequent manager treatments, when a previously generated suppression-pattern column is reused as
secret_var. - The affected table depends on the processing order.
- The problem appears to be specific to the split-table processing path.
For example, in one run, the logs for t2 report the following counts for its two subtables across three manager passes:
t2_1.txt: 243, 33, 2t2_2.txt: 186, 14, 2
However, the returned master table does not retain all the secondary suppressions reported by τ-Argus.
Suspected cause
Two interacting issues may explain the behavior.
1. Column-name collision in the split path
During subsequent manager treatments, tab_multi_manager() passes a previously generated column as secret_var, for example is_secret_1.
The split runner also generates an iteration column with that name. When the results are merged, duplicate names can be disambiguated using suffixes such as .x and .y. The original input suppression indicator may then be appended as the last column, after the genuine final suppression pattern.
For example, the returned data frame may contain columns resembling:
value
freq
is_secret_1.x
is_secret_1.y
is_secret_2
is_secret_3
is_secret_4
is_secret_1
Consequently, the final column may no longer represent the final suppression pattern.
2. The final suppression pattern is inferred positionally
In tab_rtauargus2, the split branch identifies the final pattern using the last column:
last_iteration <- names(res)[length(names(res))]
res$Status <- ifelse(
res[[secret_var]], "B",
ifelse(res[[last_iteration]], "D", "V")
)
If the last column is the re-appended a priori suppression indicator rather than the genuine final pattern, secondary suppressions are incorrectly classified as visible. The secondary suppressions computed by τ-Argus are therefore silently discarded from the returned result.
This suspected mechanism should be confirmed by inspecting the merged intermediate data frame in a failing run.
Expected behavior
- All primary and secondary suppressions calculated by τ-Argus should be preserved in the returned master table.
- The result should not depend on the order in which the input tables are supplied.
- The final suppression pattern should be identified reliably, including when
split_tab = TRUEand multiple manager treatments are performed.
Suggested fix
Avoid identifying the final suppression pattern solely by its position in the data frame.
Possible approaches include:
- Explicitly track the name of the final iteration column generated by the split runner.
- Rename the incoming a priori suppression indicator to a reserved name, such as
is_secret_apriori, before splitting to prevent collisions with generatedis_secret_<n>columns. - Select the final pattern from the columns generated during the current call, rather than assuming the last column is the final pattern.
Explicit tracking of generated iteration columns would be the most robust approach.
Regression tests
Add tests covering the following cases:
split_tab = TRUEwith at least two tables.- Reversing the order of the input tables must not change the correctness of the suppression results.
- Multiple manager treatments, where a previously generated suppression-pattern column is passed as
secret_var. - Verification that the secondary suppressions in the returned master table are consistent with the final suppression patterns reported by τ-Argus.
- 主要言語
- HTML
- スター
- 12
- フォーク
- 6
- 平均マージ
- 36分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
InseeFrLab/rtauargus のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
InseeFrLab/rtauargus#67 · コメント 1 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
InseeFrLab/rtauargus#63 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
InseeFrLab/rtauargus#66 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
InseeFrLab/rtauargus#58 ·
-
Améliorer le message renvoyé par `analyse_metadata`再び着手できるかも @clara-baudry が 114 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
InseeFrLab/rtauargus#48 · コメント 2 件 · 担当者 1 名 ·
InseeFrLab/rtauargus の issue をすべて見る
似ている issue
-
fix(api): optimize-for-web /preview outer catches miss asDecoderOutOfMemory on V8 OOM and SIGKILLオープンarea: backend bug priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
snapotter-hq/SnapOtter#3773 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
khuisman/mcp-gee-sweet#1166 ·
メンテナーはふだん 1 日以内に返信
-
control-plane security
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Usenova-Labs/usenova-backend#29 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
gramaziokohler/compas_timber#870 ·
-
queue stdout mixes human notices with JSON: move trailer + compact notice + receipt text to stderrオープンarea: queue-scope bug confirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mvschwarz/openrig#1806 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信