Skip to content

Conversation

@drgroot
Copy link
Member

@drgroot drgroot commented Jul 31, 2025

Fixes typing issues in blob.py identified by mypy --check-untyped-defs

  • Add proper imports for Optional and Response types
  • Fix file.filename null check to handle None values
  • Add return type annotations for methods
  • Remove type ignore comment by properly typing ResponseArtifact
  • Improve type annotations using Optional instead of union syntax

Closes #102

Generated with Claude Code

claude bot and others added 3 commits July 31, 2025 12:12
- Add proper imports for Optional and Response types
- Fix file.filename null check to handle None values
- Add return type annotations for methods
- Remove type ignore comment by properly typing ResponseArtifact
- Improve type annotations using Optional instead of union syntax

Co-authored-by: Yusuf Ali <drgroot@users.noreply.github.com>
@drgroot drgroot enabled auto-merge July 31, 2025 12:17
@drgroot drgroot requested a review from Copilot July 31, 2025 12:21
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 fixes mypy typing issues in the blob.py file by adding proper type annotations and imports. The changes improve type safety and remove the need for type ignore comments.

Key changes:

  • Added proper imports for Optional and Response types from typing and flask modules
  • Added return type annotations to functions and methods
  • Improved null safety by checking file.filename for None values

Reviewed Changes

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

File Description
servc/svc/com/http/blob.py Added type imports, return type annotations, and null safety check for file.filename
.github/workflows/claude.yml Added allowed_tools configuration for the workflow

return self._uploadcontainer, secure_filename(fname)

def _postMessage(self, extra_params: Dict | None = None):
def _postMessage(self, extra_params: Optional[Dict] = None):
Copy link

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

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

The Dict type annotation is incomplete. It should specify the key and value types, e.g., Optional[Dict[str, Any]] or Optional[Dict[Any, Any]] for better type safety.

Suggested change
def _postMessage(self, extra_params: Optional[Dict] = None):
def _postMessage(self, extra_params: Optional[Dict[str, Any]] = None):

Copilot uses AI. Check for mistakes.

for filekey in list(request.files):
file = request.files[filekey]
if file.filename is None:
Copy link

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

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

Consider also checking if file.filename is an empty string, as secure_filename('') could still cause issues. The check should be if not file.filename: to handle both None and empty string cases.

Suggested change
if file.filename is None:
if not file.filename:

Copilot uses AI. Check for mistakes.
@drgroot drgroot disabled auto-merge July 31, 2025 12:23
@drgroot drgroot merged commit ba89e52 into main Jul 31, 2025
24 checks passed
@drgroot drgroot deleted the claude/issue-102-20250731-1210 branch July 31, 2025 12:23
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.

fixing unit tests

2 participants