-
Notifications
You must be signed in to change notification settings - Fork 8k
fix: move sql database to data source category #10651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughSQLComponent is being relocated from the utilities module to the data_source module. Import paths in test files are updated accordingly, and module-level exports adjusted to reflect the new component location. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Pre-merge checks and finishing touchesImportant Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning, 1 inconclusive)
✅ Passed checks (4 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10651 +/- ##
==========================================
- Coverage 31.61% 31.61% -0.01%
==========================================
Files 1348 1348
Lines 61117 61099 -18
Branches 9134 9129 -5
==========================================
- Hits 19324 19314 -10
+ Misses 40878 40873 -5
+ Partials 915 912 -3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/backend/tests/unit/base/tools/test_component_toolkit.py(1 hunks)src/backend/tests/unit/components/data_source/test_sql_executor.py(1 hunks)src/lfx/src/lfx/components/data_source/__init__.py(3 hunks)src/lfx/src/lfx/components/utilities/__init__.py(0 hunks)
💤 Files with no reviewable changes (1)
- src/lfx/src/lfx/components/utilities/init.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-05T22:51:27.961Z
Learnt from: edwinjosechittilappilly
Repo: langflow-ai/langflow PR: 0
File: :0-0
Timestamp: 2025-08-05T22:51:27.961Z
Learning: The TestComposioComponentAuth test in src/backend/tests/unit/components/bundles/composio/test_base_composio.py demonstrates proper integration testing patterns for external API components, including real API calls with mocking for OAuth completion, comprehensive resource cleanup, and proper environment variable handling with pytest.skip() fallbacks.
Applied to files:
src/backend/tests/unit/base/tools/test_component_toolkit.pysrc/backend/tests/unit/components/data_source/test_sql_executor.py
🧬 Code graph analysis (3)
src/lfx/src/lfx/components/data_source/__init__.py (1)
src/lfx/src/lfx/components/data_source/sql_executor.py (1)
SQLComponent(16-101)
src/backend/tests/unit/base/tools/test_component_toolkit.py (1)
src/lfx/src/lfx/components/data_source/sql_executor.py (1)
SQLComponent(16-101)
src/backend/tests/unit/components/data_source/test_sql_executor.py (1)
src/lfx/src/lfx/components/data_source/sql_executor.py (1)
SQLComponent(16-101)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
- GitHub Check: Lint Backend / Run Mypy (3.10)
- GitHub Check: Lint Backend / Run Mypy (3.11)
- GitHub Check: Lint Backend / Run Mypy (3.13)
- GitHub Check: Lint Backend / Run Mypy (3.12)
- GitHub Check: Run Frontend Tests / Determine Test Suites and Shard Distribution
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
- GitHub Check: Run Frontend Unit Tests / Frontend Jest Unit Tests
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
- GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
- GitHub Check: Run Backend Tests / LFX Tests - Python 3.10
- GitHub Check: Test Starter Templates
- GitHub Check: Update Component Index
🔇 Additional comments (2)
src/backend/tests/unit/base/tools/test_component_toolkit.py (1)
6-6: LGTM! Import path correctly updated.The import path has been properly updated to reflect SQLComponent's relocation to the data_source module, consistent with the changes in other test files.
src/lfx/src/lfx/components/data_source/__init__.py (1)
14-14: LGTM! SQLComponent correctly moved to data_source module and properly exported.Verification confirms:
sql_executor.pysuccessfully moved tosrc/lfx/src/lfx/components/data_source/SQLComponentclass properly defined at the new location- Entry removed from utilities module
- Lazy-loading configuration in
__init__.py(lines 14, 27, 37) correctly implemented following established patterns
|
|
||
| import pytest | ||
| from lfx.components.utilities.sql_executor import SQLComponent | ||
| from lfx.components.data_source.sql_executor import SQLComponent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
LGTM! Import path correctly updated.
The import path has been properly updated to reflect SQLComponent's new location in the data_source module.
Run the following script to verify all imports have been updated codebase-wide:
🏁 Script executed:
#!/bin/bash
# Description: Verify no remaining imports from the old utilities path
# Search for any remaining imports from the old path
echo "Checking for old import path references..."
rg -n "from lfx\.components\.utilities\.sql_executor import" --type=py
# Search for any references to utilities.sql_executor or utilities.SQLComponent
echo "Checking for other old path references..."
rg -n "utilities\.sql_executor|utilities\.SQLComponent" --type=py
# Verify the new import path is being used
echo "Verifying new import path usage..."
rg -n "from lfx\.components\.data_source\.sql_executor import SQLComponent" --type=pyLength of output: 622
---
🏁 Script executed:
```shell
#!/bin/bash
# Get context around the dynamic import on line 81
rg -n -B5 -A5 "import_module.*utilities\.sql_executor" --type=py src/lfx/src/lfx/components/data/__init__.py
Length of output: 420
Update dynamic import path in src/lfx/src/lfx/components/data/init.py
A dynamic import still references the old path. Line 81 needs to be updated from:
result = import_module("lfx.components.utilities.sql_executor")to:
result = import_module("lfx.components.data_source.sql_executor")Also update the outdated comment on line 77 from "SQLComponent was moved to utilities" to "SQLComponent was moved to data_source".
🤖 Prompt for AI Agents
In src/lfx/src/lfx/components/data/__init__.py around lines 77 to 81, update the
outdated comment and the dynamic import: change the comment on line 77 from
"SQLComponent was moved to utilities" to "SQLComponent was moved to data_source"
and replace the import_module call on line 81 from
import_module("lfx.components.utilities.sql_executor") to
import_module("lfx.components.data_source.sql_executor") so the dynamic import
points to the new module path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keval718 this seems relevent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
-- Move SQL database to Data Source category
Summary by CodeRabbit
Refactor
Tests