Skip to content

Rewrite library in Rust using PyO3/maturin#42

Open
aebrahim wants to merge 1 commit into
DelfinaCare:mainfrom
aebrahim:rust-rewrite
Open

Rewrite library in Rust using PyO3/maturin#42
aebrahim wants to merge 1 commit into
DelfinaCare:mainfrom
aebrahim:rust-rewrite

Conversation

@aebrahim

Copy link
Copy Markdown
Member
  • All I/O (BigQuery Storage Read API + Redis) runs on an owned Tokio runtime; the Python GIL is released for every blocking operation.
  • Inflight deduplication: concurrent callers waiting on the same query share a single Futures::Shared future so BigQuery is hit only once.
  • Background refresh: stale-but-valid cache entries are refreshed asynchronously without blocking the caller.
  • Cache format: Redis stores complete Arrow IPC streams (schema + EOS in :schema, full stream with all batches in :data, RFC-3339 timestamp in :query_time). Self-contained streams mean no schema/data concatenation at read time.
  • Python interface unchanged: BQRedis(redis_url), query_sync(), query_sync_with_time(), query(), query_with_time(), clear_cache_sync(), clear_cache() all return pyarrow.Table objects.
  • Authentication via Application Default Credentials (ADC) only.
  • pyproject.toml switched from hatchling to maturin; runtime deps reduced to pyarrow (BigQuery and Redis are now Rust dependencies).

- All I/O (BigQuery Storage Read API + Redis) runs on an owned Tokio
  runtime; the Python GIL is released for every blocking operation.
- Inflight deduplication: concurrent callers waiting on the same query
  share a single Futures::Shared future so BigQuery is hit only once.
- Background refresh: stale-but-valid cache entries are refreshed
  asynchronously without blocking the caller.
- Cache format: Redis stores complete Arrow IPC streams (schema + EOS
  in :schema, full stream with all batches in :data, RFC-3339 timestamp
  in :query_time). Self-contained streams mean no schema/data
  concatenation at read time.
- Python interface unchanged: BQRedis(redis_url), query_sync(),
  query_sync_with_time(), query(), query_with_time(),
  clear_cache_sync(), clear_cache() all return pyarrow.Table objects.
- Authentication via Application Default Credentials (ADC) only.
- pyproject.toml switched from hatchling to maturin; runtime deps
  reduced to pyarrow (BigQuery and Redis are now Rust dependencies).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant