fix: use timezone=true on flow_version created_at field#12180
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:
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Important 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)
📝 Coding Plan
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 Tip CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.OpenGrep is compatible with Semgrep configurations. Add an |
Codecov Report❌ Patch coverage is
❌ Your project status has failed because the head coverage (44.32%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #12180 +/- ##
==========================================
+ Coverage 38.36% 38.38% +0.01%
==========================================
Files 1630 1630
Lines 80250 80251 +1
Branches 12114 12114
==========================================
+ Hits 30791 30804 +13
+ Misses 47723 47711 -12
Partials 1736 1736
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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/backend/base/langflow/services/database/models/flow_version/model.py`:
- Around line 26-28: The created_at column uses server_default=func.now() but
the ORM object lacks the default value at return, causing Pydantic validation to
fail; fix by either enabling eager server defaults on the model mapper (add
eager_defaults=True to the FlowVersion model mapper/config where created_at:
Field(...) is defined) so SQL defaults are loaded into the instance, or after
creating the DB row in create_flow_version_entry() call session.refresh(entry)
(await if async) after flush/commit and before returning the entry so created_at
is populated for FlowVersionRead.model_validate(...).
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5b660232-abf9-4d18-bff5-3af3a6321e60
📒 Files selected for processing (1)
src/backend/base/langflow/services/database/models/flow_version/model.py
Adam-Aghili
left a comment
There was a problem hiding this comment.
Just to validate my understanding we are now making the DB the source of truth for timestamps?
If my understanding is correct LGTM!
Adds a missing timezone=true to a field. Migration already has this correctly.
Summary by CodeRabbit