-
Notifications
You must be signed in to change notification settings - Fork 5k
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
feat: Centralize database connection settings and deprecate old parameters #5960
Merged
+61
−11
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduce a new `db_connection_settings` dictionary to centralize database connection parameters. Mark `pool_size` and `max_overflow` as deprecated, recommending the use of the new configuration dictionary instead.
Add a method to build connection kwargs that merges deprecated settings with the new db_connection_settings, providing a more flexible and backwards-compatible approach to database connection configuration.
dosubot
bot
added
size:M
This PR changes 30-99 lines, ignoring generated files.
enhancement
New feature or request
labels
Jan 27, 2025
github-actions
bot
added
enhancement
New feature or request
and removed
enhancement
New feature or request
labels
Jan 27, 2025
Explicitly set AsyncAdaptedQueuePool for SQLite connections to address potential async engine configuration issues. This ensures proper pool handling when creating database connections, particularly for SQLite databases.
github-actions
bot
added
enhancement
New feature or request
and removed
enhancement
New feature or request
labels
Jan 27, 2025
CodSpeed Performance ReportMerging #5960 will improve performances by 54.9%Comparing Summary
Benchmarks breakdown
|
deon-sanchez
approved these changes
Jan 28, 2025
github-actions
bot
added
enhancement
New feature or request
and removed
enhancement
New feature or request
labels
Jan 28, 2025
ogabrielluiz
removed this pull request from the merge queue due to the queue being cleared
Jan 29, 2025
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jan 29, 2025
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jan 29, 2025
Enhance test coverage for `load_bundles_from_urls()` by introducing a mock fixture to simulate zip file content and mocking HTTP requests. This allows testing the bundle loading mechanism without making actual network calls.
dosubot
bot
added
size:L
This PR changes 100-499 lines, ignoring generated files.
and removed
size:M
This PR changes 30-99 lines, ignoring generated files.
labels
Jan 29, 2025
github-actions
bot
added
enhancement
New feature or request
and removed
enhancement
New feature or request
labels
Jan 29, 2025
dosubot
bot
added
size:M
This PR changes 30-99 lines, ignoring generated files.
and removed
size:L
This PR changes 100-499 lines, ignoring generated files.
labels
Jan 29, 2025
github-actions
bot
added
enhancement
New feature or request
and removed
enhancement
New feature or request
labels
Jan 29, 2025
…erage Refactor `test_detect_github_url` to use AsyncMock and patch for more robust testing of GitHub URL detection, including verification of API calls and handling of different URL scenarios.
github-actions
bot
added
enhancement
New feature or request
and removed
enhancement
New feature or request
labels
Jan 29, 2025
cbornet
reviewed
Jan 29, 2025
# Even though the docs say this is the default, it raises an error | ||
# if we don't specify it. | ||
# https://docs.sqlalchemy.org/en/20/errors.html#pool-class-cannot-be-used-with-asyncio-engine-or-vice-versa | ||
pool = AsyncAdaptedQueuePool |
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.
NIT: could do
kwargs["poolclass"] = AsyncAdaptedQueuePool
and remove pool = None
in the else branch.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
lgtm
This PR has been approved by a maintainer
size:M
This PR changes 30-99 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to the
DatabaseService
andSettings
classes to improve database connection handling and configuration. The main changes involve the introduction of new connection settings, deprecating old settings, and refactoring the code to use the new settings.Database connection handling improvements:
AsyncAdaptedQueuePool
(src/backend/base/langflow/services/database/service.py
)._build_connection_kwargs
method to merge deprecated settings with newdb_connection_settings
and log warnings for deprecated settings (src/backend/base/langflow/services/database/service.py
)._create_engine
method to use the newdb_connection_settings
and handle connection pool settings appropriately (src/backend/base/langflow/services/database/service.py
).Configuration updates:
pool_size
andmax_overflow
settings in favor ofdb_connection_settings
(src/backend/base/langflow/services/settings/base.py
).db_connection_settings
to theSettings
class to consolidate common database connection settings (src/backend/base/langflow/services/settings/base.py
).