[codex] Add signal endpoints#204
Conversation
📝 WalkthroughWalkthroughThree new signal query endpoints— ChangesSignal Query Endpoints
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
da14fe5 to
5dff95f
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@san/sanbase_graphql.py`:
- Line 171: The code currently does a raw kwargs.pop("signal") which raises
KeyError if omitted; replace this with an explicit presence check and raise
SanError instead (e.g., if "signal" not in kwargs: raise SanError("missing
required 'signal' argument") else signal = kwargs.pop("signal")), and ensure
SanError is imported/available in the module so the function that uses signal
(the block referencing kwargs.pop("signal")) returns a stable API error rather
than leaking KeyError.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2d327524-fb94-42cc-af0d-487d2d3b2b5a
📒 Files selected for processing (6)
san/param_validation.pysan/query_constants.pysan/sanbase_graphql.pysan/sanbase_graphql_helper.pysan/tests/test_get.pysan/transform.py
282d150 to
edfb125
Compare
edfb125 to
a4cefdb
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Around line 386-401: The example fails because the san module is not imported;
add "import san" at the top of the snippet so calls to san.available_signals(),
san.get_signal(...), and san.get_raw_signals(...) run without NameError; ensure
the import appears before those function calls in the README example.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e6ad443d-137e-4afe-a90c-f9499989d31a
📒 Files selected for processing (5)
README.mdsan/__init__.pysan/param_validation.pysan/signals.pysan/tests/test_signals.py
🚧 Files skipped from review as they are similar to previous changes (1)
- san/param_validation.py
| ```python | ||
| signals = san.available_signals() | ||
|
|
||
| signal_data = san.get_signal( | ||
| "anomaly_total_liquidations", | ||
| slug="ethereum", | ||
| from_date="2026-01-01", | ||
| to_date="2026-05-18", | ||
| ) | ||
|
|
||
| raw_signals = san.get_raw_signals( | ||
| signals=["anomaly_total_liquidations"], | ||
| from_date="2026-01-01", | ||
| to_date="2026-05-18", | ||
| ) | ||
| ``` |
There was a problem hiding this comment.
Make the signal example copy-paste runnable.
This snippet uses san without importing it, so it fails with NameError when run as-is.
Suggested docs fix
```python
+import san
+
signals = san.available_signals()
signal_data = san.get_signal(
"anomaly_total_liquidations",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@README.md` around lines 386 - 401, The example fails because the san module
is not imported; add "import san" at the top of the snippet so calls to
san.available_signals(), san.get_signal(...), and san.get_raw_signals(...) run
without NameError; ensure the import appears before those function calls in the
README example.
Summary
san.available_signals(),san.get_signal(signal, ...), andsan.get_raw_signals(...).san.get(metric, ...)so the first positional argument remains the metric identifier.slug/selectorfor time-windowed raw event fetches.Validation
pytest san/tests/test_signals.pyinitially failed before implementation, then passed after adding the wrappers.pytestruff check .git diff --checkavailable_signals()returned 12 names,get_raw_signals(...)returned 23 rows, andget_signal(...)returned 12 rows for the tested window.Summary by CodeRabbit
New Features
available_signals(),get_signal(), andget_raw_signals()for retrieving signals and anomaly events.Documentation