pydoris (Custom Build - Relaxed Dependencies)

raw JSON →
1.1.0 verified Mon Apr 27 auth: no python

A custom build of the Python client for Apache Doris (version 1.1.0 on PyPI), based on the official pydoris library but with relaxed dependency constraints. This client provides a DB-API 2.0 interface to connect to Doris clusters, execute SQL queries (primarily using the MySQL protocol), and manage connections. It is intended for users who need a more permissive dependency tree than the original pydoris, but may lag behind official updates.

pip install pydoris-custom
error ModuleNotFoundError: No module named 'pydoris'
cause The package 'pydoris-custom' is installed but the import statement uses 'pydoris'. The package exposes the same module name as the official pydoris.
fix
Install the correct package: pip install pydoris-custom, and keep import from pydoris.
error doris_protocol.ProtocolError: Protocol not supported (mysql)
cause The client attempted to connect using the default MySQL protocol, but the Doris server expects HTTP, or vice versa.
fix
Ensure the protocol matches the server configuration. For HTTP, pass protocol='https'. For MySQL, ensure port is 9030 and no protocol argument is needed (defaults to mysql).
breaking pydoris-custom has relaxed dependency pins (e.g., protobuf, grpcio) and may be incompatible with the official pydoris library's strict version requirements. Mixing both in the same environment can cause version conflicts and import errors.
fix Use only pydoris-custom or official pydoris in a virtual environment; do not install both.
gotcha The library primarily uses the MySQL protocol for communication, but also supports HTTP. Importing from 'pydoris' does not automatically configure the protocol. You must specify the correct port (MySQL default 9030) and optionally pass 'protocol='https'' for HTTP.
fix Ensure you connect with the proper port and protocol. For MySQL: port=9030. For HTTP: protocol='https' and port=8030.
deprecated Use of 'from pydoris import Client' is deprecated and may be removed. The recommended approach is to use the 'connect' function which returns a DB-API 2.0 connection object.
fix Replace 'Client' with 'connect' and use the standard cursor interface.

Quickstart to connect to a local Doris instance, list tables in the default database.

from pydoris import connect

conn = connect(
    host='127.0.0.1',
    port=9030,
    user='admin',
    password='',
    database='example_db'
)
cursor = conn.cursor()
cursor.execute("SHOW TABLES")
for row in cursor.fetchall():
    print(row)
cursor.close()
conn.close()