Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
elhoim
force-pushed
the
fix/t39-dataframe-append-removed-in-pandas-2-cra
branch
from
October 1, 2026 07:08
10b1102 to
870d212
Compare
EvtxGapPlugin.run() called event_count.append(), which pandas 2.0 removed; with pandas>=3.0.3 every run that found missing days raised AttributeError after the story was half built. Use pd.concat instead and add a run() regression test covering the missing-day path.
elhoim
force-pushed
the
fix/t39-dataframe-append-removed-in-pandas-2-cra
branch
from
October 9, 2026 20:04
870d212 to
37cebdf
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BLUF
AttributeErrorwhenever it finds gaps.win_evtxgap.py:258callsDataFrame.append, which pandas 2.0 removed, andrequirements.txtpinspandas>=3.0.3.event_count.append(df_append, sort=False)topd.concat([event_count, df_append], sort=False).TestEvtxGapPlugin.test_run_with_missing_days, a new end-to-end test ofrun().masterwith the AttributeError and passes with the fix (module result: 2 passed, 2 skipped).black --checkandpylint --rcfile=.pylintrc(Python 3.14, as in the CI matrix) are clean on both changed files.AttributeErrorwhenever it finds gaps.win_evtxgap.py:258callsDataFrame.append, which pandas 2.0 removed, andrequirements.txtpinspandas>=3.0.3.event_count.append(df_append, sort=False)topd.concat([event_count, df_append], sort=False).Details
What was wrong
EvtxGapPlugin.run()builds a story when it finds both missing days and record-number gaps. It then pads the per-day counts with the missing days usingDataFrame.append. On pandas 3.x that line raises:By that point the story text and the "Top EVTX Sources" aggregation are already saved. The run leaves a half-built story and a failed analysis. The "Event Records Per Day" chart and the record-number gap section, which is the evidence of log clearing, are never written.
This line runs only when both
missing_rangesandrecord_gapsare non-empty, because of the early return before it. That condition holds for every run that produces a gap story, so all of those runs crashed.Reproducing input
Security records
#1and#2on 2020-01-01, and record#5on 2020-01-03. The analyzer raisesAttributeErrorinstead of finishing the story.Fix
pd.concatbehaves the same way here. Thesort_values("day")that follows restores the row order, and the extratimestampcolumn is still removed afterwards.Regression test
The test mocks
event_pandasand the sketch. The sketch mock needsid=1, because the story text formatsself.sketch.idwith{:d}. The test checks thatrun()reports gaps and that themanual_feedaggregation contains{"20200101": 2, "20200102": 0, "20200103": 1}.Checks
Closing issues
No issue is linked to this PR yet.