Skip to content

36 add better writer support#37

Merged
ChristopheBeke merged 10 commits intoimprove-gdrive-integrationfrom
36-add-better-writer-support
Jun 27, 2025
Merged

36 add better writer support#37
ChristopheBeke merged 10 commits intoimprove-gdrive-integrationfrom
36-add-better-writer-support

Conversation

@PaoloLeonard
Copy link
Contributor

Pull Request

Description

Added better support for the writing. Now it's dynamic so we can export multiple artifact and print is now better supported with rich

Fixes #36

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@PaoloLeonard PaoloLeonard linked an issue Jun 24, 2025 that may be closed by this pull request
@PaoloLeonard PaoloLeonard requested review from ChristopheBeke and Copilot and removed request for ChristopheBeke June 24, 2025 18:47
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 introduces improved writer support with a dynamic, multi-format export feature while refactoring Google Drive functionality and removing Dropbox support. Key changes include updating Google Drive provider/client code, refactoring configuration and testing modules, and adding new tests for CSV/JSON and console writing.

Reviewed Changes

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

Show a summary per file
File Description
tests/services/google_drive/test_google_drive_files.py Removed outdated tests for Google Drive files.
tests/providers/google_drive/*.py Updated provider tests and fixture usage for Google Drive permissions, files, and buckets.
src/docbinder_oss/providers/google_drive/*.py Refactored Google Drive client/provider logic including file listing, metadata, and permissions.
src/docbinder_oss/helpers/writer.py Introduced new MultiFormatWriter, CSVWriter, JSONWriter, and ConsoleWriter.
src/docbinder_oss/cli/search.py Added search command for file filtering and export functionality.
Other CLI and config files Consolidated provider commands and updated configuration management.

Comment on lines 130 to 133
if min_size and file.size < min_size * 1024:
return False
if max_size and file.size > max_size * 1024:
return False
Copy link

Copilot AI Jun 24, 2025

Choose a reason for hiding this comment

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

Since the 'size' field in File is defined as an Optional string, comparing it directly against an integer may lead to unexpected behavior. Consider converting the size to an integer (after verifying it is not None) before performing numeric comparisons.

Suggested change
if min_size and file.size < min_size * 1024:
return False
if max_size and file.size > max_size * 1024:
return False
if file.size is not None:
try:
file_size_int = int(file.size)
if min_size and file_size_int < min_size * 1024:
return False
if max_size and file_size_int > max_size * 1024:
return False
except ValueError:
# Skip files with non-numeric size values
return False

Copilot uses AI. Check for mistakes.
@PaoloLeonard PaoloLeonard changed the base branch from main to improve-gdrive-integration June 24, 2025 18:48
@ChristopheBeke ChristopheBeke merged commit c93b6e8 into improve-gdrive-integration Jun 27, 2025
1 of 4 checks passed
@ChristopheBeke ChristopheBeke deleted the 36-add-better-writer-support branch June 27, 2025 16:08
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.

Add better writer support

2 participants