Skip to content

Commit

Permalink
Fix(Logging) Remove housekeeper warning (#4051)
Browse files Browse the repository at this point in the history
### Changed

- Removed the `getattr` redirect on `HousekeeperAPI`
  • Loading branch information
Vince-janv authored Jan 7, 2025
1 parent b642f58 commit b7d34da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
12 changes: 2 additions & 10 deletions cg/apps/housekeeper/hk.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@

from housekeeper.include import checksum as hk_checksum
from housekeeper.include import include_version
from housekeeper.store.database import (
create_all_tables,
drop_all_tables,
initialize_database,
)
from housekeeper.store.database import create_all_tables, drop_all_tables, initialize_database
from housekeeper.store.models import Archive, Bundle, File, Tag, Version
from housekeeper.store.store import Store
from sqlalchemy.orm import Query
Expand All @@ -27,17 +23,13 @@


class HousekeeperAPI:
"""API to decouple cg code from Housekeeper"""
"""API to decouple cg code from Housekeeper."""

def __init__(self, config: dict) -> None:
initialize_database(config["housekeeper"]["database"])
self._store = Store(config["housekeeper"]["root"])
self.root_dir: str = config["housekeeper"]["root"]

def __getattr__(self, name):
LOG.warning(f"Called undefined {name} on {self.__class__.__name__}, please wrap")
return getattr(self._store, name)

def new_bundle(self, name: str, created_at: datetime = None) -> Bundle:
"""Create a new file bundle."""
return self._store.new_bundle(name, created_at)
Expand Down
20 changes: 0 additions & 20 deletions tests/apps/hk/test__getattr__.py

This file was deleted.

0 comments on commit b7d34da

Please sign in to comment.