Skip to content

Instantly share code, notes, and snippets.

View vmarkovtsev's full-sized avatar

Vadim Markovtsev vmarkovtsev

View GitHub Profile
@cython.cdivision(True)
cdef PyObject *_write_json(PyObject *obj, SpecNode &spec, chunked_stream &stream) nogil:
cdef:
PyObject *key = NULL
PyObject *value = NULL
PyObject *r
Py_ssize_t pos = 0, size, i, j, item_len, char_len
unsigned int kind
char sym
char *data
np.dtype([("a", int), ("b", datetime64[s])], metadata={"blocks": True})
for a, b in zip(arr["a"], arr["b"]):
print(a, b)
dtype = np.dtype([("a", int), ("b", datetime64[s])], metadata={"blocks": True})
query = set_query_dtype("SELECT 777, '2022-01-01'::timestamp", dtype)
arr, nulls = await connection.fetch(query)
records = await connection.fetch("SELECT 777, '2022-01-01'::timestamp")
print("nulls", np.unravel_index(nulls, (len(arr), len(dtype))))
for row in arr:
print(arr["a"])
print(arr[1])
from asyncpg.rkt import set_query_dtype
query = set_query_dtype(
"SELECT 777, '2022-01-01'::timestamp",
np.dtype([("a", int), ("b", datetime64[s])]))
arr, nulls = await connection.fetch(query)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.