Skip to content

Conversation

@nsheff
Copy link
Contributor

@nsheff nsheff commented Nov 6, 2025

No description provided.

donaldcampbelljr and others added 16 commits January 25, 2024 14:57
v 0.10.2 point release
Converted all docstrings from reStructuredText format to Google-style format
across the entire codebase. This includes:

- Main pipestat module (pipestat.py) - 42 docstrings
- File backend (filebackend.py) - 22 docstrings
- DB backend files (dbbackend.py, db_helpers.py, db_parsed_schema.py) - 22 docstrings
- PEPHub backend (pephubbackend.py) - 11 docstrings
- Utility files (helpers.py, parsed_schema.py, reports.py, etc.) - 50+ docstrings
- Abstract backend and reader modules

Changes include:
- Converting :param/:return/:raise style to Args:/Returns:/Raises: sections
- Adding proper blank lines after summary lines
- Maintaining all existing documentation content and type information
- Ensuring consistent formatting across all docstrings

All files have been syntax-checked and compile successfully.
@nsheff nsheff requested a review from Copilot November 6, 2025 00:02
Copy link

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 updates docstrings across the pipestat codebase from reStructuredText (reST) format to Google-style format. The changes improve documentation consistency and readability by adopting a more modern docstring convention.

Key changes include:

  • Conversion from :param and :return syntax to Args: and Returns: sections
  • Addition of Raises: sections where exceptions are documented
  • Improved formatting with proper indentation and line breaks
  • Standardized capitalization and punctuation in descriptions

Reviewed Changes

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

Show a summary per file
File Description
pipestat/reports.py Updated all function/method docstrings from reST to Google-style format
pipestat/pipestatreader/reader.py Converted FastAPI endpoint docstrings to Google-style format
pipestat/pipestat.py Updated PipestatManager and related class docstrings to Google-style
pipestat/parsed_schema.py Converted ParsedSchema class docstrings to Google-style format
pipestat/helpers.py Updated utility function docstrings to Google-style format
pipestat/const.py Converted helper function docstrings to Google-style format
pipestat/backends/pephub_backend/pephubbackend.py Updated PEPHub backend docstrings to Google-style
pipestat/backends/file_backend/filebackend.py Converted file backend docstrings to Google-style format
pipestat/backends/db_backend/dbbackend.py Updated database backend docstrings to Google-style
pipestat/backends/db_backend/db_parsed_schema.py Converted DB schema parsing docstrings to Google-style
pipestat/backends/db_backend/db_helpers.py Updated database helper function docstrings to Google-style
pipestat/backends/abstract.py Converted abstract backend docstrings to Google-style format
pipestat/argparser.py Updated argument parser docstrings to Google-style format

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Added missing type hints to improve type safety and IDE support across
all major modules.

## helpers.py (9 functions)
- Added parameter and return type hints to all functions
- Changed Union[T, None] to Optional[T] for consistency
- Fixed List return type to List[str] in get_all_result_files

## backends/abstract.py (7 improvements)
- Added type hints to __init__ and all method parameters
- Added return types to count_records, link, and nested functions
- Changed Optional parameters from bare types to Optional[T]
- Fixed select_distinct columns parameter type

## parsed_schema.py (3 properties)
- Added return types to project_table_name, sample_table_name properties
- Added type hints to _get_data_type static method
- Added return type to file_like_table_name property

## pipestat.py (40+ improvements)
- Added Callable import and fixed all formatter parameter types
- Added return types to all decorators (check_dependencies, require_backend)
- Added parameter and return types to all magic methods
- Added return types to all regular methods and properties
- Changed Union[str, None] to Optional[str] for consistency
- Fixed result_formatter from staticmethod to Callable throughout

## backends/file_backend/filebackend.py (10 improvements)
- Added Optional[T] to all optional parameters
- Added return types to count_records, _htmlreportbuilder, get_nested_column
- Added all parameter types to _modify_history method
- Fixed Callable return type for get_operator

## backends/db_backend/dbbackend.py (8 improvements)
- Added return types to count_records, get_model, _create_orms methods
- Added Generator type hint to session property with proper import
- Added Optional[T] to optional parameters
- Added return types to _engine property

## backends/pephub_backend/pephubbackend.py (4 improvements)
- Added return type to count_records
- Added Optional[T] to optional parameters
- Fixed get_operator return type to str

All files pass Python syntax validation. Type hints are consistent with
the codebase style and improve IDE autocomplete and type checking support.
Applied black code formatter and fixed all ruff linting issues across
the codebase.

## Black formatting (4 files):
- pipestat/backends/abstract.py - Reformatted long function signatures
- pipestat/helpers.py - Reformatted function signatures to fit line length
- pipestat/backends/file_backend/filebackend.py - Reformatted long lines
- pipestat/pipestat.py - Reformatted decorator and method signatures

## Ruff linting fixes (22 issues):
- Fixed 4 bare except statements (E722) to use specific exception types:
  - backends/abstract.py: except FileExistsError
  - backends/file_backend/filebackend.py: except FileNotFoundError, except Exception
  - reports.py: except Exception (2 occurrences)
- Removed 13 unused imports automatically via ruff --fix
- Fixed 4 unused variables by prefixing with underscore or removing
- Left 1 acceptable wildcard import (F403) in pipestatreader/__init__.py

All modified files pass Python syntax validation.

Note: Full pytest run skipped due to missing test dependencies in environment,
but all files compile successfully.
@nsheff
Copy link
Contributor Author

nsheff commented Nov 6, 2025

@donaldcampbelljr merge if this is OK with you. it's helpful for building the new autodocumentation.

Copy link
Contributor

@donaldcampbelljr donaldcampbelljr left a comment

Choose a reason for hiding this comment

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

This appears to be good.

@donaldcampbelljr donaldcampbelljr merged commit 5bcc256 into dev Nov 6, 2025
5 checks passed
@donaldcampbelljr donaldcampbelljr deleted the claude/convert-docstrings-011CUqZSEEJKpuR1MkqV1PRu branch November 6, 2025 16:19
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.

4 participants