-
Notifications
You must be signed in to change notification settings - Fork 5
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
[REF] Move environment variable handling to Pydantic BaseSettings
class
#416
base: main
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request refactors the application to use Pydantic's Sequence diagram for accessing graph databasesequenceDiagram
participant App
participant Settings
participant httpx
App->>Settings: Access settings.query_url, settings.graph_username, settings.graph_password
Settings-->>App: Return values
App->>httpx: Post query to graph database using httpx.post(url=settings.query_url, auth=(settings.graph_username, settings.graph_password))
httpx-->>App: Return response
Updated class diagram for SettingsclassDiagram
class Settings {
+root_path: str
+allowed_origins: str
+graph_username: str | None
+graph_password: str | None
+graph_address: str
+graph_db: str
+graph_port: int
+return_agg: bool
+min_cell_size: int
+auth_enabled: bool
+client_id: str | None
+query_url: str
}
note for Settings "Pydantic BaseSettings class for managing environment variables"
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #416 +/- ##
==========================================
+ Coverage 97.24% 97.30% +0.05%
==========================================
Files 24 26 +2
Lines 835 852 +17
==========================================
+ Hits 812 829 +17
Misses 23 23 ☔ View full report in Codecov by Sentry. |
pydantic-settings
#316Changes proposed in this pull request:
Settings
class using pydantic-settingsHousekeeping:
Checklist
This section is for the PR reviewer
[ENH]
,[FIX]
,[REF]
,[TST]
,[CI]
,[MNT]
,[INF]
,[MODEL]
,[DOC]
) (see our Contributing Guidelines for more info)skip-release
(to be applied by maintainers only)Closes #XXXX
For new features:
For bug fixes:
Summary by Sourcery
This pull request refactors the application to use Pydantic's
BaseSettings
for managing environment variables. This change improves code maintainability and type safety by centralizing environment variable configuration and validation within a dedicated settings class. The application now uses a settings object to access environment variables, and tests have been updated to reflect this change.Enhancements:
BaseSettings
class for improved type safety and validation.Tests:
Summary by Sourcery
Refactors the application to use Pydantic's
BaseSettings
for managing environment variables, improving code maintainability and type safety. Tests have been updated to reflect this change.Enhancements:
BaseSettings
class for improved type safety and validation.Tests:
Chores: