Skip to content

chore: move janitor functions to janitor.py#5510

Merged
eakmanrq merged 1 commit intomainfrom
eakmanrq/create_janitor_file
Oct 8, 2025
Merged

chore: move janitor functions to janitor.py#5510
eakmanrq merged 1 commit intomainfrom
eakmanrq/create_janitor_file

Conversation

@eakmanrq
Copy link
Collaborator

@eakmanrq eakmanrq commented Oct 8, 2025

Follow up from this discussion: #5486 (comment)

@eakmanrq eakmanrq requested a review from Copilot October 8, 2025 17:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR moves janitor functions from the sqlmesh.core.state_sync.common module to a new dedicated sqlmesh.core.janitor module, following discussions in PR #5486. This refactoring improves code organization by centralizing cleanup functionality.

Key changes:

  • Creates a new sqlmesh.core.janitor module containing cleanup_expired_views and delete_expired_snapshots functions
  • Moves associated test functions to tests.core.test_janitor
  • Updates imports throughout the codebase to reference the new module location

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/core/test_janitor.py New test file containing moved janitor function tests
tests/core/state_sync/test_state_sync.py Removed janitor-related tests and cleaned up unused imports
sqlmesh/core/state_sync/common.py Removed janitor functions and their dependencies
sqlmesh/core/state_sync/__init__.py Removed cleanup_expired_views import
sqlmesh/core/janitor.py New module containing moved janitor functions
sqlmesh/core/context.py Updated imports to use new janitor module

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@izeigerman izeigerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@eakmanrq eakmanrq force-pushed the eakmanrq/create_janitor_file branch from 1e5cee5 to e2fed7e Compare October 8, 2025 17:46
@eakmanrq eakmanrq force-pushed the eakmanrq/create_janitor_file branch from e2fed7e to 4147dcc Compare October 8, 2025 18:06
@eakmanrq eakmanrq merged commit e1510ce into main Oct 8, 2025
33 of 37 checks passed
@eakmanrq eakmanrq deleted the eakmanrq/create_janitor_file branch October 8, 2025 18:45
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.

3 participants