You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -255,6 +255,46 @@ which would produce:
255
255
1575454204, "a", "0001", ["a", "b", "c"]
256
256
1575454204, "b", "0002", ["d", "e", "f"]
257
257
258
+
Type Hints
259
+
----------
260
+
261
+
td-client-python includes comprehensive type hints (PEP 484) for improved development experience with static type checkers like mypy and pyright. Type hints are available for all public APIs.
262
+
263
+
**Features:**
264
+
265
+
266
+
* Fully typed public API with precise type annotations
267
+
* ``py.typed`` marker file for PEP 561 compliance
268
+
* Type aliases in ``tdclient.types`` for common patterns
269
+
* Support for type checking with mypy, pyright, and other tools
270
+
271
+
**Example with type checking:**
272
+
273
+
.. code-block:: python
274
+
275
+
import tdclient
276
+
277
+
# Type checkers will understand the types
278
+
with tdclient.Client(apikey="your_api_key") as client:
279
+
# client is inferred as tdclient.Client
280
+
job = client.query("sample_db", "SELECT COUNT(1) FROM table", type="presto")
281
+
# job is inferred as tdclient.models.Job
282
+
job.wait()
283
+
for row in job.result():
284
+
# row is inferred as dict[str, Any]
285
+
print(row)
286
+
287
+
**Using type aliases:**
288
+
289
+
.. code-block:: python
290
+
291
+
from tdclient.types import QueryEngineType, Priority
0 commit comments