Skip to content

python(feat): add export api for sift client#490

Merged
wei-qlu merged 60 commits intomainfrom
python/data-export-high-level-interface
Mar 24, 2026
Merged

python(feat): add export api for sift client#490
wei-qlu merged 60 commits intomainfrom
python/data-export-high-level-interface

Conversation

@wei-qlu
Copy link
Copy Markdown
Contributor

@wei-qlu wei-qlu commented Mar 10, 2026

What was changed

Adds a high-level data export API to sift_client to reach parity with sift_py (soon to be deprecated).

  • DataExportAPIAsync with a single export() method that accepts domain objects or raw string IDs for runs, assets, or time-range-based exports and returns a Job handle
  • Job.wait_and_download() polls until complete, downloads results, and optionally extracts zip files (delegates to JobsAPIAsync)
  • ExportsLowLevelClient wraps gRPC protobuf calls, the high-level client has zero proto imports
  • Utility helpers added under _internal/util/:
    • channels.py - resolve_calculated_channels() resolves name-based channel identifiers to UUIDs via the channels API (the export API requires UUIDs)
    • file.py - download_file() streams downloads in 4 MiB chunks; extract_zip() extracts and cleans up archives
    • executor.py - run_sync_function() runs blocking calls off the event loop via run_in_executor
  • Sync wrappers and type stubs registered. Wired up as client.data_export and client.async_.data_export

Verification

  • Unit tests for input validation, domain object resolution, low-level delegation, wait/download status handling, and calculated channel resolution
  • Integration tests for async and sync export paths

@wei-qlu wei-qlu changed the title Python/data export high level interface python(feat): add export api for sift client Mar 10, 2026
@wei-qlu wei-qlu marked this pull request as ready for review March 12, 2026 21:19
@wei-qlu wei-qlu requested a review from nathan-sift March 16, 2026 19:52
@wei-qlu wei-qlu marked this pull request as draft March 17, 2026 00:39
nathan-sift
nathan-sift previously approved these changes Mar 17, 2026
Copy link
Copy Markdown
Contributor

@nathan-sift nathan-sift left a comment

Choose a reason for hiding this comment

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

This looks good, thanks for the changes! Approving, but it looks like you might need to re-update the stubs

@wei-qlu wei-qlu marked this pull request as ready for review March 17, 2026 22:49
@wei-qlu wei-qlu force-pushed the python/data-export-high-level-interface branch from edc48f6 to 920e5ca Compare March 23, 2026 18:22
wei-qlu added 22 commits March 23, 2026 15:22
@wei-qlu wei-qlu force-pushed the python/data-export-high-level-interface branch from 34722e0 to 9a17655 Compare March 23, 2026 22:23
@alexluck-sift alexluck-sift self-requested a review March 24, 2026 00:06
Copy link
Copy Markdown
Collaborator

@alexluck-sift alexluck-sift left a comment

Choose a reason for hiding this comment

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

lgtm! Nice work!

@wei-qlu wei-qlu merged commit c47512b into main Mar 24, 2026
22 of 24 checks passed
@wei-qlu wei-qlu deleted the python/data-export-high-level-interface branch March 24, 2026 00:13
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