Skip to content

Conversation

@dimitri-yatsenko
Copy link
Member

@dimitri-yatsenko dimitri-yatsenko commented Dec 25, 2025

Fix #1298 - Deprecate the ~log table.

  • Add module docstrings to cli.py, admin.py, logging.py, and hash.py
  • Add from __future__ import annotations for PEP 563 deferred evaluation
  • Modernize type hints using Python 3.10+ syntax (X | None instead of Optional[X])
  • Use TYPE_CHECKING imports to avoid circular dependencies
  • Improve function docstrings to Google style with Args/Returns sections
  • Add type annotations to:
    • admin.py: set_password(), kill(), and kill_quick() functions
    • cli.py: cli() function
    • hash.py: all hashing functions
    • logging.py: excepthook() function
    • utils.py: all utility functions and ClassProperty

- Add module docstrings to cli.py, admin.py, logging.py, and hash.py
- Add `from __future__ import annotations` for PEP 563 deferred evaluation
- Modernize type hints using Python 3.10+ syntax (X | None instead of Optional[X])
- Use TYPE_CHECKING imports to avoid circular dependencies
- Improve function docstrings to Google style with Args/Returns sections
- Add type annotations to key public APIs in:
  - connection.py: Connection class and conn() function
  - fetch.py: Fetch and Fetch1 classes
  - expression.py: QueryExpression class properties and methods
  - utils.py: utility functions
  - hash.py: hashing functions
  - admin.py: kill() and kill_quick() functions
@github-actions github-actions bot added the enhancement Indicates new improvements label Dec 25, 2025
claude and others added 2 commits December 25, 2025 04:34
- Add module docstrings to cli.py, admin.py, logging.py, and hash.py
- Add `from __future__ import annotations` for PEP 563 deferred evaluation
- Modernize type hints using Python 3.10+ syntax (X | None instead of Optional[X])
- Use TYPE_CHECKING imports to avoid circular dependencies
- Improve function docstrings to Google style with Args/Returns sections
- Add type annotations to:
  - admin.py: set_password(), kill(), and kill_quick() functions
  - cli.py: cli() function
  - hash.py: all hashing functions
  - logging.py: excepthook() function
  - utils.py: all utility functions and ClassProperty

Co-authored-by: dimitri-yatsenko <dimitri@datajoint.com>
…ew-code-organization-9135z

Merges restructured project with src/datajoint/ layout and code organization
improvements including docstrings, type hints, and modern Python 3.10+ features.

Co-authored-by: dimitri-yatsenko <dimitri@datajoint.com>
@dimitri-yatsenko dimitri-yatsenko force-pushed the claude/review-code-organization-9135z branch from 90a1b71 to 4eb8202 Compare December 25, 2025 04:36
@dimitri-yatsenko dimitri-yatsenko changed the title Improve code organization: docstrings, type hints, and imports Improve code organization: docstrings, type hints, and imports. Deprecate the ~log table. Dec 25, 2025
Closes #1298

The ~log table is a client-side audit logging mechanism that has been
superseded by modern alternatives including:
- Server-side database audit logging
- Infrastructure logging platforms (Datadog, CloudWatch)
- Python's standard logging module

Changes:
- Remove Log class from table.py
- Remove log property from Schema class
- Replace self._log() calls with logger.info/debug
- Remove special ~log handling from heading.py
- Delete test_log.py

Existing ~log tables in databases remain but will no longer be written to.
All operations now emit through Python's logging module instead.

Co-authored-by: dimitri-yatsenko <dimitri@datajoint.com>
The package was moved to src/datajoint/ but these files remained
as orphans after the merge. Removing to avoid confusion.

Co-authored-by: dimitri-yatsenko <dimitri@datajoint.com>
@dimitri-yatsenko dimitri-yatsenko changed the title Improve code organization: docstrings, type hints, and imports. Deprecate the ~log table. Deprecate the ~log table.. Improve code organization: docstrings, type hints, and imports. Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Indicates new improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants