Skip to content

Conversation

@martyngigg
Copy link
Contributor

@martyngigg martyngigg commented Jan 8, 2026

Summary

Use tz-naive column like in MSSQL and add LogicallyDeleted column.

Also removes unused table.

Summary by CodeRabbit

  • Refactoring
    • Enhanced downtime record management with improved data handling for entry tracking.
    • Optimised timestamp storage for consistency across entry records.
    • Streamlined record update processing to improve system efficiency.

✏️ Tip: You can customize this high-level summary in your review settings.

Use tz-naive column like in MSSQL and add LogicallyDeleted column.

Also removes unused table.
@coderabbitai
Copy link

coderabbitai bot commented Jan 8, 2026

📝 Walkthrough

Walkthrough

Modified ORM schema in opralogmodel.py by adding LogicallyDeleted column to Entries, converting EntryTimestamp and LastChangedDate columns from DateTime to TIMESTAMP, removing the LogbookEntryChanges model entirely, and updating the update_downtime_record function signature. Removed MCR_LOG_NAME argument from function call in init.py.

Changes

Cohort / File(s) Summary
ORM Model Schema and Signature Updates
warehouses/accelerator/extract_load/opralogweb/tests/fake_source/opralogmodel.py
Added LogicallyDeleted column (Text, non-nullable) to Entries table. Converted EntryTimestamp and LastChangedDate columns from DateTime to TIMESTAMP(timezone=False). Removed entire LogbookEntryChanges ORM model and associated changelog logging in insert/update operations. Updated update_downtime_record signature from (session, logbook_name, entry_id, record) to (session, entry_id, record).
Function Call Updates
warehouses/accelerator/extract_load/opralogweb/tests/fake_source/__init__.py
Removed MCR_LOG_NAME argument from update_downtime_record invocation in update_and_append_new_records.

Poem

🐰 In changes we scurry, through schema so deep,
LogicallyDeleted marks, records we keep,
DateTime hops now as TIMESTAMP instead,
LogbookEntryChanges vanishes—logs left unsaid,
And function signatures leap, lighter and bright!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: improving the fake database schema used for extract-load testing by adding a LogicallyDeleted column, updating datetime types, and removing unused tables.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 1110bcd and d1445d8.

📒 Files selected for processing (2)
  • warehouses/accelerator/extract_load/opralogweb/tests/fake_source/__init__.py
  • warehouses/accelerator/extract_load/opralogweb/tests/fake_source/opralogmodel.py
💤 Files with no reviewable changes (1)
  • warehouses/accelerator/extract_load/opralogweb/tests/fake_source/init.py
🔇 Additional comments (4)
warehouses/accelerator/extract_load/opralogweb/tests/fake_source/opralogmodel.py (4)

5-14: LGTM!

The TIMESTAMP import is correctly added to support the timezone-naive column definitions.


82-89: LGTM!

The changes align well with the PR objectives:

  • TIMESTAMP(timezone=False) correctly models timezone-naive datetime behaviour consistent with MSSQL.
  • LogicallyDeleted column addition with Text type likely mirrors the real database schema.

142-148: LGTM!

Correctly initialises LogicallyDeleted to "N" for new entries, satisfying the non-nullable constraint and following the expected soft-delete pattern.


192-210: Signature change looks correct.

The logbook_name parameter was unused in the function body (the query uses entry_id directly), so its removal is appropriate. The caller in __init__.py has been updated to match the new signature.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@martyngigg martyngigg merged commit 655c3aa into main Jan 8, 2026
3 checks passed
@martyngigg martyngigg deleted the fake-opralogdb-improvements branch January 8, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants