feat(components): add Adanos market sentiment bundle - #14155
feat(components): add Adanos market sentiment bundle#14155alexander-schneider wants to merge 3 commits into
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughAdds the ChangesAdanos bundle
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Langflow
participant AdanosMarketSentimentComponent
participant AdanosAPI
Langflow->>AdanosMarketSentimentComponent: provide operation and request inputs
AdanosMarketSentimentComponent->>AdanosAPI: GET sentiment endpoint with headers and parameters
AdanosAPI-->>AdanosMarketSentimentComponent: return JSON response
AdanosMarketSentimentComponent-->>Langflow: return Data and update status
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 8 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (8 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
docs/docs/Components/bundles-adanos.mdx (1)
17-17: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueCapitalize "Component" and "Flows".
As per coding guidelines and learnings, capitalize the word "Component" when referring to a specific Langflow Component entity (in this case, the Adanos Market Sentiment Component) and capitalize "Flows" when referring to Langflow flows.
📝 Proposed fix
-The Adanos Market Sentiment component retrieves read-only market sentiment data for use in agents, prompts, and data-processing flows. It supports individual assets, trending assets, and aggregate market sentiment. +The Adanos Market Sentiment Component retrieves read-only market sentiment data for use in agents, prompts, and data-processing Flows. It supports individual assets, trending assets, and aggregate market sentiment.🤖 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 `@docs/docs/Components/bundles-adanos.mdx` at line 17, Update the description for the Adanos Market Sentiment component to capitalize “Component” when referring to the Langflow entity and “Flows” when referring to Langflow flows, without changing the surrounding meaning.Sources: Coding guidelines, Learnings
src/bundles/adanos/tests/test_adanos_market_sentiment.py (1)
13-24: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winTest coverage gap:
SecretStrInput/get_secret_value()path is untested.
_secret_value(component file, Lines 101-104) branches onhasattr(value, "get_secret_value"), but every test assignscomponent.api_keyas a plain string, so that branch — the realistic path when Langflow passes an actualSecretStr-like object — is never exercised.✅ Suggested additional test
+def test_secret_value_unwraps_secret_str_like_object() -> None: + class _FakeSecret: + def get_secret_value(self) -> str: + return "unwrapped-key" + + assert AdanosMarketSentimentComponent._secret_value(_FakeSecret()) == "unwrapped-key"Based on path instructions, "verify the tests actually cover the new or changed behavior rather than acting as placeholders."
Also applies to: 148-152
🤖 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 `@src/bundles/adanos/tests/test_adanos_market_sentiment.py` around lines 13 - 24, Add coverage in the AdanosMarketSentimentComponent tests for the api_key path where the value exposes get_secret_value(), using a SecretStr-like test value and asserting the component uses the extracted secret. Update the shared component fixture or add a focused test without removing existing plain-string coverage, and ensure the related tests around _secret_value exercise both branches.Source: Path instructions
src/bundles/adanos/src/lfx_adanos/components/adanos/adanos_market_sentiment.py (1)
55-67: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winHide
sourcefor Crypto.sourceis ignored whenasset_type == "Crypto"because the request path always uses/reddit/crypto/v1, so the dropdown lets users pick values that have no effect. Hide or disable the field in Crypto mode.🤖 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 `@src/bundles/adanos/src/lfx_adanos/components/adanos/adanos_market_sentiment.py` around lines 55 - 67, The asset_type and source inputs currently allow irrelevant source selection for Crypto. Update the component containing these DropdownInput definitions so the source field is hidden or disabled whenever asset_type is "Crypto", while keeping it available for Stocks and preserving the existing stock-source options and default.
🤖 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.
Nitpick comments:
In `@docs/docs/Components/bundles-adanos.mdx`:
- Line 17: Update the description for the Adanos Market Sentiment component to
capitalize “Component” when referring to the Langflow entity and “Flows” when
referring to Langflow flows, without changing the surrounding meaning.
In
`@src/bundles/adanos/src/lfx_adanos/components/adanos/adanos_market_sentiment.py`:
- Around line 55-67: The asset_type and source inputs currently allow irrelevant
source selection for Crypto. Update the component containing these DropdownInput
definitions so the source field is hidden or disabled whenever asset_type is
"Crypto", while keeping it available for Stocks and preserving the existing
stock-source options and default.
In `@src/bundles/adanos/tests/test_adanos_market_sentiment.py`:
- Around line 13-24: Add coverage in the AdanosMarketSentimentComponent tests
for the api_key path where the value exposes get_secret_value(), using a
SecretStr-like test value and asserting the component uses the extracted secret.
Update the shared component fixture or add a focused test without removing
existing plain-string coverage, and ensure the related tests around
_secret_value exercise both branches.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 594df418-88cc-44a8-a191-97e506a78048
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (12)
docs/docs/Components/bundles-adanos.mdxdocs/docs/_partial-bundle-graduated-install.mdxdocs/sidebars.jspyproject.tomlsrc/bundles/adanos/README.mdsrc/bundles/adanos/pyproject.tomlsrc/bundles/adanos/src/lfx_adanos/__init__.pysrc/bundles/adanos/src/lfx_adanos/components/adanos/__init__.pysrc/bundles/adanos/src/lfx_adanos/components/adanos/adanos_market_sentiment.pysrc/bundles/adanos/src/lfx_adanos/extension.jsonsrc/bundles/adanos/tests/test_adanos_market_sentiment.pysrc/frontend/src/utils/styleUtils.ts
|
Addressed the current review feedback in
Local verification: |
Summary
lfx-adanosas a standalone Langflow Extension BundleWhy a bundle
Adanos is a self-contained external data provider, so the integration follows Langflow 1.11's standalone extension-bundle architecture. It is additive and does not alter agents, prompts, trading logic, or existing components. Because this is a new component, no legacy-flow migration entries are required.
Validation
uv run --package lfx-adanos --with pytest pytest src/bundles/adanos/tests -q- 21 passeduvx ruff format --check src/bundles/adanosuvx ruff check src/bundles/adanosuv run --package lfx-adanos lfx extension validate src/bundles/adanos/src/lfx_adanosuv build --package lfx-adanosgit diff --checkAll HTTP behavior is covered with mocked responses; no Adanos API key or live network request is required by the test suite.
API keys can be created at https://adanos.org/register and the API reference is at https://api.adanos.org/docs.
Summary by CodeRabbit
New Features
Documentation
Tests