This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
np.dtype([("a", int), ("b", datetime64[s])], metadata={"blocks": True}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for a, b in zip(arr["a"], arr["b"]): | |
print(a, b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
records = await connection.fetch("SELECT 777, '2022-01-01'::timestamp") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("nulls", np.unravel_index(nulls, (len(arr), len(dtype)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for row in arr: | |
print(arr["a"]) | |
print(arr[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder