-
Notifications
You must be signed in to change notification settings - Fork 1
Connect/Python: Add driver cratedb-async
#229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Warning Rate limit exceeded@amotl has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 14 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughUpdated driver documentation: standardized wording for several Python HTTP drivers, added a new "CrateDB Async Python driver" entry, and inserted a cratedb-async usage block into Python docs (docs/connect/python.rst). No code or public API changes. Changes
Sequence Diagram(s)(omitted — changes are documentation-only and do not modify runtime control flow) Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
docs/connect/drivers.md (2)
330-334
: Mentionasyncio
for consistency with other Python driver descriptionsOther Python entries (e.g., aiopg, asyncpg) explicitly state that they “support Python’s
asyncio
”. Adding the same phrasing here keeps the table uniform and highlights the async nature of the driver.-For connecting to CrateDB from Python, using httpx. +For connecting to CrateDB from Python, supporting Python’s `asyncio` and using the `httpx` HTTP client.
336-337
: Optional: Add an example-snippet badge to match neighbouring rowsMost Python rows include either an “example-snippet” or “docs-by-example” badge. If a quick-start snippet exists (or once one is added), consider linking it to keep the UX consistent across drivers.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/connect/drivers.md
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: the `records.database("crate://", echo=true)` connection string for cratedb works with defaults: loc...
Learnt from: amotl
PR: crate/cratedb-guide#207
File: docs/integrate/etl/iceberg-risingwave.md:205-207
Timestamp: 2025-06-05T14:29:15.512Z
Learning: The `records.Database("crate://", echo=True)` connection string for CrateDB works with defaults: localhost as host, "crate" as user, and blank password. This is valid and functional code in the records library.
Applied to files:
docs/connect/drivers.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build docs
08a09d3
to
643566f
Compare
7758740
to
b4b373f
Compare
docs/connect/drivers.md
Outdated
[CrateDB Async Python driver](https://github.com/surister/cratedb-async) | ||
``` | ||
```{sd-item} | ||
For connecting to CrateDB from Python, supporting Python’s `asyncio` by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: it supports other async implementations like trio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Do you think the other async driver implementations are equally well supporting trio or others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've generalized the statement with 0d4798a, thanks again.
cratedb-async
cratedb-async
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
docs/connect/drivers.md (1)
336-341
: Reflect multi-runtime async support and add an example link badge.
- httpx supports multiple async event loops (e.g., asyncio, Trio), which this driver inherits; make that explicit.
- Add an example-snippet badge linking to the new section in the Python docs for consistency with other entries.
-For connecting to CrateDB from Python, supporting Python's async implementations -by using the `httpx` HTTP client. +For connecting to CrateDB from Python, supporting multiple async event loops +(e.g., asyncio, Trio) via the HTTPX client.[](https://github.com/surister/cratedb-async) +[](#cratedb-async)
🧹 Nitpick comments (5)
docs/connect/python.rst (2)
59-62
: Clarify/capitalize HTTPX and add a link to its docs.Small wording polish to improve accuracy and reader convenience.
-Asynchronous driver for CrateDB based on httpx. -See the full documentation at https://github.com/surister/cratedb-async. +Asynchronous Python driver for CrateDB based on HTTPX. +See the full documentation at https://github.com/surister/cratedb-async.Additionally (outside the selected range), consider adding a reference link at the end of the file:
.. _HTTPX: https://www.python-httpx.org/
65-72
: Make the example runnable and consistent with earlier connection URLs.
- The snippet defines an async function but never runs it. Add asyncio.run(main()).
- Use the same HTTPS cloud URL pattern as used in the crate-python example for consistency.
import asyncio from cratedb_async.client import CrateClient async def main(): - crate = CrateClient("http://localhost:4200") + crate = CrateClient("https://<name-of-your-cluster>.cratedb.net:4200") response = await crate.query("SELECT * FROM sys.summits") print(response.as_table()) + + asyncio.run(main())docs/connect/drivers.md (3)
178-180
: aiopg is asyncio-specific; avoid implying other async runtimes.aiopg targets asyncio (PEP 3156). Suggest clearer wording.
-For connecting to CrateDB from Python, supporting Python's async implementations -using the PEP-3156/tulip framework. +For connecting to CrateDB from Python, using Python's asyncio (PEP 3156) framework.
194-195
: asyncpg is asyncio-specific; tighten phrasing.Avoid suggesting support beyond asyncio.
-For connecting to CrateDB from Python, supporting Python's async implementations. +For connecting to CrateDB from Python, using Python's asyncio.
209-210
: psycopg3 async support is asyncio-based; clarify wording.Align phrasing with actual runtime support.
-For connecting to CrateDB from Python, supporting Python's async implementations. +For connecting to CrateDB from Python, with asyncio-based async support.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
docs/connect/drivers.md
(4 hunks)docs/connect/python.rst
(1 hunks)
🔇 Additional comments (1)
docs/connect/python.rst (1)
66-71
: No changes needed: import path and API usage are correctI’ve confirmed that:
from cratedb_async.client import CrateClient
is the official import.- The
query()
response object does indeed include anas_table()
method in the package’s examples and README.
.. _cratedb-async: | ||
|
||
cratedb-async | ||
------------- | ||
|
||
Asynchronous driver for CrateDB based on httpx. | ||
See the full documentation at https://github.com/surister/cratedb-async. | ||
The package can be installed using ``pip install cratedb-async``. | ||
|
||
.. code-block:: python | ||
import asyncio | ||
from cratedb_async.client import CrateClient | ||
async def main(): | ||
crate = CrateClient("http://localhost:4200") | ||
response = await crate.query("SELECT * FROM sys.summits") | ||
print(response.as_table()) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@surister: I've also added the canonical code snippet from the project's README here, so it will be added to the knowledgebase outline, so LLMs can know about it, at their disposal.
About
Educate users about cratedb-async. Thanks, @surister! ✨
Preview
https://cratedb-guide--229.org.readthedocs.build/connect/drivers.html