Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 9, 2025

This PR adds a timeout parameter to the BulkImport.perform() method to allow users to set a timeout for bulk import operations, similar to the existing BulkImport.commit() method.

Changes

  • Added timeout=None parameter to BulkImport.perform() method signature
  • Updated the method to pass the timeout parameter to job.wait() when wait=True
  • Added documentation for the new timeout parameter
  • Added test coverage for the timeout functionality

Usage

import tdclient

client = tdclient.Client()
bulk_import = client.create_bulk_import("my_import", "my_database", "my_table")

# Without timeout (existing behavior)
bulk_import.perform(wait=True)

# With timeout (new functionality)
bulk_import.perform(wait=True, timeout=300)  # 5 minute timeout

Backward Compatibility

This change is fully backward compatible. All existing code will continue to work exactly as before, with the timeout defaulting to None (no timeout) when not specified.

The implementation leverages the existing timeout functionality in the Job.wait() method, ensuring consistent behavior across the codebase.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: chezou <916653+chezou@users.noreply.github.com>
Copilot AI changed the title [WIP] Can you create a PR to allow bulk_import_model.perform() to set timeout similar as bulk_import_model.commit()? Just passing timeout option to L.120 should be fine. Add timeout parameter to BulkImport.perform() method Aug 9, 2025
Copilot finished work on behalf of chezou August 9, 2025 21:44
Copilot AI requested a review from chezou August 9, 2025 21:44
@chezou chezou marked this pull request as ready for review August 9, 2025 21:47
Copy link
Contributor

@tung-vu-td tung-vu-td left a comment

Choose a reason for hiding this comment

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

LGTM

@chezou chezou merged commit 36559c8 into master Aug 12, 2025
22 checks passed
@chezou chezou deleted the copilot/fix-fe93b6aa-303e-4886-bf56-e2cd32aad076 branch August 12, 2025 04:20
tung-vu-td pushed a commit to treasure-data/pytd that referenced this pull request Aug 14, 2025
* Support td-client perform timeout. Follow up treasure-data/td-client-python#132

* Fix dependent td-client version
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.

3 participants