Skip to content

Conversation

@JR-1991
Copy link
Member

@JR-1991 JR-1991 commented Oct 22, 2025

This pull request introduces several enhancements and fixes across the codebase, mainly focusing on improving upload progress tracking, proxy support for testing, code organization, and documentation. The changes also include new test coverage for large file uploads and proxy scenarios.

Native upload progress tracking:

  • Added the _ProgressFileWrapper class in nativeupload.py to wrap file-like objects and update the Rich progress bar during file uploads, allowing accurate progress reporting for large files. This wrapper is now used in the native upload flow. [1] [2]
  • Extended retry logic in _single_native_upload to handle additional network exceptions (httpx.ReadError, httpx.RequestError), improving robustness against transient network failures.

Proxy support for integration tests:

  • Added a new http_proxy_server pytest fixture in conftest.py that launches a local HTTP proxy using proxy.py for tests requiring proxy support. This enables reliable testing of proxy scenarios.
  • Updated the integration test for native upload to use the new proxy fixture, ensuring upload functionality works when routed through a proxy.
  • Added proxy.py to the test dependencies in pyproject.toml.

Closing issues

Introduces a new integration test to verify native upload functionality with a large file. Also refactors file list formatting for improved readability in existing tests.
Added the proxy parameter to calls to upload_files and upload_files_parallel in DVUploader to ensure proxy settings are used during uploads. Also improved import ordering for consistency.
Introduced _ProgressFileWrapper to wrap file-like objects and update a rich progress bar during file uploads. Improved error handling in upload retries and added an assertion for file handler presence. Refactored code for clarity and consistency.
Expanded the testing section to include instructions for running all tests, specific tests, and non-expensive tests using pytest. This provides clearer guidance for contributors on how to execute different test scenarios.
Introduces a pytest fixture to start a local HTTP proxy using proxy.py for tests requiring proxy support. Updates the native upload integration test to use the new fixture, improving reliability and isolation of proxy-dependent tests.
Included proxy.py version 2.4.4 in the main dependencies to support proxy-related functionality.
Removed unused AsyncGenerator import from nativeupload.py and cleaned up unused stdout variable in tests/conftest.py for better code clarity.
Introduces an optional proxy parameter to dataset file retrieval functions and methods in dvuploader.py and utils.py, allowing HTTP requests to be routed through a specified proxy. This enhances flexibility for users operating behind network proxies.
Introduces a 'proxy' parameter to native_upload, _update_metadata, and _retrieve_file_ids functions, allowing API requests to be routed through a specified proxy. This enhances flexibility for deployments requiring network routing via proxies.
Eliminates the Squid service setup from the GitHub Actions test workflow, simplifying the build job configuration.
Deleted the http_proxy_server fixture and its helper from conftest.py, and commented out the proxy upload integration test in test_native_upload.py. The proxy functionality has been verified manually, but the automated test setup was unreliable.
Cleaned up the tests/conftest.py file by removing unused imports: signal, socket, subprocess, sys, and time.
@JR-1991 JR-1991 marked this pull request as ready for review November 26, 2025 13:14
@JR-1991 JR-1991 merged commit 1be9972 into main Nov 26, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Development

Successfully merging this pull request may close these issues.

Upload fails with large file, works with smaller ones (nondescriptive readerror)

2 participants