You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: decouple export and slackbot from file I/O
- Add prepare_events() for in-memory dedupe, sort, and date formatting
- Add fmt_events() to slackbot for direct list[dict] formatting
- Add optional df param to export_to_file to skip format_response
- Refactor get_events/post_slack endpoints to use in-memory data flow
- Refactor fmt_json to delegate to fmt_events
Closes TASK-014
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
-`prepare_events(df)`: New function extracted from `sort_json()` logic — deduplicates, normalizes dates, sorts, filters past events, formats dates. Returns `list[dict]` in memory.
67
+
68
+
### app/slackbot.py
69
+
-`fmt_events(events)`: New function that formats a list of event dicts into Slack message strings (extracted from `fmt_json`).
70
+
-`fmt_json()`: Refactored to delegate to `fmt_events()` for backward compatibility.
71
+
72
+
### app/main.py
73
+
-`get_events()`: Collects DataFrames from `format_response()` calls, concatenates them, passes to `prepare_events()`. No file I/O.
74
+
-`post_slack()`: Uses return value from `get_events()` and passes directly to `fmt_events()`. No file reading.
0 commit comments