-
Notifications
You must be signed in to change notification settings - Fork 390
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: add status
as persisted column for records
table
#5132
feat: add status
as persisted column for records
table
#5132
Conversation
…-as-persisted-column-to-records
…-as-persisted-column-to-records
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat/support-record-status-filter #5132 +/- ##
==================================================================
Coverage 91.99% 91.99%
==================================================================
Files 136 137 +1
Lines 5881 5896 +15
==================================================================
+ Hits 5410 5424 +14
- Misses 471 472 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -821,7 +821,7 @@ async def test_list_current_user_dataset_records( | |||
"items": [ | |||
{ | |||
"id": str(record_a.id), | |||
"status": RecordStatus.completed, | |||
"status": RecordStatus.pending, |
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.
Why all these tests are changing the expected status?
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.
As commented in a call, the status
is not calculated on-the-fly anymore (now is persisted on database) so factories are not modifying the status
(only our handlers are doing that) so the values are now pending
by default.
@@ -67,6 +68,7 @@ async def create_records_bulk(self, dataset: Dataset, bulk_create: RecordsBulkCr | |||
|
|||
await self._upsert_records_relationships(records, bulk_create.items) | |||
await _preload_records_relationships_before_index(self._db, records) | |||
await distribution.update_records_status(self._db, records, autocommit=False) |
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.
Can we just remove the autocommit=False
argument and handle this internally in the distribution context?
else: | ||
record.status = RecordStatus.pending | ||
|
||
return await record.save(db, autocommit) |
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.
We're not using autocommit=True
anywhere. I suggest setting it to False by default and stopping exposing it to the outside.
return await record.save(db, autocommit) | |
return await record.save(db, autocommit=False) |
Description
Add
status
as a persisted database column forrecords
table.