Skip to content

fix(beam): date a session by its first non-null time_anchor - #17

Open
100yenadmin wants to merge 1 commit into
MemTensor:mainfrom
electricsheephq:fix/beam-null-time-anchor
Open

100yenadmin wants to merge 1 commit into
MemTensor:mainfrom
electricsheephq:fix/beam-null-time-anchor

Conversation

@100yenadmin

Copy link
Copy Markdown
Contributor

Fixes #16.

Change

  • scripts/beam/beam_ingestion.py: new session_time_anchor(messages, default="January-01-2024") returns the first non-empty time_anchor in a session, else the default. Ingestion dates each session with it.
  • scripts/beam/beam_streaming.py: both session-date sites use the same helper.
  • scripts/tests/unit/test_beam_time_anchor.py: covers three cases: first-message anchor used, a null leading anchor falls through to the first non-null one, and missing or empty anchors fall back to the default.

Effect

  • On BEAM-10M only conversation 7 session 0 changes. It was previously an AttributeError that skipped the whole conversation; it is now dated March-05-2020. The other 99 sessions start with an anchor and keep the same date.
  • For other scales the date changes only for a session whose first message has no usable anchor but a later message does.

Tests

pytest scripts/tests/unit: 157 passed.

BEAM-10M conversation 7 session 0 opens with null time_anchor values, so
parse_beam_time(None) raised AttributeError before any of that user's
sessions was ingested. Use the first non-empty anchor in the session and
fall back to the existing default. The other 99 10M sessions start with an
anchor and keep their dates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BEAM-10M ingestion fails on conversation 7: null time_anchor reaches parse_beam_time

1 participant