Generated by Cython 3.2.4
Yellow lines hint at Python interaction.
Click on a line that starts with a "+" to see the C code that Cython generated for it.
Raw output: dataframe.pxi
0001: # See: dataframe.md for technical overview.
0002:
+0003: from decimal import Decimal
{
PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Decimal};
__pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_decimal, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
}
__pyx_t_4 = __pyx_t_1;
__Pyx_GOTREF(__pyx_t_4);
{
PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Decimal};
__pyx_t_9 = 0; {
__pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_9]); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_9], __pyx_t_5) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+0004: import ipaddress as _ipaddress
__pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_ipaddress_2, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ipaddress, __pyx_t_4) < (0)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+0005: import uuid as _uuid
__pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_uuid_2, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_uuid, __pyx_t_4) < (0)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
0006:
0007: from cpython.bytes cimport PyBytes_AsString
0008: from .mpdecimal_compat cimport decimal_pyobj_to_binary
0009:
0010: # Auto-flush settings.
0011: # The individual `interval`, `row_count` and `byte_count`
0012: # settings are set to `-1` when disabled.
0013: # If `.enabled`, then at least one of the settings are `!= -1`.
+0014: cdef struct auto_flush_mode_t:
struct __pyx_t_7questdb_7_client_auto_flush_mode_t {
int enabled;
int64_t interval;
int64_t row_count;
int64_t byte_count;
};
0015: bint enabled
0016: int64_t interval
0017: int64_t row_count
0018: int64_t byte_count
0019:
0020:
+0021: cdef struct auto_flush_t:
struct __pyx_t_7questdb_7_client_auto_flush_t {
struct line_sender *sender;
struct __pyx_t_7questdb_7_client_auto_flush_mode_t mode;
int64_t *last_flush_ms;
};
0022: line_sender* sender
0023: auto_flush_mode_t mode
0024: int64_t* last_flush_ms
0025:
0026:
+0027: cdef auto_flush_t auto_flush_blank() noexcept nogil:
static struct __pyx_t_7questdb_7_client_auto_flush_t __pyx_f_7questdb_7_client_auto_flush_blank(void) {
struct __pyx_t_7questdb_7_client_auto_flush_t __pyx_v_af;
struct __pyx_t_7questdb_7_client_auto_flush_t __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0028: cdef auto_flush_t af
+0029: af.sender = NULL
__pyx_v_af.sender = NULL;
+0030: af.mode.enabled = False
__pyx_v_af.mode.enabled = 0;
+0031: af.mode.interval = -1
__pyx_v_af.mode.interval = -1L;
+0032: af.mode.row_count = -1
__pyx_v_af.mode.row_count = -1L;
+0033: af.mode.byte_count = -1
__pyx_v_af.mode.byte_count = -1L;
+0034: af.last_flush_ms = NULL
__pyx_v_af.last_flush_ms = NULL;
+0035: return af
__pyx_r = __pyx_v_af; goto __pyx_L0;
0036:
+0037: cdef bint should_auto_flush(
static int __pyx_f_7questdb_7_client_should_auto_flush(struct __pyx_t_7questdb_7_client_auto_flush_mode_t const *__pyx_v_af_mode, struct line_sender_buffer *__pyx_v_ls_buf, int64_t __pyx_v_last_flush_ms) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0038: const auto_flush_mode_t* af_mode,
0039: line_sender_buffer* ls_buf,
0040: int64_t last_flush_ms):
+0041: if not af_mode.enabled:
__pyx_t_1 = (!(__pyx_v_af_mode->enabled != 0));
if (__pyx_t_1) {
/* … */
}
+0042: return False
__pyx_r = 0;
goto __pyx_L0;
0043:
0044: # Check `auto_flush_rows` breach.
+0045: if (af_mode.row_count != -1) and \
__pyx_t_2 = (__pyx_v_af_mode->row_count != -1L);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L5_bool_binop_done;
}
/* … */
if (__pyx_t_1) {
/* … */
}
+0046: (<int64_t>line_sender_buffer_row_count(ls_buf) >= af_mode.row_count):
__pyx_t_2 = (((int64_t)line_sender_buffer_row_count(__pyx_v_ls_buf)) >= __pyx_v_af_mode->row_count); __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:;
+0047: return True
__pyx_r = 1;
goto __pyx_L0;
0048:
0049: # Check `auto_flush_bytes` breach.
+0050: if (af_mode.byte_count != -1) and \
__pyx_t_2 = (__pyx_v_af_mode->byte_count != -1L);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L8_bool_binop_done;
}
/* … */
if (__pyx_t_1) {
/* … */
}
+0051: (<int64_t>line_sender_buffer_size(ls_buf) >= af_mode.byte_count):
__pyx_t_2 = (((int64_t)line_sender_buffer_size(__pyx_v_ls_buf)) >= __pyx_v_af_mode->byte_count); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:;
+0052: return True
__pyx_r = 1;
goto __pyx_L0;
0053:
0054: # Check for interval breach.
+0055: if (af_mode.interval != -1) and \
__pyx_t_2 = (__pyx_v_af_mode->interval != -1L);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L11_bool_binop_done;
}
/* … */
if (__pyx_t_1) {
/* … */
}
+0056: (((line_sender_now_micros() / 1000) - last_flush_ms) >= af_mode.interval):
__pyx_t_2 = (((((double)line_sender_now_micros()) / 1000.0) - __pyx_v_last_flush_ms) >= __pyx_v_af_mode->interval); __pyx_t_1 = __pyx_t_2; __pyx_L11_bool_binop_done:;
+0057: return True
__pyx_r = 1;
goto __pyx_L0;
0058:
+0059: return False
__pyx_r = 0; goto __pyx_L0;
0060:
+0061: cdef inline uint32_t bswap32(uint32_t value) noexcept:
static CYTHON_INLINE uint32_t __pyx_f_7questdb_7_client_bswap32(uint32_t __pyx_v_value) {
uint32_t __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0062: return (((value & 0xFF000000u) >> 24u) |
0063: ((value & 0x00FF0000u) >> 8u) |
+0064: ((value & 0x0000FF00u) << 8u) |
__pyx_r = (((((__pyx_v_value & 0xFF000000U) >> 24U) | ((__pyx_v_value & 0x00FF0000U) >> 8U)) | ((__pyx_v_value & 0x0000FF00U) << 8U)) | ((__pyx_v_value & 0x000000FFU) << 24U)); goto __pyx_L0;
0065: ((value & 0x000000FFu) << 24u))
0066:
+0067: cdef inline uint64_t bswap64(uint64_t value) noexcept:
static CYTHON_INLINE uint64_t __pyx_f_7questdb_7_client_bswap64(uint64_t __pyx_v_value) {
uint64_t __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0068: return (((value & 0xFF00000000000000u) >> 56u) |
0069: ((value & 0x00FF000000000000u) >> 40u) |
0070: ((value & 0x0000FF0000000000u) >> 24u) |
0071: ((value & 0x000000FF00000000u) >> 8u) |
0072: ((value & 0x00000000FF000000u) << 8u) |
0073: ((value & 0x0000000000FF0000u) << 24u) |
+0074: ((value & 0x000000000000FF00u) << 40u) |
__pyx_r = (((((((((__pyx_v_value & 0xFF00000000000000U) >> 56U) | ((__pyx_v_value & 0x00FF000000000000U) >> 40U)) | ((__pyx_v_value & 0x0000FF0000000000U) >> 24U)) | ((__pyx_v_value & 0x000000FF00000000U) >> 8U)) | ((__pyx_v_value & 0x00000000FF000000U) << 8U)) | ((__pyx_v_value & 0x0000000000FF0000U) << 24U)) | ((__pyx_v_value & 0x000000000000FF00U) << 40U)) | ((__pyx_v_value & 0x00000000000000FFU) << 56U)); goto __pyx_L0;
0075: ((value & 0x00000000000000FFu) << 56u))
0076:
+0077: cdef struct col_chunks_t:
struct __pyx_t_7questdb_7_client_col_chunks_t {
size_t n_chunks;
struct ArrowArray *chunks;
};
0078: size_t n_chunks
0079: ArrowArray* chunks # We calloc `n_chunks + 1` of these.
0080:
0081:
+0082: cdef struct col_cursor_t:
struct __pyx_t_7questdb_7_client_col_cursor_t {
struct ArrowArray *chunk;
size_t chunk_index;
size_t offset;
int dictionary_large_offsets;
};
0083: ArrowArray* chunk # Current chunk.
0084: size_t chunk_index
0085: size_t offset # i.e. the element index (not byte offset)
0086: bint dictionary_large_offsets
0087:
0088:
+0089: cdef enum col_target_t:
enum __pyx_t_7questdb_7_client_col_target_t {
__pyx_e_7questdb_7_client_col_target_skip = 0,
__pyx_e_7questdb_7_client_col_target_table = 1,
__pyx_e_7questdb_7_client_col_target_symbol = 2,
__pyx_e_7questdb_7_client_col_target_column_bool = 3,
__pyx_e_7questdb_7_client_col_target_column_i64 = 4,
__pyx_e_7questdb_7_client_col_target_column_f64 = 5,
__pyx_e_7questdb_7_client_col_target_column_str = 6,
__pyx_e_7questdb_7_client_col_target_column_ts = 7,
__pyx_e_7questdb_7_client_col_target_column_arr_f64 = 8,
__pyx_e_7questdb_7_client_col_target_column_decimal = 9,
__pyx_e_7questdb_7_client_col_target_at = 10,
__pyx_e_7questdb_7_client_col_target_column_i8 = 11,
__pyx_e_7questdb_7_client_col_target_column_i16 = 12,
__pyx_e_7questdb_7_client_col_target_column_i32 = 13,
__pyx_e_7questdb_7_client_col_target_column_f32 = 14,
__pyx_e_7questdb_7_client_col_target_column_uuid = 15,
__pyx_e_7questdb_7_client_col_target_column_long256 = 16,
__pyx_e_7questdb_7_client_col_target_column_ipv4 = 17,
__pyx_e_7questdb_7_client_col_target_column_binary = 18,
__pyx_e_7questdb_7_client_col_target_column_arrow = 19
};
0090: col_target_skip = 0
0091: col_target_table = 1
0092: col_target_symbol = 2
0093: col_target_column_bool = 3
0094: col_target_column_i64 = 4
0095: col_target_column_f64 = 5
0096: col_target_column_str = 6
0097: col_target_column_ts = 7
0098: col_target_column_arr_f64 = 8
0099: col_target_column_decimal = 9
0100: col_target_at = 10
0101: # Narrow numeric targets used by the column-QWP path only. Each
0102: # maps to a dedicated wire type (BYTE / SHORT / INT / FLOAT)
0103: # instead of widening to LONG / DOUBLE. Selected by
0104: # `_FIELD_TARGETS_QWP`, which puts these ahead of the wide
0105: # targets so the resolver picks them for Arrow narrow sources;
0106: # row-ILP uses `_FIELD_TARGETS_ROW`, which does not list them.
0107: col_target_column_i8 = 11
0108: col_target_column_i16 = 12
0109: col_target_column_i32 = 13
0110: col_target_column_f32 = 14
0111: col_target_column_uuid = 15
0112: col_target_column_long256 = 16
0113: col_target_column_ipv4 = 17
0114: col_target_column_binary = 18
0115: # Generic Arrow field passthrough to the Rust importer; column-QWP only.
0116: col_target_column_arrow = 19
0117:
0118:
0119: cdef dict _TARGET_NAMES = {
+0120: col_target_t.col_target_skip: "skipped",
__pyx_t_4 = __Pyx_PyDict_NewPresized(20); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_skip); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_skipped) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0121: col_target_t.col_target_table: "table name",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_table); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_kp_u_table_name_2) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0122: col_target_t.col_target_symbol: "symbol",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_symbol); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_symbol) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0123: col_target_t.col_target_column_bool: "boolean",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_bool); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_boolean) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0124: col_target_t.col_target_column_i64: "integer",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i64); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_integer) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0125: col_target_t.col_target_column_f64: "float",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f64); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0126: col_target_t.col_target_column_str: "string",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_string) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0127: col_target_t.col_target_column_ts: "timestamp",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ts); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_timestamp) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0128: col_target_t.col_target_column_arr_f64: "array",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arr_f64); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_array) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0129: col_target_t.col_target_column_decimal: "decimal",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_decimal); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_decimal) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0130: col_target_t.col_target_at: "designated timestamp",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_at); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_kp_u_designated_timestamp) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0131: col_target_t.col_target_column_i8: "byte",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_byte) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0132: col_target_t.col_target_column_i16: "short",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i16); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_short) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0133: col_target_t.col_target_column_i32: "int",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i32); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0134: col_target_t.col_target_column_f32: "float32",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f32); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_float32) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0135: col_target_t.col_target_column_uuid: "uuid",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_uuid); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_uuid_2) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0136: col_target_t.col_target_column_long256: "long256",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_long256); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_long256) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0137: col_target_t.col_target_column_ipv4: "ipv4",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ipv4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_ipv4) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0138: col_target_t.col_target_column_binary: "binary",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_binary); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_binary) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0139: col_target_t.col_target_column_arrow: "arrow",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arrow); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_arrow) < (0)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__TARGET_NAMES); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__TARGET_NAMES, ((PyObject*)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0;
0140: }
0141:
0142:
+0143: cdef enum col_source_t:
enum __pyx_t_7questdb_7_client_col_source_t {
__pyx_e_7questdb_7_client_col_source_nulls = 0,
__pyx_e_7questdb_7_client_col_source_bool_pyobj = 0x18AEC,
__pyx_e_7questdb_7_client_col_source_bool_numpy = 0x18E70,
__pyx_e_7questdb_7_client_col_source_bool_arrow = 0x19258,
__pyx_e_7questdb_7_client_col_source_int_pyobj = 0x3118C,
__pyx_e_7questdb_7_client_col_source_u8_numpy = 0x31510,
__pyx_e_7questdb_7_client_col_source_i8_numpy = 0x318F8,
__pyx_e_7questdb_7_client_col_source_u16_numpy = 0x31CE0,
__pyx_e_7questdb_7_client_col_source_i16_numpy = 0x320C8,
__pyx_e_7questdb_7_client_col_source_u32_numpy = 0x324B0,
__pyx_e_7questdb_7_client_col_source_i32_numpy = 0x32898,
__pyx_e_7questdb_7_client_col_source_u64_numpy = 0x32C80,
__pyx_e_7questdb_7_client_col_source_i64_numpy = 0x33068,
__pyx_e_7questdb_7_client_col_source_u8_arrow = 0x33450,
__pyx_e_7questdb_7_client_col_source_i8_arrow = 0x33838,
__pyx_e_7questdb_7_client_col_source_u16_arrow = 0x33C20,
__pyx_e_7questdb_7_client_col_source_i16_arrow = 0x34008,
__pyx_e_7questdb_7_client_col_source_u32_arrow = 0x343F0,
__pyx_e_7questdb_7_client_col_source_i32_arrow = 0x347D8,
__pyx_e_7questdb_7_client_col_source_u64_arrow = 0x34BC0,
__pyx_e_7questdb_7_client_col_source_i64_arrow = 0x34FA8,
__pyx_e_7questdb_7_client_col_source_float_pyobj = 0x4982C,
__pyx_e_7questdb_7_client_col_source_f32_numpy = 0x49BB0,
__pyx_e_7questdb_7_client_col_source_f64_numpy = 0x49F98,
__pyx_e_7questdb_7_client_col_source_f32_arrow = 0x4A380,
__pyx_e_7questdb_7_client_col_source_f64_arrow = 0x4A768,
__pyx_e_7questdb_7_client_col_source_str_pyobj = 0x61ECC,
__pyx_e_7questdb_7_client_col_source_str_utf8_arrow = 0x62250,
__pyx_e_7questdb_7_client_col_source_str_i8_cat = 0x62638,
__pyx_e_7questdb_7_client_col_source_str_i16_cat = 0x62A20,
__pyx_e_7questdb_7_client_col_source_str_i32_cat = 0x62E08,
__pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow = 0x631F0,
__pyx_e_7questdb_7_client_col_source_dt64ns_numpy = 0x7A508,
__pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow = 0x7A8F0,
__pyx_e_7questdb_7_client_col_source_dt64us_numpy = 0x92BA8,
__pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow = 0x92F90,
__pyx_e_7questdb_7_client_col_source_dt64ms_tz_arrow = 0x93378,
__pyx_e_7questdb_7_client_col_source_dt64s_tz_arrow = 0x93760,
__pyx_e_7questdb_7_client_col_source_arr_f64_numpyobj = 0xAB2AC,
__pyx_e_7questdb_7_client_col_source_decimal_pyobj = 0xC394C,
__pyx_e_7questdb_7_client_col_source_decimal32_arrow = 0xC3CD0,
__pyx_e_7questdb_7_client_col_source_decimal64_arrow = 0xC40B8,
__pyx_e_7questdb_7_client_col_source_decimal128_arrow = 0xC44A0,
__pyx_e_7questdb_7_client_col_source_decimal256_arrow = 0xC4888,
__pyx_e_7questdb_7_client_col_source_fsb16_arrow = 0xDBF88,
__pyx_e_7questdb_7_client_col_source_fsb32_arrow = 0xDC370,
__pyx_e_7questdb_7_client_col_source_uuid_pyobj = 0xDC7BC,
__pyx_e_7questdb_7_client_col_source_ipv4_pyobj = 0xDCBA4,
__pyx_e_7questdb_7_client_col_source_datetime_pyobj = 0xDCF8C,
__pyx_e_7questdb_7_client_col_source_bytes_pyobj = 0xDD374,
__pyx_e_7questdb_7_client_col_source_arrow_passthrough = 0xF4240
};
0144: # Note: Hundreds digit set to 1 if GIL is required.
0145: col_source_nulls = 0
0146: col_source_bool_pyobj = 101100
0147: col_source_bool_numpy = 102000
0148: col_source_bool_arrow = 103000
0149: col_source_int_pyobj = 201100
0150: col_source_u8_numpy = 202000
0151: col_source_i8_numpy = 203000
0152: col_source_u16_numpy = 204000
0153: col_source_i16_numpy = 205000
0154: col_source_u32_numpy = 206000
0155: col_source_i32_numpy = 207000
0156: col_source_u64_numpy = 208000
0157: col_source_i64_numpy = 209000
0158: col_source_u8_arrow = 210000
0159: col_source_i8_arrow = 211000
0160: col_source_u16_arrow = 212000
0161: col_source_i16_arrow = 213000
0162: col_source_u32_arrow = 214000
0163: col_source_i32_arrow = 215000
0164: col_source_u64_arrow = 216000
0165: col_source_i64_arrow = 217000
0166: col_source_float_pyobj = 301100
0167: col_source_f32_numpy = 302000
0168: col_source_f64_numpy = 303000
0169: col_source_f32_arrow = 304000
0170: col_source_f64_arrow = 305000
0171: col_source_str_pyobj = 401100
0172: col_source_str_utf8_arrow = 402000
0173: col_source_str_i8_cat = 403000
0174: col_source_str_i16_cat = 404000
0175: col_source_str_i32_cat = 405000
0176: col_source_str_lrg_utf8_arrow = 406000
0177: col_source_dt64ns_numpy = 501000
0178: col_source_dt64ns_tz_arrow = 502000
0179: col_source_dt64us_numpy = 601000
0180: col_source_dt64us_tz_arrow = 602000
0181: # Designated-`at` only (columnar): widened to micros in Rust by the
0182: # millis/seconds designated-timestamp FFI.
0183: col_source_dt64ms_tz_arrow = 603000
0184: col_source_dt64s_tz_arrow = 604000
0185: col_source_arr_f64_numpyobj = 701100
0186: col_source_decimal_pyobj = 801100
0187: col_source_decimal32_arrow = 802000
0188: col_source_decimal64_arrow = 803000
0189: col_source_decimal128_arrow = 804000
0190: col_source_decimal256_arrow = 805000
0191: # FixedSizeBinary(16) — the canonical Arrow shape egress emits
0192: # for UUID columns (with or without the `arrow.uuid` extension
0193: # wrapper, which we strip on input). Column-QWP only; row-ILP
0194: # has no serializer for this source.
0195: col_source_fsb16_arrow = 901000
0196: # FixedSizeBinary(32) — the canonical shape egress emits for
0197: # LONG256 columns. Column-QWP only.
0198: col_source_fsb32_arrow = 902000
0199: # PyObject sniff outputs for QuestDB-specific wire kinds.
0200: col_source_uuid_pyobj = 903100
0201: col_source_ipv4_pyobj = 904100
0202: col_source_datetime_pyobj = 905100
0203: col_source_bytes_pyobj = 906100
0204: col_source_arrow_passthrough = 1000000
0205:
0206:
+0207: cdef bint col_source_needs_gil(col_source_t source) noexcept nogil:
static int __pyx_f_7questdb_7_client_col_source_needs_gil(enum __pyx_t_7questdb_7_client_col_source_t __pyx_v_source) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0208: # Check if hundreds digit is 1.
+0209: return <int>source // 100 % 10 == 1
__pyx_r = (__Pyx_mod_long(__Pyx_div_long(((int)__pyx_v_source), 0x64, 1), 10, 1) == 1); goto __pyx_L0;
0210:
0211:
0212: cdef set _STR_SOURCES = {
+0213: col_source_t.col_source_str_pyobj,
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_pyobj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4);
+0214: col_source_t.col_source_str_utf8_arrow,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_utf8_arrow); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0215: col_source_t.col_source_str_lrg_utf8_arrow,
__pyx_t_10 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10);
+0216: col_source_t.col_source_str_i8_cat,
__pyx_t_11 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i8_cat); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11);
+0217: col_source_t.col_source_str_i16_cat,
__pyx_t_12 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i16_cat); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12);
+0218: col_source_t.col_source_str_i32_cat,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i32_cat); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = PySet_New(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (PySet_Add(__pyx_t_14, __pyx_t_4) < (0)) __PYX_ERR(1, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PySet_Add(__pyx_t_14, __pyx_t_5) < (0)) __PYX_ERR(1, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PySet_Add(__pyx_t_14, __pyx_t_10) < (0)) __PYX_ERR(1, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (PySet_Add(__pyx_t_14, __pyx_t_11) < (0)) __PYX_ERR(1, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (PySet_Add(__pyx_t_14, __pyx_t_12) < (0)) __PYX_ERR(1, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (PySet_Add(__pyx_t_14, __pyx_t_13) < (0)) __PYX_ERR(1, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__STR_SOURCES); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__STR_SOURCES, ((PyObject*)__pyx_t_14)); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = 0;
0219: }
0220:
0221:
0222: cdef dict _PYOBJ_SOURCE_DESCR = {
+0223: col_source_t.col_source_bool_pyobj: "bool",
__pyx_t_14 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bool_pyobj); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_14, __pyx_t_13, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(1, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+0224: col_source_t.col_source_int_pyobj: "int",
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_int_pyobj); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_14, __pyx_t_13, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+0225: col_source_t.col_source_float_pyobj: "float",
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_float_pyobj); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_14, __pyx_t_13, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(1, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+0226: col_source_t.col_source_str_pyobj: "str",
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_pyobj); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_14, __pyx_t_13, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(1, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+0227: col_source_t.col_source_decimal_pyobj: "Decimal",
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_decimal_pyobj); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_14, __pyx_t_13, __pyx_mstate_global->__pyx_n_u_Decimal) < (0)) __PYX_ERR(1, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+0228: col_source_t.col_source_uuid_pyobj: "UUID",
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_uuid_pyobj); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_14, __pyx_t_13, __pyx_mstate_global->__pyx_n_u_UUID) < (0)) __PYX_ERR(1, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+0229: col_source_t.col_source_ipv4_pyobj: "IPv4Address",
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_ipv4_pyobj); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_14, __pyx_t_13, __pyx_mstate_global->__pyx_n_u_IPv4Address) < (0)) __PYX_ERR(1, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+0230: col_source_t.col_source_datetime_pyobj: "datetime",
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_datetime_pyobj); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_14, __pyx_t_13, __pyx_mstate_global->__pyx_n_u_datetime) < (0)) __PYX_ERR(1, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+0231: col_source_t.col_source_bytes_pyobj: "bytes",
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bytes_pyobj); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_14, __pyx_t_13, __pyx_mstate_global->__pyx_n_u_bytes) < (0)) __PYX_ERR(1, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PYOBJ_SOURCE_DESCR); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PYOBJ_SOURCE_DESCR, ((PyObject*)__pyx_t_14)); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = 0;
0232: }
0233:
0234:
0235: # Object-column sources only the columnar `QuestDB.dataframe()` path can ingest;
0236: # the row-oriented `Sender.dataframe()` has no ILP target for them.
+0237: cdef frozenset _COLUMNAR_ONLY_PYOBJ_SOURCES = frozenset((
__pyx_t_12 = __Pyx_PyFrozenSet_New(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__COLUMNAR_ONLY_PYOBJ_SOURCES); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__COLUMNAR_ONLY_PYOBJ_SOURCES, ((PyObject*)__pyx_t_12)); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0;
+0238: col_source_t.col_source_uuid_pyobj,
__pyx_t_14 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_uuid_pyobj); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); /* … */ __pyx_t_11 = PyTuple_Pack(3, __pyx_t_14, __pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+0239: col_source_t.col_source_ipv4_pyobj,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_ipv4_pyobj); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13);
+0240: col_source_t.col_source_bytes_pyobj,
__pyx_t_12 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bytes_pyobj); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12);
0241: ))
0242:
0243:
0244: # Compatibility matrix for the Python dataframe planner. `QuestDB.dataframe()`
0245: # uses the Rust Arrow RecordBatch route as the canonical Arrow policy when its
0246: # public routing constraints are satisfied.
0247: cdef dict _TARGET_TO_SOURCES = {
+0248: col_target_t.col_target_skip: {
__pyx_t_12 = __Pyx_PyDict_NewPresized(20); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_skip); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11);
+0249: col_source_t.col_source_nulls,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_nulls); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = PySet_New(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (PySet_Add(__pyx_t_14, __pyx_t_13) < (0)) __PYX_ERR(1, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_11, __pyx_t_14) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
0250: },
+0251: col_target_t.col_target_table: {
__pyx_t_14 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_table); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14);
+0252: col_source_t.col_source_str_pyobj,
__pyx_t_11 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_pyobj); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11);
+0253: col_source_t.col_source_str_utf8_arrow,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_utf8_arrow); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13);
+0254: col_source_t.col_source_str_lrg_utf8_arrow,
__pyx_t_10 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10);
+0255: col_source_t.col_source_str_i8_cat,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i8_cat); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0256: col_source_t.col_source_str_i16_cat,
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i16_cat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4);
+0257: col_source_t.col_source_str_i32_cat,
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i32_cat); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = PySet_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PySet_Add(__pyx_t_16, __pyx_t_11) < (0)) __PYX_ERR(1, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (PySet_Add(__pyx_t_16, __pyx_t_13) < (0)) __PYX_ERR(1, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PySet_Add(__pyx_t_16, __pyx_t_10) < (0)) __PYX_ERR(1, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (PySet_Add(__pyx_t_16, __pyx_t_5) < (0)) __PYX_ERR(1, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PySet_Add(__pyx_t_16, __pyx_t_4) < (0)) __PYX_ERR(1, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PySet_Add(__pyx_t_16, __pyx_t_15) < (0)) __PYX_ERR(1, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_14, __pyx_t_16) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
0258: },
+0259: col_target_t.col_target_symbol: {
__pyx_t_16 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_symbol); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16);
+0260: col_source_t.col_source_str_pyobj,
__pyx_t_14 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_pyobj); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14);
+0261: col_source_t.col_source_str_utf8_arrow,
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_utf8_arrow); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15);
+0262: col_source_t.col_source_str_lrg_utf8_arrow,
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4);
+0263: col_source_t.col_source_str_i8_cat,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i8_cat); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0264: col_source_t.col_source_str_i16_cat,
__pyx_t_10 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i16_cat); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10);
+0265: col_source_t.col_source_str_i32_cat,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i32_cat); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_11 = PySet_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PySet_Add(__pyx_t_11, __pyx_t_14) < (0)) __PYX_ERR(1, 260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (PySet_Add(__pyx_t_11, __pyx_t_15) < (0)) __PYX_ERR(1, 260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (PySet_Add(__pyx_t_11, __pyx_t_4) < (0)) __PYX_ERR(1, 260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PySet_Add(__pyx_t_11, __pyx_t_5) < (0)) __PYX_ERR(1, 260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PySet_Add(__pyx_t_11, __pyx_t_10) < (0)) __PYX_ERR(1, 260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (PySet_Add(__pyx_t_11, __pyx_t_13) < (0)) __PYX_ERR(1, 260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_16, __pyx_t_11) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
0266: },
+0267: col_target_t.col_target_column_bool: {
__pyx_t_11 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_bool); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11);
+0268: col_source_t.col_source_bool_pyobj,
__pyx_t_16 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bool_pyobj); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16);
+0269: col_source_t.col_source_bool_numpy,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bool_numpy); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13);
+0270: col_source_t.col_source_bool_arrow,
__pyx_t_10 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bool_arrow); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PySet_Add(__pyx_t_5, __pyx_t_16) < (0)) __PYX_ERR(1, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (PySet_Add(__pyx_t_5, __pyx_t_13) < (0)) __PYX_ERR(1, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PySet_Add(__pyx_t_5, __pyx_t_10) < (0)) __PYX_ERR(1, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_11, __pyx_t_5) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
0271: },
+0272: col_target_t.col_target_column_i64: {
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i64); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0273: col_source_t.col_source_int_pyobj,
__pyx_t_11 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_int_pyobj); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11);
+0274: col_source_t.col_source_u8_numpy,
__pyx_t_10 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u8_numpy); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10);
+0275: col_source_t.col_source_i8_numpy,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i8_numpy); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13);
+0276: col_source_t.col_source_u16_numpy,
__pyx_t_16 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u16_numpy); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16);
+0277: col_source_t.col_source_i16_numpy,
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i16_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4);
+0278: col_source_t.col_source_u32_numpy,
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u32_numpy); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15);
+0279: col_source_t.col_source_i32_numpy,
__pyx_t_14 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i32_numpy); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14);
+0280: col_source_t.col_source_u64_numpy,
__pyx_t_17 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u64_numpy); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17);
+0281: col_source_t.col_source_i64_numpy,
__pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i64_numpy); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18);
+0282: col_source_t.col_source_u8_arrow,
__pyx_t_19 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u8_arrow); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19);
+0283: col_source_t.col_source_i8_arrow,
__pyx_t_20 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i8_arrow); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20);
+0284: col_source_t.col_source_u16_arrow,
__pyx_t_21 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u16_arrow); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21);
+0285: col_source_t.col_source_i16_arrow,
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i16_arrow); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22);
+0286: col_source_t.col_source_u32_arrow,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u32_arrow); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0287: col_source_t.col_source_i32_arrow,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i32_arrow); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0288: col_source_t.col_source_u64_arrow,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u64_arrow); if (unlikely(!__pyx_t_25)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0289: col_source_t.col_source_i64_arrow,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i64_arrow); if (unlikely(!__pyx_t_26)) __PYX_ERR(1, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __pyx_t_27 = PySet_New(0); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); if (PySet_Add(__pyx_t_27, __pyx_t_11) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_10) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_13) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_16) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_4) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_15) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_14) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_17) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_18) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_19) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_20) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_21) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_22) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_23) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_24) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_25) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_26) < (0)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_5, __pyx_t_27) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
0290: },
+0291: col_target_t.col_target_column_f64: {
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f64); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0292: col_source_t.col_source_float_pyobj,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_float_pyobj); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0293: col_source_t.col_source_f32_numpy,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_f32_numpy); if (unlikely(!__pyx_t_26)) __PYX_ERR(1, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0294: col_source_t.col_source_f64_numpy,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_f64_numpy); if (unlikely(!__pyx_t_25)) __PYX_ERR(1, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0295: col_source_t.col_source_f32_arrow,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_f32_arrow); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0296: col_source_t.col_source_f64_arrow,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_f64_arrow); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_22 = PySet_New(0); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); if (PySet_Add(__pyx_t_22, __pyx_t_5) < (0)) __PYX_ERR(1, 292, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PySet_Add(__pyx_t_22, __pyx_t_26) < (0)) __PYX_ERR(1, 292, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (PySet_Add(__pyx_t_22, __pyx_t_25) < (0)) __PYX_ERR(1, 292, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PySet_Add(__pyx_t_22, __pyx_t_24) < (0)) __PYX_ERR(1, 292, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (PySet_Add(__pyx_t_22, __pyx_t_23) < (0)) __PYX_ERR(1, 292, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_27, __pyx_t_22) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
0297: },
+0298: col_target_t.col_target_column_i8: {
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i8); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22);
+0299: col_source_t.col_source_i8_arrow,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i8_arrow); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); __pyx_t_23 = PySet_New(0); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); if (PySet_Add(__pyx_t_23, __pyx_t_27) < (0)) __PYX_ERR(1, 299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_22, __pyx_t_23) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
0300: },
+0301: col_target_t.col_target_column_i16: {
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i16); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0302: col_source_t.col_source_i16_arrow,
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i16_arrow); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_27 = PySet_New(0); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); if (PySet_Add(__pyx_t_27, __pyx_t_22) < (0)) __PYX_ERR(1, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_23, __pyx_t_27) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
0303: },
+0304: col_target_t.col_target_column_i32: {
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i32); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0305: col_source_t.col_source_i32_arrow,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i32_arrow); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_22 = PySet_New(0); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); if (PySet_Add(__pyx_t_22, __pyx_t_23) < (0)) __PYX_ERR(1, 305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_27, __pyx_t_22) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
0306: },
+0307: col_target_t.col_target_column_f32: {
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f32); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22);
+0308: col_source_t.col_source_f32_arrow,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_f32_arrow); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); __pyx_t_23 = PySet_New(0); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); if (PySet_Add(__pyx_t_23, __pyx_t_27) < (0)) __PYX_ERR(1, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_22, __pyx_t_23) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
0309: },
+0310: col_target_t.col_target_column_uuid: {
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_uuid); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0311: col_source_t.col_source_fsb16_arrow,
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_fsb16_arrow); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22);
+0312: col_source_t.col_source_uuid_pyobj,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_uuid_pyobj); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); __pyx_t_24 = PySet_New(0); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); if (PySet_Add(__pyx_t_24, __pyx_t_22) < (0)) __PYX_ERR(1, 311, __pyx_L1_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (PySet_Add(__pyx_t_24, __pyx_t_27) < (0)) __PYX_ERR(1, 311, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_23, __pyx_t_24) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
0313: },
+0314: col_target_t.col_target_column_long256: {
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_long256); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0315: col_source_t.col_source_fsb32_arrow,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_fsb32_arrow); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_27 = PySet_New(0); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); if (PySet_Add(__pyx_t_27, __pyx_t_23) < (0)) __PYX_ERR(1, 315, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_24, __pyx_t_27) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
0316: },
+0317: col_target_t.col_target_column_binary: {
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_binary); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0318: col_source_t.col_source_bytes_pyobj,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bytes_pyobj); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_23 = PySet_New(0); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); if (PySet_Add(__pyx_t_23, __pyx_t_24) < (0)) __PYX_ERR(1, 318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_27, __pyx_t_23) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
0319: },
+0320: col_target_t.col_target_column_arrow: {
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arrow); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0321: col_source_t.col_source_arrow_passthrough,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_arrow_passthrough); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); __pyx_t_24 = PySet_New(0); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); if (PySet_Add(__pyx_t_24, __pyx_t_27) < (0)) __PYX_ERR(1, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_23, __pyx_t_24) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
0322: },
0323: # The Rust Arrow path treats UInt32 as IPV4 only when Arrow field
0324: # metadata says questdb.column_type=ipv4. Pandas drops Arrow field
0325: # metadata before it reaches this planner, so plain UInt32 must
0326: # resolve through col_target_column_i64 instead.
+0327: col_target_t.col_target_column_ipv4: {
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ipv4); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0328: col_source_t.col_source_ipv4_pyobj,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_ipv4_pyobj); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_27 = PySet_New(0); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); if (PySet_Add(__pyx_t_27, __pyx_t_23) < (0)) __PYX_ERR(1, 328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_24, __pyx_t_27) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
0329: },
+0330: col_target_t.col_target_column_str: {
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_str); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0331: col_source_t.col_source_str_pyobj,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_pyobj); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0332: col_source_t.col_source_str_utf8_arrow,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_utf8_arrow); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0333: col_source_t.col_source_str_lrg_utf8_arrow,
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22);
+0334: col_source_t.col_source_str_i8_cat,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i8_cat); if (unlikely(!__pyx_t_25)) __PYX_ERR(1, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0335: col_source_t.col_source_str_i16_cat,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i16_cat); if (unlikely(!__pyx_t_26)) __PYX_ERR(1, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0336: col_source_t.col_source_str_i32_cat,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i32_cat); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_21 = PySet_New(0); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); if (PySet_Add(__pyx_t_21, __pyx_t_24) < (0)) __PYX_ERR(1, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (PySet_Add(__pyx_t_21, __pyx_t_23) < (0)) __PYX_ERR(1, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PySet_Add(__pyx_t_21, __pyx_t_22) < (0)) __PYX_ERR(1, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (PySet_Add(__pyx_t_21, __pyx_t_25) < (0)) __PYX_ERR(1, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PySet_Add(__pyx_t_21, __pyx_t_26) < (0)) __PYX_ERR(1, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (PySet_Add(__pyx_t_21, __pyx_t_5) < (0)) __PYX_ERR(1, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_27, __pyx_t_21) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
0337: },
+0338: col_target_t.col_target_column_ts: {
__pyx_t_21 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ts); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21);
+0339: col_source_t.col_source_dt64ns_numpy,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64ns_numpy); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0340: col_source_t.col_source_dt64ns_tz_arrow,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0341: col_source_t.col_source_dt64us_numpy,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64us_numpy); if (unlikely(!__pyx_t_26)) __PYX_ERR(1, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0342: col_source_t.col_source_dt64us_tz_arrow,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow); if (unlikely(!__pyx_t_25)) __PYX_ERR(1, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0343: col_source_t.col_source_datetime_pyobj,
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_datetime_pyobj); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_23 = PySet_New(0); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); if (PySet_Add(__pyx_t_23, __pyx_t_27) < (0)) __PYX_ERR(1, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; if (PySet_Add(__pyx_t_23, __pyx_t_5) < (0)) __PYX_ERR(1, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PySet_Add(__pyx_t_23, __pyx_t_26) < (0)) __PYX_ERR(1, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (PySet_Add(__pyx_t_23, __pyx_t_25) < (0)) __PYX_ERR(1, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PySet_Add(__pyx_t_23, __pyx_t_22) < (0)) __PYX_ERR(1, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_21, __pyx_t_23) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
0344: },
+0345: col_target_t.col_target_column_arr_f64: {
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arr_f64); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0346: col_source_t.col_source_arr_f64_numpyobj,
__pyx_t_21 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_arr_f64_numpyobj); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_22 = PySet_New(0); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); if (PySet_Add(__pyx_t_22, __pyx_t_21) < (0)) __PYX_ERR(1, 346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_23, __pyx_t_22) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
0347: },
+0348: col_target_t.col_target_column_decimal: {
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_decimal); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22);
+0349: col_source_t.col_source_decimal_pyobj,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_decimal_pyobj); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0350: col_source_t.col_source_decimal32_arrow,
__pyx_t_21 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_decimal32_arrow); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21);
+0351: col_source_t.col_source_decimal64_arrow,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_decimal64_arrow); if (unlikely(!__pyx_t_25)) __PYX_ERR(1, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0352: col_source_t.col_source_decimal128_arrow,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_decimal128_arrow); if (unlikely(!__pyx_t_26)) __PYX_ERR(1, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0353: col_source_t.col_source_decimal256_arrow,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_decimal256_arrow); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_27 = PySet_New(0); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); if (PySet_Add(__pyx_t_27, __pyx_t_23) < (0)) __PYX_ERR(1, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_21) < (0)) __PYX_ERR(1, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_25) < (0)) __PYX_ERR(1, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_26) < (0)) __PYX_ERR(1, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (PySet_Add(__pyx_t_27, __pyx_t_5) < (0)) __PYX_ERR(1, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_22, __pyx_t_27) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
0354: },
+0355: col_target_t.col_target_at: {
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_at); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0356: col_source_t.col_source_dt64ns_numpy,
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64ns_numpy); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22);
+0357: col_source_t.col_source_dt64ns_tz_arrow,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0358: col_source_t.col_source_dt64us_numpy,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64us_numpy); if (unlikely(!__pyx_t_26)) __PYX_ERR(1, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0359: col_source_t.col_source_dt64us_tz_arrow,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow); if (unlikely(!__pyx_t_25)) __PYX_ERR(1, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0360: col_source_t.col_source_dt64ms_tz_arrow,
__pyx_t_21 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64ms_tz_arrow); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21);
+0361: col_source_t.col_source_dt64s_tz_arrow,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64s_tz_arrow); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0362: col_source_t.col_source_datetime_pyobj,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_datetime_pyobj); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_20 = PySet_New(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); if (PySet_Add(__pyx_t_20, __pyx_t_22) < (0)) __PYX_ERR(1, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (PySet_Add(__pyx_t_20, __pyx_t_5) < (0)) __PYX_ERR(1, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PySet_Add(__pyx_t_20, __pyx_t_26) < (0)) __PYX_ERR(1, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (PySet_Add(__pyx_t_20, __pyx_t_25) < (0)) __PYX_ERR(1, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PySet_Add(__pyx_t_20, __pyx_t_21) < (0)) __PYX_ERR(1, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (PySet_Add(__pyx_t_20, __pyx_t_23) < (0)) __PYX_ERR(1, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PySet_Add(__pyx_t_20, __pyx_t_24) < (0)) __PYX_ERR(1, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_t_27, __pyx_t_20) < (0)) __PYX_ERR(1, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__TARGET_TO_SOURCES); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__TARGET_TO_SOURCES, ((PyObject*)__pyx_t_12)); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0;
0363: },
0364: }
0365:
0366:
0367: # Field-target orderings used by `_dataframe_resolve_target` — each
0368: # protocol passes its own ordering so the resolver picks the right
0369: # target on the first hit.
0370: #
0371: # Many Arrow sources sit in multiple targets' source-sets
0372: # (`_TARGET_TO_SOURCES`) on purpose, e.g. `col_source_i8_arrow` lives
0373: # in both `col_target_column_i64` (so row-ILP can serialize it as
0374: # text via the existing i64 dispatch) and `col_target_column_i8` (so
0375: # column-QWP can send it as a BYTE wire type). The two `_FIELD_TARGETS_*`
0376: # tuples disambiguate: row-ILP lists wide targets only; column-QWP
0377: # lists narrow targets first so they win the resolver loop.
0378:
0379: cdef tuple _FIELD_TARGETS_ROW = (
+0380: col_target_t.col_target_skip,
__pyx_t_12 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_skip); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); /* … */ __pyx_t_5 = PyTuple_Pack(8, __pyx_t_12, __pyx_t_20, __pyx_t_27, __pyx_t_24, __pyx_t_23, __pyx_t_21, __pyx_t_25, __pyx_t_26); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__FIELD_TARGETS_ROW); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__FIELD_TARGETS_ROW, ((PyObject*)__pyx_t_5)); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0;
+0381: col_target_t.col_target_column_bool,
__pyx_t_20 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_bool); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20);
+0382: col_target_t.col_target_column_i64,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i64); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0383: col_target_t.col_target_column_f64,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f64); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0384: col_target_t.col_target_column_str,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_str); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0385: col_target_t.col_target_column_ts,
__pyx_t_21 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ts); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21);
+0386: col_target_t.col_target_column_arr_f64,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arr_f64); if (unlikely(!__pyx_t_25)) __PYX_ERR(1, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0387: col_target_t.col_target_column_decimal)
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_decimal); if (unlikely(!__pyx_t_26)) __PYX_ERR(1, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
0388:
0389: cdef tuple _FIELD_TARGETS_QWP = (
+0390: col_target_t.col_target_skip,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_skip); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* … */ __pyx_t_13 = PyTuple_Pack(17, __pyx_t_5, __pyx_t_26, __pyx_t_25, __pyx_t_21, __pyx_t_23, __pyx_t_24, __pyx_t_27, __pyx_t_20, __pyx_t_12, __pyx_t_22, __pyx_t_19, __pyx_t_18, __pyx_t_17, __pyx_t_14, __pyx_t_15, __pyx_t_4, __pyx_t_16); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__FIELD_TARGETS_QWP); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__FIELD_TARGETS_QWP, ((PyObject*)__pyx_t_13)); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0;
+0391: col_target_t.col_target_column_bool,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_bool); if (unlikely(!__pyx_t_26)) __PYX_ERR(1, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
0392: # Narrow numeric targets first — they own the Arrow narrow
0393: # sources (`i8_arrow`, `f32_arrow`, …) so column-QWP emits the
0394: # corresponding narrow wire types (BYTE / SHORT / INT / FLOAT)
0395: # instead of widening to LONG / DOUBLE.
+0396: col_target_t.col_target_column_i8,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i8); if (unlikely(!__pyx_t_25)) __PYX_ERR(1, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0397: col_target_t.col_target_column_i16,
__pyx_t_21 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i16); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21);
+0398: col_target_t.col_target_column_i32,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i32); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0399: col_target_t.col_target_column_i64,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i64); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
0400: # IPV4 remains a column-QWP target for the wire emitter, but this
0401: # pandas planner has no metadata-preserving UInt32 source that can
0402: # select it. Metadata-aware IPV4 routing belongs to the Rust Arrow
0403: # ingestion path.
+0404: col_target_t.col_target_column_ipv4,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ipv4); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0405: col_target_t.col_target_column_f32,
__pyx_t_20 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f32); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20);
+0406: col_target_t.col_target_column_f64,
__pyx_t_12 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f64); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12);
+0407: col_target_t.col_target_column_str,
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_str); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22);
+0408: col_target_t.col_target_column_ts,
__pyx_t_19 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ts); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19);
+0409: col_target_t.col_target_column_arr_f64,
__pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arr_f64); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18);
+0410: col_target_t.col_target_column_decimal,
__pyx_t_17 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_decimal); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17);
0411: # QuestDB-extension types whose Arrow source is unique
0412: # (FixedSizeBinary widths).
+0413: col_target_t.col_target_column_uuid,
__pyx_t_14 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_uuid); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14);
+0414: col_target_t.col_target_column_long256,
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_long256); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15);
+0415: col_target_t.col_target_column_binary,
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_binary); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4);
+0416: col_target_t.col_target_column_arrow)
__pyx_t_16 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arrow); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16);
0417:
0418:
0419: # Targets that map directly from a meta target.
0420: cdef set _DIRECT_META_TARGETS = {
+0421: col_target_t.col_target_table,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_table); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13);
+0422: col_target_t.col_target_symbol,
__pyx_t_16 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_symbol); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16);
+0423: col_target_t.col_target_at,
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_at); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_15 = PySet_New(0); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PySet_Add(__pyx_t_15, __pyx_t_13) < (0)) __PYX_ERR(1, 421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PySet_Add(__pyx_t_15, __pyx_t_16) < (0)) __PYX_ERR(1, 421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (PySet_Add(__pyx_t_15, __pyx_t_4) < (0)) __PYX_ERR(1, 421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__DIRECT_META_TARGETS); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__DIRECT_META_TARGETS, ((PyObject*)__pyx_t_15)); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = 0;
0424: }
0425:
0426:
0427: # This is verbose, but..
0428: # * Enums give us constants.
0429: # * Constants allow unfolding `if` statements into `switch`
0430: # * Switch statements can be more heavily optimized by the C compiler.
+0431: cdef enum col_dispatch_code_t:
enum __pyx_t_7questdb_7_client_col_dispatch_code_t {
0432: col_dispatch_code_skip_nulls = \
0433: col_target_t.col_target_skip + col_source_t.col_source_nulls
0434:
0435: col_dispatch_code_table__str_pyobj = \
0436: col_target_t.col_target_table + col_source_t.col_source_str_pyobj
0437: col_dispatch_code_table__str_utf8_arrow = \
0438: col_target_t.col_target_table + col_source_t.col_source_str_utf8_arrow
0439: col_dispatch_code_table__str_lrg_utf8_arrow = \
0440: col_target_t.col_target_table + col_source_t.col_source_str_lrg_utf8_arrow
0441: col_dispatch_code_table__str_i8_cat = \
0442: col_target_t.col_target_table + col_source_t.col_source_str_i8_cat
0443: col_dispatch_code_table__str_i16_cat = \
0444: col_target_t.col_target_table + col_source_t.col_source_str_i16_cat
0445: col_dispatch_code_table__str_i32_cat = \
0446: col_target_t.col_target_table + col_source_t.col_source_str_i32_cat
0447:
0448: col_dispatch_code_symbol__str_pyobj = \
0449: col_target_t.col_target_symbol + col_source_t.col_source_str_pyobj
0450: col_dispatch_code_symbol__str_utf8_arrow = \
0451: col_target_t.col_target_symbol + col_source_t.col_source_str_utf8_arrow
0452: col_dispatch_code_symbol__str_lrg_utf8_arrow = \
0453: col_target_t.col_target_symbol + col_source_t.col_source_str_lrg_utf8_arrow
0454: col_dispatch_code_symbol__str_i8_cat = \
0455: col_target_t.col_target_symbol + col_source_t.col_source_str_i8_cat
0456: col_dispatch_code_symbol__str_i16_cat = \
0457: col_target_t.col_target_symbol + col_source_t.col_source_str_i16_cat
0458: col_dispatch_code_symbol__str_i32_cat = \
0459: col_target_t.col_target_symbol + col_source_t.col_source_str_i32_cat
0460:
0461: col_dispatch_code_column_bool__bool_pyobj = \
0462: col_target_t.col_target_column_bool + col_source_t.col_source_bool_pyobj
0463: col_dispatch_code_column_bool__bool_numpy = \
0464: col_target_t.col_target_column_bool + col_source_t.col_source_bool_numpy
0465: col_dispatch_code_column_bool__bool_arrow = \
0466: col_target_t.col_target_column_bool + col_source_t.col_source_bool_arrow
0467:
0468: col_dispatch_code_column_i64__int_pyobj = \
0469: col_target_t.col_target_column_i64 + col_source_t.col_source_int_pyobj
0470: col_dispatch_code_column_i64__u8_numpy = \
0471: col_target_t.col_target_column_i64 + col_source_t.col_source_u8_numpy
0472: col_dispatch_code_column_i64__i8_numpy = \
0473: col_target_t.col_target_column_i64 + col_source_t.col_source_i8_numpy
0474: col_dispatch_code_column_i64__u16_numpy = \
0475: col_target_t.col_target_column_i64 + col_source_t.col_source_u16_numpy
0476: col_dispatch_code_column_i64__i16_numpy = \
0477: col_target_t.col_target_column_i64 + col_source_t.col_source_i16_numpy
0478: col_dispatch_code_column_i64__u32_numpy = \
0479: col_target_t.col_target_column_i64 + col_source_t.col_source_u32_numpy
0480: col_dispatch_code_column_i64__i32_numpy = \
0481: col_target_t.col_target_column_i64 + col_source_t.col_source_i32_numpy
0482: col_dispatch_code_column_i64__u64_numpy = \
0483: col_target_t.col_target_column_i64 + col_source_t.col_source_u64_numpy
0484: col_dispatch_code_column_i64__i64_numpy = \
0485: col_target_t.col_target_column_i64 + col_source_t.col_source_i64_numpy
0486: col_dispatch_code_column_i64__u8_arrow = \
0487: col_target_t.col_target_column_i64 + col_source_t.col_source_u8_arrow
0488: col_dispatch_code_column_i64__i8_arrow = \
0489: col_target_t.col_target_column_i64 + col_source_t.col_source_i8_arrow
0490: col_dispatch_code_column_i64__u16_arrow = \
0491: col_target_t.col_target_column_i64 + col_source_t.col_source_u16_arrow
0492: col_dispatch_code_column_i64__i16_arrow = \
0493: col_target_t.col_target_column_i64 + col_source_t.col_source_i16_arrow
0494: col_dispatch_code_column_i64__u32_arrow = \
0495: col_target_t.col_target_column_i64 + col_source_t.col_source_u32_arrow
0496: col_dispatch_code_column_i64__i32_arrow = \
0497: col_target_t.col_target_column_i64 + col_source_t.col_source_i32_arrow
0498: col_dispatch_code_column_i64__u64_arrow = \
0499: col_target_t.col_target_column_i64 + col_source_t.col_source_u64_arrow
0500: col_dispatch_code_column_i64__i64_arrow = \
0501: col_target_t.col_target_column_i64 + col_source_t.col_source_i64_arrow
0502:
0503: col_dispatch_code_column_f64__float_pyobj = \
0504: col_target_t.col_target_column_f64 + col_source_t.col_source_float_pyobj
0505: col_dispatch_code_column_f64__f32_numpy = \
0506: col_target_t.col_target_column_f64 + col_source_t.col_source_f32_numpy
0507: col_dispatch_code_column_f64__f64_numpy = \
0508: col_target_t.col_target_column_f64 + col_source_t.col_source_f64_numpy
0509: col_dispatch_code_column_f64__f32_arrow = \
0510: col_target_t.col_target_column_f64 + col_source_t.col_source_f32_arrow
0511: col_dispatch_code_column_f64__f64_arrow = \
0512: col_target_t.col_target_column_f64 + col_source_t.col_source_f64_arrow
0513:
0514: col_dispatch_code_column_str__str_pyobj = \
0515: col_target_t.col_target_column_str + col_source_t.col_source_str_pyobj
0516: col_dispatch_code_column_str__str_utf8_arrow = \
0517: col_target_t.col_target_column_str + col_source_t.col_source_str_utf8_arrow
0518: col_dispatch_code_column_str__str_lrg_utf8_arrow = \
0519: col_target_t.col_target_column_str + col_source_t.col_source_str_lrg_utf8_arrow
0520: col_dispatch_code_column_str__str_i8_cat = \
0521: col_target_t.col_target_column_str + col_source_t.col_source_str_i8_cat
0522: col_dispatch_code_column_str__str_i16_cat = \
0523: col_target_t.col_target_column_str + col_source_t.col_source_str_i16_cat
0524: col_dispatch_code_column_str__str_i32_cat = \
0525: col_target_t.col_target_column_str + col_source_t.col_source_str_i32_cat
0526:
0527: col_dispatch_code_column_ts__dt64ns_numpy = \
0528: col_target_t.col_target_column_ts + col_source_t.col_source_dt64ns_numpy
0529: col_dispatch_code_column_ts__dt64ns_tz_arrow = \
0530: col_target_t.col_target_column_ts + \
0531: col_source_t.col_source_dt64ns_tz_arrow
0532:
0533: col_dispatch_code_column_ts__dt64us_numpy = \
0534: col_target_t.col_target_column_ts + col_source_t.col_source_dt64us_numpy
0535: col_dispatch_code_column_ts__dt64us_tz_arrow = \
0536: col_target_t.col_target_column_ts + \
0537: col_source_t.col_source_dt64us_tz_arrow
0538:
0539: col_dispatch_code_at__dt64ns_numpy = \
0540: col_target_t.col_target_at + col_source_t.col_source_dt64ns_numpy
0541: col_dispatch_code_at__dt64ns_tz_arrow = \
0542: col_target_t.col_target_at + col_source_t.col_source_dt64ns_tz_arrow
0543:
0544: col_dispatch_code_at__dt64us_numpy = \
0545: col_target_t.col_target_at + col_source_t.col_source_dt64us_numpy
0546: col_dispatch_code_at__dt64us_tz_arrow = \
0547: col_target_t.col_target_at + col_source_t.col_source_dt64us_tz_arrow
0548:
0549: col_dispatch_code_column_arr_f64__arr_f64_numpyobj = \
0550: col_target_t.col_target_column_arr_f64 + col_source_t.col_source_arr_f64_numpyobj
0551:
0552: col_dispatch_code_column_decimal__decimal_pyobj = \
0553: col_target_t.col_target_column_decimal + col_source_t.col_source_decimal_pyobj
0554: col_dispatch_code_column_decimal__decimal32_arrow = \
0555: col_target_t.col_target_column_decimal + col_source_t.col_source_decimal32_arrow
0556: col_dispatch_code_column_decimal__decimal64_arrow = \
0557: col_target_t.col_target_column_decimal + col_source_t.col_source_decimal64_arrow
0558: col_dispatch_code_column_decimal__decimal128_arrow = \
0559: col_target_t.col_target_column_decimal + col_source_t.col_source_decimal128_arrow
0560: col_dispatch_code_column_decimal__decimal256_arrow = \
0561: col_target_t.col_target_column_decimal + col_source_t.col_source_decimal256_arrow
0562:
0563: col_dispatch_code_column_i8__i8_arrow = \
0564: col_target_t.col_target_column_i8 + col_source_t.col_source_i8_arrow
0565: col_dispatch_code_column_i16__i16_arrow = \
0566: col_target_t.col_target_column_i16 + col_source_t.col_source_i16_arrow
0567: col_dispatch_code_column_i32__i32_arrow = \
0568: col_target_t.col_target_column_i32 + col_source_t.col_source_i32_arrow
0569: col_dispatch_code_column_f32__f32_arrow = \
0570: col_target_t.col_target_column_f32 + col_source_t.col_source_f32_arrow
0571: col_dispatch_code_column_uuid__fsb16_arrow = \
0572: col_target_t.col_target_column_uuid + col_source_t.col_source_fsb16_arrow
0573: col_dispatch_code_column_uuid__uuid_pyobj = \
0574: col_target_t.col_target_column_uuid + col_source_t.col_source_uuid_pyobj
0575: col_dispatch_code_column_long256__fsb32_arrow = \
0576: col_target_t.col_target_column_long256 + col_source_t.col_source_fsb32_arrow
0577: col_dispatch_code_column_ipv4__u32_arrow = \
0578: col_target_t.col_target_column_ipv4 + col_source_t.col_source_u32_arrow
0579: col_dispatch_code_column_ipv4__ipv4_pyobj = \
0580: col_target_t.col_target_column_ipv4 + col_source_t.col_source_ipv4_pyobj
0581: col_dispatch_code_column_ts__datetime_pyobj = \
0582: col_target_t.col_target_column_ts + col_source_t.col_source_datetime_pyobj
0583: col_dispatch_code_at__datetime_pyobj = \
0584: col_target_t.col_target_at + col_source_t.col_source_datetime_pyobj
0585: col_dispatch_code_column_binary__bytes_pyobj = \
+0586: col_target_t.col_target_column_binary + col_source_t.col_source_bytes_pyobj
__pyx_e_7questdb_7_client_col_dispatch_code_skip_nulls = (__pyx_e_7questdb_7_client_col_target_skip + __pyx_e_7questdb_7_client_col_source_nulls), __pyx_e_7questdb_7_client_col_dispatch_code_table__str_pyobj = (__pyx_e_7questdb_7_client_col_target_table + __pyx_e_7questdb_7_client_col_source_str_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_table__str_utf8_arrow = (__pyx_e_7questdb_7_client_col_target_table + __pyx_e_7questdb_7_client_col_source_str_utf8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_table__str_lrg_utf8_arrow = (__pyx_e_7questdb_7_client_col_target_table + __pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_table__str_i8_cat = (__pyx_e_7questdb_7_client_col_target_table + __pyx_e_7questdb_7_client_col_source_str_i8_cat), __pyx_e_7questdb_7_client_col_dispatch_code_table__str_i16_cat = (__pyx_e_7questdb_7_client_col_target_table + __pyx_e_7questdb_7_client_col_source_str_i16_cat), __pyx_e_7questdb_7_client_col_dispatch_code_table__str_i32_cat = (__pyx_e_7questdb_7_client_col_target_table + __pyx_e_7questdb_7_client_col_source_str_i32_cat), __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_pyobj = (__pyx_e_7questdb_7_client_col_target_symbol + __pyx_e_7questdb_7_client_col_source_str_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_utf8_arrow = (__pyx_e_7questdb_7_client_col_target_symbol + __pyx_e_7questdb_7_client_col_source_str_utf8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_lrg_utf8_arrow = (__pyx_e_7questdb_7_client_col_target_symbol + __pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_i8_cat = (__pyx_e_7questdb_7_client_col_target_symbol + __pyx_e_7questdb_7_client_col_source_str_i8_cat), __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_i16_cat = (__pyx_e_7questdb_7_client_col_target_symbol + __pyx_e_7questdb_7_client_col_source_str_i16_cat), __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_i32_cat = (__pyx_e_7questdb_7_client_col_target_symbol + __pyx_e_7questdb_7_client_col_source_str_i32_cat), __pyx_e_7questdb_7_client_col_dispatch_code_column_bool__bool_pyobj = (__pyx_e_7questdb_7_client_col_target_column_bool + __pyx_e_7questdb_7_client_col_source_bool_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_bool__bool_numpy = (__pyx_e_7questdb_7_client_col_target_column_bool + __pyx_e_7questdb_7_client_col_source_bool_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_bool__bool_arrow = (__pyx_e_7questdb_7_client_col_target_column_bool + __pyx_e_7questdb_7_client_col_source_bool_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__int_pyobj = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_int_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u8_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u8_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i8_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i8_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u16_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u16_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i16_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i16_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u32_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u32_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i32_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i32_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u64_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u64_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i64_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i64_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u8_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i8_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u16_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u16_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i16_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i16_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u32_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i32_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u64_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u64_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i64_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i64_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__float_pyobj = (__pyx_e_7questdb_7_client_col_target_column_f64 + __pyx_e_7questdb_7_client_col_source_float_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f32_numpy = (__pyx_e_7questdb_7_client_col_target_column_f64 + __pyx_e_7questdb_7_client_col_source_f32_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f64_numpy = (__pyx_e_7questdb_7_client_col_target_column_f64 + __pyx_e_7questdb_7_client_col_source_f64_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f32_arrow = (__pyx_e_7questdb_7_client_col_target_column_f64 + __pyx_e_7questdb_7_client_col_source_f32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f64_arrow = (__pyx_e_7questdb_7_client_col_target_column_f64 + __pyx_e_7questdb_7_client_col_source_f64_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_pyobj = (__pyx_e_7questdb_7_client_col_target_column_str + __pyx_e_7questdb_7_client_col_source_str_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_utf8_arrow = (__pyx_e_7questdb_7_client_col_target_column_str + __pyx_e_7questdb_7_client_col_source_str_utf8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_lrg_utf8_arrow = (__pyx_e_7questdb_7_client_col_target_column_str + __pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_i8_cat = (__pyx_e_7questdb_7_client_col_target_column_str + __pyx_e_7questdb_7_client_col_source_str_i8_cat), __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_i16_cat = (__pyx_e_7questdb_7_client_col_target_column_str + __pyx_e_7questdb_7_client_col_source_str_i16_cat), __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_i32_cat = (__pyx_e_7questdb_7_client_col_target_column_str + __pyx_e_7questdb_7_client_col_source_str_i32_cat), __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64ns_numpy = (__pyx_e_7questdb_7_client_col_target_column_ts + __pyx_e_7questdb_7_client_col_source_dt64ns_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64ns_tz_arrow = (__pyx_e_7questdb_7_client_col_target_column_ts + __pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64us_numpy = (__pyx_e_7questdb_7_client_col_target_column_ts + __pyx_e_7questdb_7_client_col_source_dt64us_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64us_tz_arrow = (__pyx_e_7questdb_7_client_col_target_column_ts + __pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64ns_numpy = (__pyx_e_7questdb_7_client_col_target_at + __pyx_e_7questdb_7_client_col_source_dt64ns_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64ns_tz_arrow = (__pyx_e_7questdb_7_client_col_target_at + __pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64us_numpy = (__pyx_e_7questdb_7_client_col_target_at + __pyx_e_7questdb_7_client_col_source_dt64us_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64us_tz_arrow = (__pyx_e_7questdb_7_client_col_target_at + __pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_arr_f64__arr_f64_numpyobj = (__pyx_e_7questdb_7_client_col_target_column_arr_f64 + __pyx_e_7questdb_7_client_col_source_arr_f64_numpyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal_pyobj = (__pyx_e_7questdb_7_client_col_target_column_decimal + __pyx_e_7questdb_7_client_col_source_decimal_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal32_arrow = (__pyx_e_7questdb_7_client_col_target_column_decimal + __pyx_e_7questdb_7_client_col_source_decimal32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal64_arrow = (__pyx_e_7questdb_7_client_col_target_column_decimal + __pyx_e_7questdb_7_client_col_source_decimal64_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal128_arrow = (__pyx_e_7questdb_7_client_col_target_column_decimal + __pyx_e_7questdb_7_client_col_source_decimal128_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal256_arrow = (__pyx_e_7questdb_7_client_col_target_column_decimal + __pyx_e_7questdb_7_client_col_source_decimal256_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i8__i8_arrow = (__pyx_e_7questdb_7_client_col_target_column_i8 + __pyx_e_7questdb_7_client_col_source_i8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i16__i16_arrow = (__pyx_e_7questdb_7_client_col_target_column_i16 + __pyx_e_7questdb_7_client_col_source_i16_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i32__i32_arrow = (__pyx_e_7questdb_7_client_col_target_column_i32 + __pyx_e_7questdb_7_client_col_source_i32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_f32__f32_arrow = (__pyx_e_7questdb_7_client_col_target_column_f32 + __pyx_e_7questdb_7_client_col_source_f32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_uuid__fsb16_arrow = (__pyx_e_7questdb_7_client_col_target_column_uuid + __pyx_e_7questdb_7_client_col_source_fsb16_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_uuid__uuid_pyobj = (__pyx_e_7questdb_7_client_col_target_column_uuid + __pyx_e_7questdb_7_client_col_source_uuid_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_long256__fsb32_arrow = (__pyx_e_7questdb_7_client_col_target_column_long256 + __pyx_e_7questdb_7_client_col_source_fsb32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_ipv4__u32_arrow = (__pyx_e_7questdb_7_client_col_target_column_ipv4 + __pyx_e_7questdb_7_client_col_source_u32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_ipv4__ipv4_pyobj = (__pyx_e_7questdb_7_client_col_target_column_ipv4 + __pyx_e_7questdb_7_client_col_source_ipv4_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__datetime_pyobj = (__pyx_e_7questdb_7_client_col_target_column_ts + __pyx_e_7questdb_7_client_col_source_datetime_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_at__datetime_pyobj = (__pyx_e_7questdb_7_client_col_target_at + __pyx_e_7questdb_7_client_col_source_datetime_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_binary__bytes_pyobj = (__pyx_e_7questdb_7_client_col_target_column_binary + __pyx_e_7questdb_7_client_col_source_bytes_pyobj) };
0587:
0588:
0589: # Int values in order for sorting (as needed for API's sequential coupling).
+0590: cdef enum meta_target_t:
enum __pyx_t_7questdb_7_client_meta_target_t {
0591: meta_target_table = <int>col_target_t.col_target_table
0592: meta_target_symbol = <int>col_target_t.col_target_symbol
0593: meta_target_field = <int>col_target_t.col_target_column_bool
+0594: meta_target_at = <int>col_target_t.col_target_at
__pyx_e_7questdb_7_client_meta_target_table = ((int)__pyx_e_7questdb_7_client_col_target_table), __pyx_e_7questdb_7_client_meta_target_symbol = ((int)__pyx_e_7questdb_7_client_col_target_symbol), __pyx_e_7questdb_7_client_meta_target_field = ((int)__pyx_e_7questdb_7_client_col_target_column_bool), __pyx_e_7questdb_7_client_meta_target_at = ((int)__pyx_e_7questdb_7_client_col_target_at) };
0595:
0596:
+0597: cdef struct col_setup_t:
struct __pyx_t_7questdb_7_client_col_setup_t {
struct __pyx_t_7questdb_7_client_col_chunks_t chunks;
size_t orig_index;
Py_buffer pybuf;
struct ArrowSchema arrow_schema;
struct qwp_arrow_import *arrow_import;
enum __pyx_t_7questdb_7_client_col_source_t source;
enum __pyx_t_7questdb_7_client_meta_target_t meta_target;
enum __pyx_t_7questdb_7_client_col_target_t target;
int has_override;
enum qwp_numpy_dtype override_dtype;
uint8_t override_geohash_bits;
int nat_scan_done;
int nat_found;
};
0598: col_chunks_t chunks
0599: size_t orig_index
0600: Py_buffer pybuf
0601: ArrowSchema arrow_schema # Schema of first chunk.
0602: qwp_arrow_import* arrow_import
0603: col_source_t source
0604: meta_target_t meta_target
0605: col_target_t target
0606: bint has_override
0607: qwp_numpy_dtype override_dtype
0608: uint8_t override_geohash_bits
0609: bint nat_scan_done
0610: bint nat_found
0611:
0612:
+0613: cdef struct col_t:
struct __pyx_t_7questdb_7_client_col_t {
enum __pyx_t_7questdb_7_client_col_dispatch_code_t dispatch_code;
struct line_sender_column_name name;
struct __pyx_t_7questdb_7_client_col_cursor_t cursor;
struct __pyx_t_7questdb_7_client_col_setup_t *setup;
uint8_t scale;
};
0614: col_dispatch_code_t dispatch_code # source + target. Determines serializer.
0615: line_sender_column_name name
0616: col_cursor_t cursor
0617: col_setup_t* setup # Grouping to reduce size of struct.
0618: uint8_t scale # For arrow decimal types only, else 0.
0619:
0620:
+0621: cdef void col_t_release(col_t* col) noexcept:
static void __pyx_f_7questdb_7_client_col_t_release(struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
size_t __pyx_v_chunk_index;
struct ArrowArray *__pyx_v_chunk;
/* … */
/* function exit code */
__pyx_L0:;
}
0622: """
0623: Release a (possibly) initialized column.
0624:
0625: col_t objects are `calloc`ed, so uninitialized (or partially) initialized
0626: objects will have their pointers and other values set to 0.
0627: """
0628: cdef size_t chunk_index
0629: cdef ArrowArray* chunk
0630:
+0631: if col.setup == NULL:
__pyx_t_1 = (__pyx_v_col->setup == NULL);
if (__pyx_t_1) {
/* … */
}
+0632: return
goto __pyx_L0;
0633:
+0634: if Py_buffer_obj_is_set(&col.setup.pybuf):
__pyx_t_1 = Py_buffer_obj_is_set((&__pyx_v_col->setup->pybuf));
if (__pyx_t_1) {
/* … */
}
+0635: PyBuffer_Release(&col.setup.pybuf) # Note: Sets `.pybuf.obj` to NULL.
PyBuffer_Release((&__pyx_v_col->setup->pybuf));
0636:
+0637: if col.setup.arrow_import != NULL:
__pyx_t_1 = (__pyx_v_col->setup->arrow_import != NULL);
if (__pyx_t_1) {
/* … */
}
+0638: qwp_arrow_import_free(col.setup.arrow_import)
qwp_arrow_import_free(__pyx_v_col->setup->arrow_import);
+0639: col.setup.arrow_import = NULL
__pyx_v_col->setup->arrow_import = NULL;
0640:
+0641: for chunk_index in range(col.setup.chunks.n_chunks):
__pyx_t_2 = __pyx_v_col->setup->chunks.n_chunks;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_chunk_index = __pyx_t_4;
+0642: chunk = &col.setup.chunks.chunks[chunk_index]
__pyx_v_chunk = (&(__pyx_v_col->setup->chunks.chunks[__pyx_v_chunk_index]));
+0643: if chunk.release != NULL:
__pyx_t_1 = (__pyx_v_chunk->release != NULL);
if (__pyx_t_1) {
/* … */
}
+0644: chunk.release(chunk)
__pyx_v_chunk->release(__pyx_v_chunk);
+0645: memset(chunk, 0, sizeof(ArrowArray))
(void)(memset(__pyx_v_chunk, 0, (sizeof(struct ArrowArray)))); }
0646:
+0647: if col.setup.arrow_schema.release != NULL:
__pyx_t_1 = (__pyx_v_col->setup->arrow_schema.release != NULL);
if (__pyx_t_1) {
/* … */
}
+0648: col.setup.arrow_schema.release(&col.setup.arrow_schema)
__pyx_v_col->setup->arrow_schema.release((&__pyx_v_col->setup->arrow_schema));
0649:
+0650: free(col.setup.chunks.chunks)
free(__pyx_v_col->setup->chunks.chunks);
+0651: col.setup.chunks.chunks = NULL
__pyx_v_col->setup->chunks.chunks = NULL;
+0652: col.setup.chunks.n_chunks = 0
__pyx_v_col->setup->chunks.n_chunks = 0;
0653:
+0654: free(col.setup)
free(__pyx_v_col->setup);
+0655: col.setup = NULL
__pyx_v_col->setup = NULL;
0656:
0657:
0658: # Calloc'd array of col_t.
+0659: cdef struct col_t_arr:
struct __pyx_t_7questdb_7_client_col_t_arr {
size_t size;
struct __pyx_t_7questdb_7_client_col_t *d;
};
0660: size_t size
0661: col_t* d
0662:
0663:
0664: # Storage for one column's PyObject-sniffed, pre-built typed buffers.
0665: #
0666: # Lifetime is bound to the dataframe_plan_t that owns it. Buffers are
0667: # heap-allocated and freed in `pyobj_built_free`. The columnar emitter
0668: # accesses them via raw pointers (offsets / bytes / data / validity)
0669: # until the chunk flush completes.
+0670: cdef struct pyobj_built_t:
struct __pyx_t_7questdb_7_client_pyobj_built_t {
void *data;
int32_t *str_offsets;
uint8_t *str_bytes;
size_t str_bytes_len;
uint8_t *validity;
int has_nulls;
size_t row_count;
};
0671: # Per-source typed payload. Only one of these is set:
0672: # - str_pyobj : str_offsets + str_bytes
0673: # - int_pyobj : data (int64*)
0674: # - float_pyobj : data (double*)
0675: # - bool_pyobj : data (uint8* — LSB-packed Arrow bitmap, value bits)
0676: void* data
0677: int32_t* str_offsets # NULL except for str_pyobj
0678: uint8_t* str_bytes # NULL except for str_pyobj
0679: size_t str_bytes_len # bytes used (not capacity)
0680:
0681: # Validity bitmap (Arrow LSB-first). NULL when no nulls were seen.
0682: uint8_t* validity
0683: bint has_nulls
0684:
0685: size_t row_count
0686:
0687:
+0688: cdef struct dataframe_plan_t:
struct __pyx_t_7questdb_7_client_dataframe_plan_t {
size_t row_count;
size_t col_count;
struct line_sender_table_name c_table_name;
int64_t at_value;
struct __pyx_t_7questdb_7_client_col_t_arr cols;
int any_cols_need_gil;
struct qdb_pystr_pos str_buf_marker;
struct __pyx_t_7questdb_7_client_pyobj_built_t **pyobj_built;
};
0689: size_t row_count
0690: size_t col_count
0691: line_sender_table_name c_table_name
0692: int64_t at_value
0693: col_t_arr cols
0694: bint any_cols_need_gil
0695: qdb_pystr_pos str_buf_marker
0696: # Per-column pre-built PyObject buffers, indexed by col_index;
0697: # NULL slot for non-PyObject columns. The outer array is NULL until
0698: # `_dataframe_columnar_prebuild_pyobj` runs.
0699: pyobj_built_t** pyobj_built
0700:
0701:
+0702: cdef col_t_arr col_t_arr_blank() noexcept nogil:
static struct __pyx_t_7questdb_7_client_col_t_arr __pyx_f_7questdb_7_client_col_t_arr_blank(void) {
struct __pyx_t_7questdb_7_client_col_t_arr __pyx_v_arr;
struct __pyx_t_7questdb_7_client_col_t_arr __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0703: cdef col_t_arr arr
+0704: arr.size = 0
__pyx_v_arr.size = 0;
+0705: arr.d = NULL
__pyx_v_arr.d = NULL;
+0706: return arr
__pyx_r = __pyx_v_arr; goto __pyx_L0;
0707:
0708:
+0709: cdef col_t_arr col_t_arr_new(size_t size) noexcept nogil:
static struct __pyx_t_7questdb_7_client_col_t_arr __pyx_f_7questdb_7_client_col_t_arr_new(size_t __pyx_v_size) {
struct __pyx_t_7questdb_7_client_col_t_arr __pyx_v_arr;
size_t __pyx_v_index;
size_t __pyx_v_freed;
struct __pyx_t_7questdb_7_client_col_t_arr __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0710: cdef col_t_arr arr
0711: cdef size_t index
0712: cdef size_t freed
+0713: arr.size = size
__pyx_v_arr.size = __pyx_v_size;
+0714: arr.d = <col_t*>calloc(size, sizeof(col_t))
__pyx_v_arr.d = ((struct __pyx_t_7questdb_7_client_col_t *)calloc(__pyx_v_size, (sizeof(struct __pyx_t_7questdb_7_client_col_t))));
+0715: if arr.d == NULL:
__pyx_t_1 = (__pyx_v_arr.d == NULL);
if (__pyx_t_1) {
/* … */
}
+0716: arr.size = 0
__pyx_v_arr.size = 0;
+0717: return arr
__pyx_r = __pyx_v_arr;
goto __pyx_L0;
+0718: for index in range(size):
__pyx_t_2 = __pyx_v_size;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4;
+0719: arr.d[index].setup = <col_setup_t*>calloc(1, sizeof(col_setup_t))
(__pyx_v_arr.d[__pyx_v_index]).setup = ((struct __pyx_t_7questdb_7_client_col_setup_t *)calloc(1, (sizeof(struct __pyx_t_7questdb_7_client_col_setup_t))));
+0720: if arr.d[index].setup == NULL:
__pyx_t_1 = ((__pyx_v_arr.d[__pyx_v_index]).setup == NULL);
if (__pyx_t_1) {
/* … */
}
}
+0721: for freed in range(index):
__pyx_t_5 = __pyx_v_index;
__pyx_t_6 = __pyx_t_5;
for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
__pyx_v_freed = __pyx_t_7;
+0722: free(arr.d[freed].setup)
free((__pyx_v_arr.d[__pyx_v_freed]).setup);
}
+0723: free(arr.d)
free(__pyx_v_arr.d);
+0724: return col_t_arr_blank()
__pyx_r = __pyx_f_7questdb_7_client_col_t_arr_blank();
goto __pyx_L0;
+0725: return arr
__pyx_r = __pyx_v_arr; goto __pyx_L0;
0726:
0727:
+0728: cdef void col_t_arr_release(col_t_arr* arr) noexcept:
static void __pyx_f_7questdb_7_client_col_t_arr_release(struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_arr) {
size_t __pyx_v_index;
/* … */
/* function exit code */
}
0729: cdef size_t index
+0730: if arr.d:
__pyx_t_1 = (__pyx_v_arr->d != 0);
if (__pyx_t_1) {
/* … */
}
+0731: for index in range(arr.size):
__pyx_t_2 = __pyx_v_arr->size;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4;
+0732: col_t_release(&arr.d[index])
__pyx_f_7questdb_7_client_col_t_release((&(__pyx_v_arr->d[__pyx_v_index])));
}
+0733: free(arr.d)
free(__pyx_v_arr->d);
+0734: arr.size = 0
__pyx_v_arr->size = 0;
+0735: arr.d = NULL
__pyx_v_arr->d = NULL;
0736:
0737:
+0738: cdef dataframe_plan_t dataframe_plan_blank() noexcept nogil:
static struct __pyx_t_7questdb_7_client_dataframe_plan_t __pyx_f_7questdb_7_client_dataframe_plan_blank(void) {
struct __pyx_t_7questdb_7_client_dataframe_plan_t __pyx_v_plan;
struct __pyx_t_7questdb_7_client_dataframe_plan_t __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0739: cdef dataframe_plan_t plan
+0740: plan.row_count = 0
__pyx_v_plan.row_count = 0;
+0741: plan.col_count = 0
__pyx_v_plan.col_count = 0;
+0742: plan.c_table_name.buf = NULL
__pyx_v_plan.c_table_name.buf = NULL;
+0743: plan.c_table_name.len = 0
__pyx_v_plan.c_table_name.len = 0;
+0744: plan.at_value = 0
__pyx_v_plan.at_value = 0;
+0745: plan.cols = col_t_arr_blank()
__pyx_v_plan.cols = __pyx_f_7questdb_7_client_col_t_arr_blank();
+0746: plan.any_cols_need_gil = False
__pyx_v_plan.any_cols_need_gil = 0;
+0747: plan.str_buf_marker.chain = 0
__pyx_v_plan.str_buf_marker.chain = 0;
+0748: plan.str_buf_marker.string = 0
__pyx_v_plan.str_buf_marker.string = 0;
+0749: plan.pyobj_built = NULL
__pyx_v_plan.pyobj_built = NULL;
+0750: return plan
__pyx_r = __pyx_v_plan; goto __pyx_L0;
0751:
0752:
+0753: cdef void pyobj_built_free(pyobj_built_t* b) noexcept nogil:
static void __pyx_f_7questdb_7_client_pyobj_built_free(struct __pyx_t_7questdb_7_client_pyobj_built_t *__pyx_v_b) {
/* … */
/* function exit code */
__pyx_L0:;
}
+0754: if b == NULL:
__pyx_t_1 = (__pyx_v_b == NULL);
if (__pyx_t_1) {
/* … */
}
+0755: return
goto __pyx_L0;
+0756: if b.data != NULL:
__pyx_t_1 = (__pyx_v_b->data != NULL);
if (__pyx_t_1) {
/* … */
}
+0757: free(b.data)
free(__pyx_v_b->data);
+0758: if b.str_offsets != NULL:
__pyx_t_1 = (__pyx_v_b->str_offsets != NULL);
if (__pyx_t_1) {
/* … */
}
+0759: free(b.str_offsets)
free(__pyx_v_b->str_offsets);
+0760: if b.str_bytes != NULL:
__pyx_t_1 = (__pyx_v_b->str_bytes != NULL);
if (__pyx_t_1) {
/* … */
}
+0761: free(b.str_bytes)
free(__pyx_v_b->str_bytes);
+0762: if b.validity != NULL:
__pyx_t_1 = (__pyx_v_b->validity != NULL);
if (__pyx_t_1) {
/* … */
}
+0763: free(b.validity)
free(__pyx_v_b->validity);
+0764: free(b)
free(__pyx_v_b);
0765:
0766:
+0767: cdef void dataframe_plan_release(dataframe_plan_t* plan) noexcept:
static void __pyx_f_7questdb_7_client_dataframe_plan_release(struct __pyx_t_7questdb_7_client_dataframe_plan_t *__pyx_v_plan) {
size_t __pyx_v_i;
/* … */
/* function exit code */
}
0768: cdef size_t i
+0769: if plan.pyobj_built != NULL:
__pyx_t_1 = (__pyx_v_plan->pyobj_built != NULL);
if (__pyx_t_1) {
/* … */
}
+0770: for i in range(plan.col_count):
__pyx_t_2 = __pyx_v_plan->col_count;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
+0771: pyobj_built_free(plan.pyobj_built[i])
__pyx_f_7questdb_7_client_pyobj_built_free((__pyx_v_plan->pyobj_built[__pyx_v_i]));
}
+0772: free(plan.pyobj_built)
free(__pyx_v_plan->pyobj_built);
+0773: plan.pyobj_built = NULL
__pyx_v_plan->pyobj_built = NULL;
+0774: col_t_arr_release(&plan.cols)
__pyx_f_7questdb_7_client_col_t_arr_release((&__pyx_v_plan->cols));
+0775: plan.row_count = 0
__pyx_v_plan->row_count = 0;
+0776: plan.col_count = 0
__pyx_v_plan->col_count = 0;
+0777: plan.c_table_name.buf = NULL
__pyx_v_plan->c_table_name.buf = NULL;
+0778: plan.c_table_name.len = 0
__pyx_v_plan->c_table_name.len = 0;
+0779: plan.at_value = 0
__pyx_v_plan->at_value = 0;
+0780: plan.any_cols_need_gil = False
__pyx_v_plan->any_cols_need_gil = 0;
+0781: plan.str_buf_marker.chain = 0
__pyx_v_plan->str_buf_marker.chain = 0;
+0782: plan.str_buf_marker.string = 0
__pyx_v_plan->str_buf_marker.string = 0;
0783:
0784:
+0785: cdef object _NUMPY = None # module object
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY, Py_None); __Pyx_GIVEREF(Py_None);
+0786: cdef object _NUMPY_BOOL = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_BOOL); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_BOOL, Py_None); __Pyx_GIVEREF(Py_None);
+0787: cdef object _NUMPY_UINT8 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT8); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT8, Py_None); __Pyx_GIVEREF(Py_None);
+0788: cdef object _NUMPY_INT8 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT8); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT8, Py_None); __Pyx_GIVEREF(Py_None);
+0789: cdef object _NUMPY_UINT16 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT16); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT16, Py_None); __Pyx_GIVEREF(Py_None);
+0790: cdef object _NUMPY_INT16 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT16); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT16, Py_None); __Pyx_GIVEREF(Py_None);
+0791: cdef object _NUMPY_UINT32 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT32); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT32, Py_None); __Pyx_GIVEREF(Py_None);
+0792: cdef object _NUMPY_INT32 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT32); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT32, Py_None); __Pyx_GIVEREF(Py_None);
+0793: cdef object _NUMPY_UINT64 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT64, Py_None); __Pyx_GIVEREF(Py_None);
+0794: cdef object _NUMPY_INT64 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT64, Py_None); __Pyx_GIVEREF(Py_None);
+0795: cdef object _NUMPY_FLOAT32 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_FLOAT32); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_FLOAT32, Py_None); __Pyx_GIVEREF(Py_None);
+0796: cdef object _NUMPY_FLOAT64 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_FLOAT64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_FLOAT64, Py_None); __Pyx_GIVEREF(Py_None);
+0797: cdef object _NUMPY_DATETIME64 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_DATETIME64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_DATETIME64, Py_None); __Pyx_GIVEREF(Py_None);
+0798: cdef object _NUMPY_OBJECT = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_OBJECT); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_OBJECT, Py_None); __Pyx_GIVEREF(Py_None);
+0799: cdef object _PANDAS = None # module object
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PANDAS); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PANDAS, Py_None); __Pyx_GIVEREF(Py_None);
+0800: cdef object _PANDAS_NA = None # pandas.NA
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PANDAS_NA); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PANDAS_NA, Py_None); __Pyx_GIVEREF(Py_None);
+0801: cdef object _PANDAS_NAT = None # pandas.NaT
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PANDAS_NAT); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PANDAS_NAT, Py_None); __Pyx_GIVEREF(Py_None);
+0802: cdef object _PYARROW = None # module object, if available or None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PYARROW); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PYARROW, Py_None); __Pyx_GIVEREF(Py_None);
0803:
+0804: cdef int64_t _NAT = INT64_MIN # pandas NaT
__pyx_v_7questdb_7_client__NAT = INT64_MIN;
+0805: cdef object _EPOCH_AWARE_UTC = None # datetime(1970, 1, 1, tzinfo=utc)
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__EPOCH_AWARE_UTC); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__EPOCH_AWARE_UTC, Py_None); __Pyx_GIVEREF(Py_None);
0806:
+0807: cdef bint _dataframe_count_row_path_emissions = False
__pyx_v_7questdb_7_client__dataframe_count_row_path_emissions = 0;
+0808: cdef uint64_t _dataframe_row_path_emissions = 0
__pyx_v_7questdb_7_client__dataframe_row_path_emissions = 0;
0809:
0810:
+0811: cdef object _dataframe_may_import_deps():
static PyObject *__pyx_f_7questdb_7_client__dataframe_may_import_deps(void) {
PyObject *__pyx_v_pandas = NULL;
PyObject *__pyx_v_numpy = NULL;
PyObject *__pyx_v_ie = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("questdb._client._dataframe_may_import_deps", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_pandas);
__Pyx_XDECREF(__pyx_v_numpy);
__Pyx_XDECREF(__pyx_v_ie);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0812: global _NUMPY, _PANDAS, _PANDAS_NA, _PANDAS_NAT, _EPOCH_AWARE_UTC
0813: global _NUMPY_BOOL
0814: global _NUMPY_UINT8
0815: global _NUMPY_INT8
0816: global _NUMPY_UINT16
0817: global _NUMPY_INT16
0818: global _NUMPY_UINT32
0819: global _NUMPY_INT32
0820: global _NUMPY_UINT64
0821: global _NUMPY_INT64
0822: global _NUMPY_FLOAT32
0823: global _NUMPY_FLOAT64
0824: global _NUMPY_DATETIME64
0825: global _NUMPY_OBJECT
+0826: if _NUMPY is not None:
__pyx_t_1 = (__pyx_v_7questdb_7_client__NUMPY != Py_None);
if (__pyx_t_1) {
/* … */
}
+0827: return
__Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0;
+0828: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L9_try_end;
__pyx_L4_error:;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
/* … */
__pyx_L6_except_error:;
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
goto __pyx_L1_error;
__pyx_L9_try_end:;
}
+0829: import pandas
__pyx_t_6 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pandas, 0, 0, NULL, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 829, __pyx_L4_error) __pyx_t_5 = __pyx_t_6; __Pyx_GOTREF(__pyx_t_5); __pyx_v_pandas = __pyx_t_5; __pyx_t_5 = 0;
+0830: import numpy
__pyx_t_6 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 830, __pyx_L4_error) __pyx_t_5 = __pyx_t_6; __Pyx_GOTREF(__pyx_t_5); __pyx_v_numpy = __pyx_t_5; __pyx_t_5 = 0;
+0831: except ImportError as ie:
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError)))); if (__pyx_t_7) { __Pyx_AddTraceback("questdb._client._dataframe_may_import_deps", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(1, 831, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_v_ie = __pyx_t_8; /*try:*/ { /* … */ /*finally:*/ { __pyx_L15_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_7 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ie); __pyx_v_ie = 0; } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_15, __pyx_t_16); __pyx_t_6 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L6_except_error; } } } goto __pyx_L6_except_error;
+0832: raise ImportError(
__pyx_t_11 = NULL;
__pyx_t_12 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_Missing_dependencies_pandas_and};
__pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 832, __pyx_L15_error)
__Pyx_GOTREF(__pyx_t_10);
}
0833: 'Missing dependencies: `pandas` and `numpy` must be installed ' +
0834: 'to use the `.dataframe()` method. ' +
0835: 'See: https://py-questdb-client.readthedocs.io/' +
+0836: 'en/latest/installation.html.') from ie
__Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_ie); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(1, 832, __pyx_L15_error) }
+0837: _NUMPY_BOOL = type(numpy.dtype('bool'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_bool}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_BOOL); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_BOOL, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0838: _NUMPY_UINT8 = type(numpy.dtype('uint8'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_uint8}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT8); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT8, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0839: _NUMPY_INT8 = type(numpy.dtype('int8'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_int8}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT8); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT8, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0840: _NUMPY_UINT16 = type(numpy.dtype('uint16'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_uint16}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT16); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT16, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0841: _NUMPY_INT16 = type(numpy.dtype('int16'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_int16}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT16); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT16, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0842: _NUMPY_UINT32 = type(numpy.dtype('uint32'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_uint32}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT32); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT32, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0843: _NUMPY_INT32 = type(numpy.dtype('int32'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_int32}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT32); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT32, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0844: _NUMPY_UINT64 = type(numpy.dtype('uint64'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_uint64}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT64, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0845: _NUMPY_INT64 = type(numpy.dtype('int64'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_int64}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT64, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0846: _NUMPY_FLOAT32 = type(numpy.dtype('float32'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_float32}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_FLOAT32); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_FLOAT32, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0847: _NUMPY_FLOAT64 = type(numpy.dtype('float64'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_float64}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_FLOAT64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_FLOAT64, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0848: _NUMPY_DATETIME64 = type(numpy.dtype('datetime64[ns]'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_datetime64_ns}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_DATETIME64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_DATETIME64, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0849: _NUMPY_OBJECT = type(numpy.dtype('object'))
__pyx_t_8 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_object}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_OBJECT); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_OBJECT, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0850: _PANDAS = pandas
__Pyx_INCREF(__pyx_v_pandas); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PANDAS); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PANDAS, __pyx_v_pandas); __Pyx_GIVEREF(__pyx_v_pandas);
+0851: _PANDAS_NA = pandas.NA
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pandas, __pyx_mstate_global->__pyx_n_u_NA); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PANDAS_NA); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PANDAS_NA, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0;
+0852: _PANDAS_NAT = pandas.NaT
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pandas, __pyx_mstate_global->__pyx_n_u_NaT); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PANDAS_NAT); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PANDAS_NAT, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0;
+0853: _EPOCH_AWARE_UTC = datetime.datetime(
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* … */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[1], __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__EPOCH_AWARE_UTC); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__EPOCH_AWARE_UTC, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* … */ __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_1970, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
+0854: 1970, 1, 1, tzinfo=datetime.timezone.utc)
__pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_utc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (PyDict_SetItem(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_tzinfo, __pyx_t_5) < (0)) __PYX_ERR(1, 854, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0855: _NUMPY = numpy
__Pyx_INCREF(__pyx_v_numpy); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY, __pyx_v_numpy); __Pyx_GIVEREF(__pyx_v_numpy);
0856:
0857:
+0858: cdef object _dataframe_require_pyarrow():
static PyObject *__pyx_f_7questdb_7_client__dataframe_require_pyarrow(void) {
PyObject *__pyx_v_pyarrow = NULL;
PyObject *__pyx_v_ie = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("questdb._client._dataframe_require_pyarrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_pyarrow);
__Pyx_XDECREF(__pyx_v_ie);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0859: global _PYARROW
+0860: if _PYARROW is not None:
__pyx_t_1 = (__pyx_v_7questdb_7_client__PYARROW != Py_None);
if (__pyx_t_1) {
/* … */
}
+0861: return
__Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0;
+0862: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L9_try_end;
__pyx_L4_error:;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
/* … */
__pyx_L6_except_error:;
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
goto __pyx_L1_error;
__pyx_L9_try_end:;
}
+0863: import pyarrow
__pyx_t_6 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow, 0, 0, NULL, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 863, __pyx_L4_error) __pyx_t_5 = __pyx_t_6; __Pyx_GOTREF(__pyx_t_5); __pyx_v_pyarrow = __pyx_t_5; __pyx_t_5 = 0;
+0864: except ImportError as ie:
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError)))); if (__pyx_t_7) { __Pyx_AddTraceback("questdb._client._dataframe_require_pyarrow", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(1, 864, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_v_ie = __pyx_t_8; /*try:*/ { /* … */ /*finally:*/ { __pyx_L15_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_7 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ie); __pyx_v_ie = 0; } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_15, __pyx_t_16); __pyx_t_6 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L6_except_error; } } } goto __pyx_L6_except_error;
+0865: raise ImportError(
__pyx_t_11 = NULL;
__pyx_t_12 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_pyarrow_is_required_for_this_Da};
__pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 865, __pyx_L15_error)
__Pyx_GOTREF(__pyx_t_10);
}
0866: '`pyarrow` is required for this DataFrame path '
0867: '(ArrowDtype columns, pyarrow Table/RecordBatch sources, '
+0868: 'schema_overrides). Install with `pip install pyarrow`.') from ie
__Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_ie); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(1, 865, __pyx_L15_error) }
+0869: _PYARROW = pyarrow
__Pyx_INCREF(__pyx_v_pyarrow); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PYARROW); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PYARROW, __pyx_v_pyarrow); __Pyx_GIVEREF(__pyx_v_pyarrow);
0870:
0871:
+0872: cdef bint _PYARROW_IMPORT_FAILED = False
__pyx_v_7questdb_7_client__PYARROW_IMPORT_FAILED = 0;
0873:
0874:
+0875: cdef bint _dataframe_try_import_pyarrow():
static int __pyx_f_7questdb_7_client__dataframe_try_import_pyarrow(void) {
PyObject *__pyx_v_pyarrow = NULL;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("questdb._client._dataframe_try_import_pyarrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_pyarrow);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0876: global _PYARROW, _PYARROW_IMPORT_FAILED
+0877: if _PYARROW is not None:
__pyx_t_1 = (__pyx_v_7questdb_7_client__PYARROW != Py_None);
if (__pyx_t_1) {
/* … */
}
+0878: return True
__pyx_r = 1;
goto __pyx_L0;
+0879: if _PYARROW_IMPORT_FAILED:
if (__pyx_v_7questdb_7_client__PYARROW_IMPORT_FAILED) {
/* … */
}
+0880: return False
__pyx_r = 0;
goto __pyx_L0;
+0881: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L10_try_end;
__pyx_L5_error:;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
/* … */
__pyx_L7_except_error:;
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
goto __pyx_L1_error;
__pyx_L8_except_return:;
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
goto __pyx_L0;
__pyx_L10_try_end:;
}
+0882: import pyarrow
__pyx_t_6 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow, 0, 0, NULL, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 882, __pyx_L5_error) __pyx_t_5 = __pyx_t_6; __Pyx_GOTREF(__pyx_t_5); __pyx_v_pyarrow = __pyx_t_5; __pyx_t_5 = 0;
+0883: except ImportError:
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError)))); if (__pyx_t_7) { __Pyx_ErrRestore(0,0,0);
+0884: _PYARROW_IMPORT_FAILED = True
__pyx_v_7questdb_7_client__PYARROW_IMPORT_FAILED = 1;
+0885: return False
__pyx_r = 0;
goto __pyx_L8_except_return;
}
goto __pyx_L7_except_error;
+0886: _PYARROW = pyarrow
__Pyx_INCREF(__pyx_v_pyarrow); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PYARROW); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PYARROW, __pyx_v_pyarrow); __Pyx_GIVEREF(__pyx_v_pyarrow);
+0887: return True
__pyx_r = 1; goto __pyx_L0;
0888:
0889:
+0890: def _debug_dataframe_pyarrow_loaded():
/* Python wrapper */ static PyObject *__pyx_pw_7questdb_7_client_1_debug_dataframe_pyarrow_loaded(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_7questdb_7_client__debug_dataframe_pyarrow_loaded, "Internal: True iff `.dataframe()` has lazily imported pyarrow in\n this process. Intended for tests that verify a code path stayed\n pyarrow-free."); static PyMethodDef __pyx_mdef_7questdb_7_client_1_debug_dataframe_pyarrow_loaded = {"_debug_dataframe_pyarrow_loaded", (PyCFunction)__pyx_pw_7questdb_7_client_1_debug_dataframe_pyarrow_loaded, METH_NOARGS, __pyx_doc_7questdb_7_client__debug_dataframe_pyarrow_loaded}; static PyObject *__pyx_pw_7questdb_7_client_1_debug_dataframe_pyarrow_loaded(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_debug_dataframe_pyarrow_loaded (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7questdb_7_client__debug_dataframe_pyarrow_loaded(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7questdb_7_client__debug_dataframe_pyarrow_loaded(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("questdb._client._debug_dataframe_pyarrow_loaded", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_15 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7_client_1_debug_dataframe_pyarrow_loaded, 0, __pyx_mstate_global->__pyx_n_u_debug_dataframe_pyarrow_loaded, NULL, __pyx_mstate_global->__pyx_n_u_questdb__client, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_15); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_debug_dataframe_pyarrow_loaded, __pyx_t_15) < (0)) __PYX_ERR(1, 890, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
0891: """Internal: True iff `.dataframe()` has lazily imported pyarrow in
0892: this process. Intended for tests that verify a code path stayed
0893: pyarrow-free."""
+0894: return _PYARROW is not None
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = (__pyx_v_7questdb_7_client__PYARROW != Py_None); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0;
0895:
0896:
+0897: cdef object _dataframe_check_is_dataframe(object df):
static PyObject *__pyx_f_7questdb_7_client__dataframe_check_is_dataframe(PyObject *__pyx_v_df) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("questdb._client._dataframe_check_is_dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+0898: if not isinstance(df, _PANDAS.DataFrame):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_DataFrame); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_df, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (unlikely(__pyx_t_3)) { /* … */ }
+0899: raise QuestDBError(
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
+0900: QuestDBErrorCode.InvalidApiCall,
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_InvalidApiCall); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+0901: f'Bad argument `df`: Expected {_fqn(_PANDAS.DataFrame)}, ' +
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_DataFrame); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(PyType_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("type", __pyx_t_6))) __PYX_ERR(1, 901, __pyx_L1_error) __pyx_t_8 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyUnicode_Unicode(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* … */ __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 5, 28 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 24 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_7, __pyx_t_8}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 899, __pyx_L1_error)
+0902: f'not an object of type {_fqn(type(df))}.')
__pyx_t_8 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_df)))); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyUnicode_Unicode(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Bad_argument_df_Expected; __pyx_t_10[1] = __pyx_t_6; __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_not_an_object_of_type; __pyx_t_10[3] = __pyx_t_9; __pyx_t_10[4] = __pyx_mstate_global->__pyx_kp_u__2;
0903:
0904:
+0905: cdef ssize_t _dataframe_resolve_table_name(
static Py_ssize_t __pyx_f_7questdb_7_client__dataframe_resolve_table_name(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_df, PyObject *__pyx_v_pandas_cols, struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_cols, PyObject *__pyx_v_table_name, PyObject *__pyx_v_table_name_col, size_t __pyx_v_col_count, struct line_sender_table_name *__pyx_v_name_out) {
size_t __pyx_v_col_index;
struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col = 0;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
PyObject *__pyx_v_ie = NULL;
Py_ssize_t __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_table_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -2L;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_pandas_col);
__Pyx_XDECREF(__pyx_v_ie);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0906: qdb_pystr_buf* b,
0907: object df,
0908: list pandas_cols,
0909: col_t_arr* cols,
0910: object table_name,
0911: object table_name_col,
0912: size_t col_count,
0913: line_sender_table_name* name_out) except -2:
0914: """
0915: Resolve the table name string or column.
0916:
0917: Returns -1 if the table name is a string, otherwise the column index.
0918: """
+0919: cdef size_t col_index = 0
__pyx_v_col_index = 0;
0920: cdef PandasCol pandas_col
0921: cdef col_t* col
+0922: if table_name is not None:
__pyx_t_1 = (__pyx_v_table_name != Py_None);
if (__pyx_t_1) {
/* … */
}
+0923: if table_name_col is not None:
__pyx_t_1 = (__pyx_v_table_name_col != Py_None);
if (unlikely(__pyx_t_1)) {
/* … */
}
+0924: raise ValueError(
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Can_specify_only_one_of_table_na};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 924, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 924, __pyx_L1_error)
0925: 'Can specify only one of `table_name` or `table_name_col`.')
+0926: if isinstance(table_name, str):
__pyx_t_1 = PyUnicode_Check(__pyx_v_table_name);
if (likely(__pyx_t_1)) {
/* … */
}
+0927: try:
{
/*try:*/ {
/* … */
}
__pyx_L6_error:;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
/* … */
__pyx_L8_except_error:;
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
goto __pyx_L1_error;
__pyx_L10_try_return:;
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
goto __pyx_L0;
}
+0928: str_to_table_name_copy(b, <PyObject*>table_name, name_out)
__pyx_t_8 = __pyx_f_7questdb_7_client_str_to_table_name_copy(__pyx_v_b, ((PyObject *)__pyx_v_table_name), __pyx_v_name_out); if (unlikely(__pyx_t_8 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 928, __pyx_L6_error)
+0929: return -1 # Magic value for "no column index".
__pyx_r = -1L;
goto __pyx_L10_try_return;
+0930: except QuestDBError as ie:
__Pyx_ErrFetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_9); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 930, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_2, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_ErrRestore(__pyx_t_2, __pyx_t_3, __pyx_t_9); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_9 = 0; if (__pyx_t_11) { __Pyx_AddTraceback("questdb._client._dataframe_resolve_table_name", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(1, 930, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_v_ie = __pyx_t_3; /*try:*/ { /* … */ /*finally:*/ { __pyx_L17_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_11 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ie); __pyx_v_ie = 0; } __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L8_except_error; } } } goto __pyx_L8_except_error;
+0931: raise ValueError(
__pyx_t_12 = NULL;
+0932: f'Bad argument `table_name`: {ie}')
__pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_v_ie, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 932, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Bad_argument_table_name, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 932, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_14}; __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 931, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_10); } __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(1, 931, __pyx_L17_error) }
0933: else:
+0934: raise TypeError('Bad argument `table_name`: Must be str.')
/*else*/ {
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Bad_argument_table_name_Must_be};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 934, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 934, __pyx_L1_error)
}
+0935: elif table_name_col is not None:
__pyx_t_1 = (__pyx_v_table_name_col != Py_None);
if (__pyx_t_1) {
/* … */
}
+0936: if isinstance(table_name_col, str):
__pyx_t_1 = PyUnicode_Check(__pyx_v_table_name_col);
if (__pyx_t_1) {
/* … */
goto __pyx_L23;
}
+0937: _dataframe_get_loc(df, table_name_col, 'table_name_col', &col_index)
__pyx_t_2 = __pyx_v_table_name_col;
__Pyx_INCREF(__pyx_t_2);
if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(1, 937, __pyx_L1_error)
__pyx_t_8 = __pyx_f_7questdb_7_client__dataframe_get_loc(__pyx_v_df, ((PyObject*)__pyx_t_2), __pyx_mstate_global->__pyx_n_u_table_name_col, (&__pyx_v_col_index)); if (unlikely(__pyx_t_8 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 937, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0938: elif isinstance(table_name_col, int):
__pyx_t_1 = PyLong_Check(__pyx_v_table_name_col);
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L23;
}
+0939: _bind_col_index(
__pyx_t_8 = __pyx_f_7questdb_7_client__bind_col_index(__pyx_mstate_global->__pyx_n_u_table_name_col, __pyx_t_15, __pyx_v_col_count, (&__pyx_v_col_index)); if (unlikely(__pyx_t_8 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 939, __pyx_L1_error)
+0940: 'table_name_col', table_name_col, col_count, &col_index)
__pyx_t_15 = __Pyx_PyLong_As_int(__pyx_v_table_name_col); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 940, __pyx_L1_error)
0941: else:
+0942: raise TypeError(
/*else*/ {
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Bad_argument_table_name_col_must};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 942, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 942, __pyx_L1_error)
}
__pyx_L23:;
0943: 'Bad argument `table_name_col`: ' +
0944: 'must be a column name (str) or index (int).')
+0945: pandas_col = pandas_cols[col_index]
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 945, __pyx_L1_error)
}
__pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pandas_cols, __pyx_v_col_index, size_t, 0, __Pyx_PyLong_FromSize_t, 1, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 945, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_PandasCol))))) __PYX_ERR(1, 945, __pyx_L1_error)
__pyx_v_pandas_col = ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_2);
__pyx_t_2 = 0;
+0946: col = &cols.d[col_index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_col_index]));
+0947: _dataframe_check_column_is_str(
__pyx_t_8 = __pyx_f_7questdb_7_client__dataframe_check_column_is_str(__pyx_mstate_global->__pyx_kp_u_Bad_argument_table_name_col, __pyx_v_pandas_col, __pyx_v_col->setup->source); if (unlikely(__pyx_t_8 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 947, __pyx_L1_error)
0948: 'Bad argument `table_name_col`: ',
0949: pandas_col,
0950: col.setup.source)
+0951: col.setup.meta_target = meta_target_t.meta_target_table
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_table;
+0952: name_out.len = 0
__pyx_v_name_out->len = 0;
+0953: name_out.buf = NULL
__pyx_v_name_out->buf = NULL;
+0954: return col_index
__pyx_r = __pyx_v_col_index;
goto __pyx_L0;
+0955: elif df.index.name:
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 955, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_1)) { /* … */ }
+0956: if not isinstance(df.index.name, str):
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = PyUnicode_Check(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_23 = (!__pyx_t_1); if (unlikely(__pyx_t_23)) { /* … */ }
+0957: raise TypeError(
__pyx_t_3 = NULL;
0958: 'Bad dataframe index name as table name: Expected str, ' +
+0959: f'not an object of type {_fqn(type(df.index.name))}.')
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_t_10)))); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyUnicode_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_24[0] = __pyx_mstate_global->__pyx_kp_u_Bad_dataframe_index_name_as_tabl; __pyx_t_24[1] = __pyx_t_10; __pyx_t_24[2] = __pyx_mstate_global->__pyx_kp_u__2; __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_24, 3, 76 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 957, __pyx_L1_error)
0960:
0961: # If the index has a name, use that as the table name.
+0962: try:
{
/*try:*/ {
/* … */
}
__pyx_L25_error:;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
/* … */
__pyx_L27_except_error:;
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L29_try_return:;
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
goto __pyx_L0;
}
+0963: str_to_table_name_copy(b, <PyObject*>df.index.name, name_out)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 963, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 963, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __pyx_f_7questdb_7_client_str_to_table_name_copy(__pyx_v_b, ((PyObject *)__pyx_t_9), __pyx_v_name_out); if (unlikely(__pyx_t_8 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 963, __pyx_L25_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0964: return -1 # Magic value for "no column index".
__pyx_r = -1L;
goto __pyx_L29_try_return;
+0965: except QuestDBError as ie:
__Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_2, &__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 965, __pyx_L27_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_15 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_9, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_ErrRestore(__pyx_t_9, __pyx_t_2, __pyx_t_3); __pyx_t_9 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; if (__pyx_t_15) { __Pyx_AddTraceback("questdb._client._dataframe_resolve_table_name", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_9) < 0) __PYX_ERR(1, 965, __pyx_L27_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_v_ie = __pyx_t_2; /*try:*/ { /* … */ /*finally:*/ { __pyx_L36_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17); if ( unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_15 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_25 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ie); __pyx_v_ie = 0; } __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ErrRestore(__pyx_t_22, __pyx_t_21, __pyx_t_20); __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_25; goto __pyx_L27_except_error; } } } goto __pyx_L27_except_error;
+0966: raise ValueError(
__pyx_t_14 = NULL;
+0967: f'Bad dataframe index name as table name: {ie}')
__pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_v_ie, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 967, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Bad_dataframe_index_name_as_tabl_2, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 967, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_13}; __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 966, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_10); } __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(1, 966, __pyx_L36_error) }
0968: else:
+0969: raise ValueError(
/*else*/ {
__pyx_t_2 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Must_specify_at_least_one_of_tab};
__pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
}
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__PYX_ERR(1, 969, __pyx_L1_error)
}
0970: 'Must specify at least one of `table_name` or `table_name_col`, ' +
0971: 'or set the dataframe index name (df.index.name = \'tbl_name\').')
0972:
0973:
+0974: cdef void_int _bind_col_index(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__bind_col_index(PyObject *__pyx_v_arg_name, int __pyx_v_col_num, size_t __pyx_v_col_count, size_t *__pyx_v_col_index) {
int __pyx_v_bad;
int __pyx_v_orig_col_num;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("questdb._client._bind_col_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0975: str arg_name, int col_num, size_t col_count,
0976: size_t* col_index) except -1:
0977: """
0978: Validate that `col_index` is in bounds for `col_count`.
0979: This function also converts negative indicies (e.g. -1 for last column) to
0980: positive indicies.
0981: """
+0982: cdef bint bad = False
__pyx_v_bad = 0;
+0983: cdef int orig_col_num = col_num
__pyx_v_orig_col_num = __pyx_v_col_num;
+0984: if col_num < 0:
__pyx_t_1 = (__pyx_v_col_num < 0);
if (__pyx_t_1) {
/* … */
}
+0985: col_num += col_count # Try convert negative offsets to positive ones.
__pyx_v_col_num = (__pyx_v_col_num + __pyx_v_col_count);
+0986: if col_num < 0:
__pyx_t_1 = (__pyx_v_col_num < 0);
if (__pyx_t_1) {
/* … */
}
+0987: bad = True
__pyx_v_bad = 1;
+0988: if (not bad) and (<size_t>col_num >= col_count):
__pyx_t_2 = (!__pyx_v_bad);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_2 = (((size_t)__pyx_v_col_num) >= __pyx_v_col_count);
__pyx_t_1 = __pyx_t_2;
__pyx_L6_bool_binop_done:;
if (__pyx_t_1) {
/* … */
}
+0989: bad = True
__pyx_v_bad = 1;
+0990: if bad:
if (unlikely(__pyx_v_bad)) {
/* … */
}
+0991: raise IndexError(
__pyx_t_4 = NULL;
+0992: f'Bad argument `{arg_name}`: {orig_col_num} index out of range')
__pyx_t_5 = __Pyx_PyUnicode_Unicode(__pyx_v_arg_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_orig_col_num, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Bad_argument; __pyx_t_7[1] = __pyx_t_5; __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__12; __pyx_t_7[3] = __pyx_t_6; __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_index_out_of_range; __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 3 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 19, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 991, __pyx_L1_error)
+0993: col_index[0] = <size_t>col_num
(__pyx_v_col_index[0]) = ((size_t)__pyx_v_col_num);
0994:
0995:
+0996: cdef void_int _dataframe_check_column_is_str(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_check_column_is_str(PyObject *__pyx_v_err_msg_prefix, struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, enum __pyx_t_7questdb_7_client_col_source_t __pyx_v_source) {
PyObject *__pyx_v_inferred_descr = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("questdb._client._dataframe_check_column_is_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_inferred_descr);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0997: str err_msg_prefix,
0998: PandasCol pandas_col,
0999: col_source_t source) except -1:
+1000: cdef str inferred_descr = ""
__Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__7);
__pyx_v_inferred_descr = __pyx_mstate_global->__pyx_kp_u__7;
+1001: if not source in _STR_SOURCES:
__pyx_t_1 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_source); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_7questdb_7_client__STR_SOURCES == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(1, 1001, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_7questdb_7_client__STR_SOURCES, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1001, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1002: if isinstance(pandas_col.dtype, _NUMPY_OBJECT):
__pyx_t_1 = __pyx_v_pandas_col->dtype;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_v_7questdb_7_client__NUMPY_OBJECT;
__Pyx_INCREF(__pyx_t_3);
__pyx_t_2 = PyObject_IsInstance(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1002, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_2) {
/* … */
}
1003: inferred_descr = (
+1004: f' (inferred type: '
__pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, 17 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_inferred_descr, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0;
+1005: f'{_PYOBJ_SOURCE_DESCR.get(source, "unknown")})')
if (unlikely(__pyx_v_7questdb_7_client__PYOBJ_SOURCE_DESCR == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
__PYX_ERR(1, 1005, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_source); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1005, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_7questdb_7_client__PYOBJ_SOURCE_DESCR, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_unknown); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1005, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1005, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_inferred_type;
__pyx_t_4[1] = __pyx_t_3;
__pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u__5;
+1006: raise QuestDBError(
__pyx_t_3 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1006, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
+1007: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1008: err_msg_prefix +
__pyx_t_6 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_err_msg_prefix, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1009: f'Bad dtype `{pandas_col.dtype}`{inferred_descr} for the ' +
__pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_pandas_col->dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_Bad_dtype; __pyx_t_8[1] = __pyx_t_6; __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u__13; __pyx_t_8[3] = __pyx_v_inferred_descr; __pyx_t_8[4] = __pyx_mstate_global->__pyx_kp_u_for_the; __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_8, 5, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_inferred_descr) + 9, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_inferred_descr)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* … */ __pyx_t_9 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_7, __pyx_t_9}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 1006, __pyx_L1_error)
+1010: f'{pandas_col.name!r} column: Must be a strings column.')
__pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_column_Must_be_a_strings_column); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
1011:
1012:
+1013: @cython.internal
struct __pyx_obj_7questdb_7_client_PandasCol {
PyObject_HEAD
PyObject *name;
PyObject *dtype;
PyObject *series;
};
1014: cdef class PandasCol:
1015: """Python object representing a column to parse .dataframe() arguments."""
1016: cdef str name
1017: cdef object dtype
1018: cdef object series
1019:
+1020: def __init__(
/* Python wrapper */
static int __pyx_pw_7questdb_7_client_9PandasCol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7questdb_7_client_9PandasCol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_dtype = 0;
PyObject *__pyx_v_series = 0;
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
#endif
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_dtype,&__pyx_mstate_global->__pyx_n_u_series,0};
PyObject* values[3] = {0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 1020, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 1020, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 1020, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 1020, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(1, 1020, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(1, 1020, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 3)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 1020, __pyx_L3_error)
values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 1020, __pyx_L3_error)
values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 1020, __pyx_L3_error)
}
__pyx_v_name = ((PyObject*)values[0]);
__pyx_v_dtype = values[1];
__pyx_v_series = values[2];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1020, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("questdb._client.PandasCol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(1, 1022, __pyx_L1_error)
__pyx_r = __pyx_pf_7questdb_7_client_9PandasCol___init__(((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_v_self), __pyx_v_name, __pyx_v_dtype, __pyx_v_series);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_7questdb_7_client_9PandasCol___init__(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_dtype, PyObject *__pyx_v_series) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1021: self,
1022: str name,
1023: object dtype,
1024: object series):
+1025: self.name = name
__Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_name;
+1026: self.dtype = dtype
__Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = __pyx_v_dtype;
+1027: self.series = series
__Pyx_INCREF(__pyx_v_series); __Pyx_GIVEREF(__pyx_v_series); __Pyx_GOTREF(__pyx_v_self->series); __Pyx_DECREF(__pyx_v_self->series); __pyx_v_self->series = __pyx_v_series;
1028:
+1029: cdef void_int _dataframe_resolve_symbols(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_resolve_symbols(PyObject *__pyx_v_df, PyObject *__pyx_v_pandas_cols, struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_cols, Py_ssize_t __pyx_v_table_name_col, Py_ssize_t __pyx_v_at_col, PyObject *__pyx_v_symbols) {
size_t __pyx_v_col_index;
PyObject *__pyx_v_symbol = 0;
struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col = 0;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_symbol);
__Pyx_XDECREF((PyObject *)__pyx_v_pandas_col);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1030: object df,
1031: list pandas_cols,
1032: col_t_arr* cols,
1033: ssize_t table_name_col,
1034: ssize_t at_col,
1035: object symbols) except -1:
+1036: cdef size_t col_index = 0
__pyx_v_col_index = 0;
1037: cdef object symbol
1038: cdef PandasCol pandas_col
1039: cdef col_t* col
+1040: if symbols == 'auto':
__pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_symbols, __pyx_mstate_global->__pyx_n_u_auto, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 1040, __pyx_L1_error) if (__pyx_t_1) { /* … */ goto __pyx_L3; }
+1041: for col_index in range(cols.size):
__pyx_t_2 = __pyx_v_cols->size;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_col_index = __pyx_t_4;
+1042: pandas_col = pandas_cols[col_index]
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 1042, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_pandas_cols, __pyx_v_col_index, size_t, 0, __Pyx_PyLong_FromSize_t, 1, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1042, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_PandasCol))))) __PYX_ERR(1, 1042, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_pandas_col, ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_5));
__pyx_t_5 = 0;
+1043: col = &cols.d[col_index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_col_index]));
+1044: if col.setup.meta_target == meta_target_t.meta_target_field:
__pyx_t_1 = (__pyx_v_col->setup->meta_target == __pyx_e_7questdb_7_client_meta_target_field);
if (__pyx_t_1) {
/* … */
}
}
+1045: if isinstance(pandas_col.dtype, _PANDAS.CategoricalDtype):
__pyx_t_5 = __pyx_v_pandas_col->dtype;
__Pyx_INCREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_CategoricalDtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1045, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyObject_IsInstance(__pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1045, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_1) {
/* … */
}
+1046: col.setup.meta_target = meta_target_t.meta_target_symbol
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_symbol;
+1047: elif symbols is False:
__pyx_t_1 = (__pyx_v_symbols == Py_False);
if (__pyx_t_1) {
goto __pyx_L3;
}
1048: pass
+1049: elif symbols is True:
__pyx_t_1 = (__pyx_v_symbols == Py_True);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+1050: for col_index in range(cols.size):
__pyx_t_2 = __pyx_v_cols->size;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_col_index = __pyx_t_4;
+1051: col = &cols.d[col_index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_col_index]));
+1052: if col.setup.source in _STR_SOURCES:
__pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_col->setup->source); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_v_7questdb_7_client__STR_SOURCES == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(1, 1052, __pyx_L1_error) } __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_t_6, __pyx_v_7questdb_7_client__STR_SOURCES, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 1052, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { /* … */ } }
+1053: pandas_col = pandas_cols[col_index]
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 1053, __pyx_L1_error)
}
__pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_pandas_cols, __pyx_v_col_index, size_t, 0, __Pyx_PyLong_FromSize_t, 1, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1053, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_PandasCol))))) __PYX_ERR(1, 1053, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_pandas_col, ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_6));
__pyx_t_6 = 0;
+1054: if col.setup.meta_target == meta_target_t.meta_target_field:
__pyx_t_1 = (__pyx_v_col->setup->meta_target == __pyx_e_7questdb_7_client_meta_target_field);
if (__pyx_t_1) {
/* … */
}
+1055: col.setup.meta_target = meta_target_t.meta_target_symbol
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_symbol;
1056: else:
+1057: if not isinstance(symbols, (tuple, list)):
/*else*/ {
__pyx_t_7 = PyTuple_Check(__pyx_v_symbols);
if (!__pyx_t_7) {
} else {
__pyx_t_1 = __pyx_t_7;
goto __pyx_L13_bool_binop_done;
}
__pyx_t_7 = PyList_Check(__pyx_v_symbols);
__pyx_t_1 = __pyx_t_7;
__pyx_L13_bool_binop_done:;
__pyx_t_7 = (!__pyx_t_1);
if (unlikely(__pyx_t_7)) {
/* … */
}
+1058: raise TypeError(
__pyx_t_5 = NULL;
__pyx_t_2 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Bad_argument_symbols_Must_be_a_b};
__pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1058, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(1, 1058, __pyx_L1_error)
1059: f'Bad argument `symbols`: Must be a bool or a tuple or list '+
1060: 'of column names (str) or indices (int).')
+1061: for symbol in symbols:
if (likely(PyList_CheckExact(__pyx_v_symbols)) || PyTuple_CheckExact(__pyx_v_symbols)) { __pyx_t_6 = __pyx_v_symbols; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_symbols); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1061, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1061, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1061, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8)); #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); #endif ++__pyx_t_8; } if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1061, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 1061, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_symbol, __pyx_t_5); __pyx_t_5 = 0; /* … */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L3:;
+1062: if isinstance(symbol, str):
__pyx_t_7 = PyUnicode_Check(__pyx_v_symbol);
if (__pyx_t_7) {
/* … */
goto __pyx_L17;
}
+1063: _dataframe_get_loc(df, symbol, 'symbols', &col_index)
__pyx_t_5 = __pyx_v_symbol;
__Pyx_INCREF(__pyx_t_5);
if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(1, 1063, __pyx_L1_error)
__pyx_t_10 = __pyx_f_7questdb_7_client__dataframe_get_loc(__pyx_v_df, ((PyObject*)__pyx_t_5), __pyx_mstate_global->__pyx_n_u_symbols, (&__pyx_v_col_index)); if (unlikely(__pyx_t_10 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1063, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+1064: elif isinstance(symbol, int):
__pyx_t_7 = PyLong_Check(__pyx_v_symbol);
if (likely(__pyx_t_7)) {
/* … */
goto __pyx_L17;
}
+1065: _bind_col_index('symbol', symbol, cols.size, &col_index)
__pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_symbol); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1065, __pyx_L1_error) __pyx_t_10 = __pyx_f_7questdb_7_client__bind_col_index(__pyx_mstate_global->__pyx_n_u_symbol, __pyx_t_11, __pyx_v_cols->size, (&__pyx_v_col_index)); if (unlikely(__pyx_t_10 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1065, __pyx_L1_error)
1066: else:
+1067: raise TypeError(
/*else*/ {
__pyx_t_12 = NULL;
__pyx_t_2 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_mstate_global->__pyx_kp_u_Bad_argument_symbols_Elements_mu};
__pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(1, 1067, __pyx_L1_error)
}
__pyx_L17:;
1068: f'Bad argument `symbols`: Elements must ' +
1069: 'be a column name (str) or index (int).')
+1070: if (table_name_col >= 0) and (col_index == <size_t>table_name_col):
__pyx_t_1 = (__pyx_v_table_name_col >= 0);
if (__pyx_t_1) {
} else {
__pyx_t_7 = __pyx_t_1;
goto __pyx_L19_bool_binop_done;
}
__pyx_t_1 = (__pyx_v_col_index == ((size_t)__pyx_v_table_name_col));
__pyx_t_7 = __pyx_t_1;
__pyx_L19_bool_binop_done:;
if (unlikely(__pyx_t_7)) {
/* … */
}
+1071: raise ValueError(
__pyx_t_12 = NULL;
+1072: f'Bad argument `symbols`: Cannot use the same column ' +
__pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Bad_argument_symbols_Cannot_use, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_2 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(1, 1071, __pyx_L1_error)
+1073: f'{symbol!r} as both the table_name and as a symbol.')
__pyx_t_13 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_symbol), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_as_both_the_table_name_and_as_a); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+1074: if (at_col >= 0) and (col_index == <size_t>at_col):
__pyx_t_1 = (__pyx_v_at_col >= 0);
if (__pyx_t_1) {
} else {
__pyx_t_7 = __pyx_t_1;
goto __pyx_L22_bool_binop_done;
}
__pyx_t_1 = (__pyx_v_col_index == ((size_t)__pyx_v_at_col));
__pyx_t_7 = __pyx_t_1;
__pyx_L22_bool_binop_done:;
if (unlikely(__pyx_t_7)) {
/* … */
}
+1075: raise ValueError(
__pyx_t_13 = NULL;
1076: f'Bad argument `symbols`: Cannot use the `at` column ' +
+1077: f'({df.columns[at_col]!r}) as a symbol column.')
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_12, __pyx_v_at_col, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_14), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15[0] = __pyx_mstate_global->__pyx_kp_u_Bad_argument_symbols_Cannot_use_2; __pyx_t_15[1] = __pyx_t_12; __pyx_t_15[2] = __pyx_mstate_global->__pyx_kp_u_as_a_symbol_column; __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_15, 3, 52 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + 21, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12)); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_2 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(1, 1075, __pyx_L1_error)
+1078: pandas_col = pandas_cols[col_index]
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 1078, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_pandas_cols, __pyx_v_col_index, size_t, 0, __Pyx_PyLong_FromSize_t, 1, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1078, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_PandasCol))))) __PYX_ERR(1, 1078, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_pandas_col, ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_5));
__pyx_t_5 = 0;
+1079: col = &cols.d[col_index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_col_index]));
+1080: _dataframe_check_column_is_str(
__pyx_t_10 = __pyx_f_7questdb_7_client__dataframe_check_column_is_str(__pyx_mstate_global->__pyx_kp_u_Bad_argument_symbols, __pyx_v_pandas_col, __pyx_v_col->setup->source); if (unlikely(__pyx_t_10 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1080, __pyx_L1_error)
1081: 'Bad argument `symbols`: ',
1082: pandas_col,
1083: col.setup.source)
+1084: col.setup.meta_target = meta_target_t.meta_target_symbol
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_symbol;
1085:
1086:
+1087: cdef void_int _dataframe_get_loc(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_get_loc(PyObject *__pyx_v_df, PyObject *__pyx_v_col_name, PyObject *__pyx_v_arg_name, size_t *__pyx_v_col_index_out) {
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_AddTraceback("questdb._client._dataframe_get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1088: object df, str col_name, str arg_name,
1089: size_t* col_index_out) except -1:
1090: """
1091: Return the column index for `col_name`.
1092: """
+1093: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_try_end;
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
/* … */
__pyx_L5_except_error:;
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L8_try_end:;
}
+1094: col_index_out[0] = df.columns.get_loc(col_name)
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1094, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_col_name}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_loc, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1094, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_7 = __Pyx_PyLong_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1094, __pyx_L3_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_col_index_out[0]) = __pyx_t_7;
+1095: except KeyError:
__pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_KeyError)))); if (__pyx_t_8) { __Pyx_AddTraceback("questdb._client._dataframe_get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(1, 1095, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5);
+1096: raise KeyError(
__pyx_t_10 = NULL;
+1097: f'Bad argument `{arg_name}`: ' +
__pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_arg_name); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1097, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); /* … */ __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_13, 5, 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + 28, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12)); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1097, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_14}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1096, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(1, 1096, __pyx_L5_except_error) } goto __pyx_L5_except_error;
+1098: f'Column {col_name!r} not found in the dataframe.')
__pyx_t_12 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_col_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1098, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Bad_argument; __pyx_t_13[1] = __pyx_t_11; __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u_Column; __pyx_t_13[3] = __pyx_t_12; __pyx_t_13[4] = __pyx_mstate_global->__pyx_kp_u_not_found_in_the_dataframe;
1099:
1100:
1101: # The values -2 and -1 are safe to use as a sentinel because the TimestampNanos
1102: # type already validates that the value is >= 0.
+1103: cdef int64_t _AT_IS_SERVER_NOW = -2
__pyx_v_7questdb_7_client__AT_IS_SERVER_NOW = -2L;
+1104: cdef int64_t _AT_IS_SET_BY_COLUMN = -1
__pyx_v_7questdb_7_client__AT_IS_SET_BY_COLUMN = -1L;
1105:
1106:
+1107: cdef str _SUPPORTED_DATETIMES = 'datetime64[ns], datetime64[us], datetime64[ns, tz], datetime64[us, tz], timestamp[ns][pyarrow], or timestamp[us][pyarrow]'
__Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_datetime64_ns_datetime64_us_date); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__SUPPORTED_DATETIMES); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__SUPPORTED_DATETIMES, __pyx_mstate_global->__pyx_kp_u_datetime64_ns_datetime64_us_date); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_datetime64_ns_datetime64_us_date);
1108:
1109:
+1110: cdef int _dataframe_classify_numpy_timestamp_dtype(object dtype):
static int __pyx_f_7questdb_7_client__dataframe_classify_numpy_timestamp_dtype(PyObject *__pyx_v_dtype) {
PyObject *__pyx_v_dtype_str = 0;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_classify_numpy_timestamp_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dtype_str);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+1111: cdef str dtype_str = str(dtype)
__pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dtype_str = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
1112: # Pandas 3 may infer bare numpy.datetime64 values as coarser units such as
1113: # datetime64[s]. We already serialize numpy timestamps via the existing
1114: # microsecond or nanosecond buffer paths, so normalize these coarser units
1115: # to microseconds before exporting the raw numpy buffer.
+1116: if dtype_str == 'datetime64[ns]':
__pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_dtype_str, __pyx_mstate_global->__pyx_kp_u_datetime64_ns, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1116, __pyx_L1_error) if (__pyx_t_2) { /* … */ }
+1117: return col_source_t.col_source_dt64ns_numpy
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64ns_numpy;
goto __pyx_L0;
+1118: elif dtype_str in (
__Pyx_INCREF(__pyx_v_dtype_str); __pyx_t_3 = __pyx_v_dtype_str; __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_us, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1118, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_ms, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1118, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_s, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1118, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_m, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1118, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_h, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1118, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_D, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1118, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_W, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1118, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __pyx_t_2; if (__pyx_t_4) { /* … */ }
1119: 'datetime64[us]',
1120: 'datetime64[ms]',
1121: 'datetime64[s]',
1122: 'datetime64[m]',
1123: 'datetime64[h]',
1124: 'datetime64[D]',
1125: 'datetime64[W]'):
+1126: return col_source_t.col_source_dt64us_numpy
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64us_numpy;
goto __pyx_L0;
1127: else:
+1128: return 0
/*else*/ {
__pyx_r = 0;
goto __pyx_L0;
}
1129:
1130:
+1131: cdef int _dataframe_classify_timestamp_dtype(object dtype) except -1:
static int __pyx_f_7questdb_7_client__dataframe_classify_timestamp_dtype(PyObject *__pyx_v_dtype) {
PyObject *__pyx_v_arrow_type = 0;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("questdb._client._dataframe_classify_timestamp_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_arrow_type);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1132: """
1133: Classify the dtype and determine if it's supported for use as a timestamp.
1134:
1135: Returns:
1136: > 0 - a value castable to a `col_source_t`.
1137: 0 - dtype is not a supported timestamp datatype.
1138: """
1139: cdef object arrow_type
+1140: if isinstance(dtype, _NUMPY_DATETIME64):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_DATETIME64; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1141: return _dataframe_classify_numpy_timestamp_dtype(dtype)
__pyx_t_3 = __pyx_f_7questdb_7_client__dataframe_classify_numpy_timestamp_dtype(__pyx_v_dtype); if (unlikely(__pyx_t_3 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1141, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0;
+1142: elif isinstance(dtype, _PANDAS.DatetimeTZDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_DatetimeTZDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1143: if dtype.unit == 'ns':
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1144: return col_source_t.col_source_dt64ns_tz_arrow
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow;
goto __pyx_L0;
+1145: elif dtype.unit == 'us':
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { /* … */ }
+1146: return col_source_t.col_source_dt64us_tz_arrow
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow;
goto __pyx_L0;
1147: else:
+1148: raise QuestDBError(
/*else*/ {
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1148, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
+1149: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1150: f'Unsupported pandas dtype {dtype} unit {dtype.unit}. ' +
__pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Unsupported_pandas_dtype; __pyx_t_10[1] = __pyx_t_6; __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_unit_2; __pyx_t_10[3] = __pyx_t_9; __pyx_t_10[4] = __pyx_mstate_global->__pyx_kp_u_Raise_an_issue_if_you_think_it; __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 5, 25 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 106, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_7, __pyx_t_8}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 1148, __pyx_L1_error) }
1151: 'Raise an issue if you think it should be supported: ' +
1152: 'https://github.com/questdb/py-questdb-client/issues.')
+1153: elif isinstance(dtype, _PANDAS.ArrowDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_ArrowDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1154: _dataframe_require_pyarrow()
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_require_pyarrow(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1155: arrow_type = dtype.pyarrow_dtype
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_pyarrow_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arrow_type = __pyx_t_1; __pyx_t_1 = 0;
+1156: if arrow_type.id == _PYARROW.lib.Type_TIMESTAMP:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_type, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Type_TIMESTAMP); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* … */ }
+1157: if arrow_type.unit == "ns":
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_type, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* … */ }
+1158: return col_source_t.col_source_dt64ns_tz_arrow
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow;
goto __pyx_L0;
+1159: elif arrow_type.unit == "us":
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_type, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* … */ }
+1160: return col_source_t.col_source_dt64us_tz_arrow
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow;
goto __pyx_L0;
1161: # s / ms fall through: field -> generic Arrow passthrough;
1162: # designated-at -> _dataframe_classify_at_timestamp_dtype.
+1163: return 0
__pyx_r = 0; goto __pyx_L0;
1164:
1165:
+1166: cdef int _dataframe_classify_at_timestamp_dtype(object dtype) except -1:
static int __pyx_f_7questdb_7_client__dataframe_classify_at_timestamp_dtype(PyObject *__pyx_v_dtype) {
PyObject *__pyx_v_arrow_type = 0;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("questdb._client._dataframe_classify_at_timestamp_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_arrow_type);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1167: # ms / s designated-`at` Arrow timestamps, widened to micros in Rust by
1168: # the millis/seconds designated-timestamp FFI. Kept out of the shared
1169: # field classifier so timestamp fields still route to the generic Arrow
1170: # passthrough and row-ILP stays untouched.
1171: cdef object arrow_type
+1172: if isinstance(dtype, _PANDAS.ArrowDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_ArrowDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1173: _dataframe_require_pyarrow()
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_require_pyarrow(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1174: arrow_type = dtype.pyarrow_dtype
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_pyarrow_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arrow_type = __pyx_t_1; __pyx_t_1 = 0;
+1175: if arrow_type.id == _PYARROW.lib.Type_TIMESTAMP:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_type, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_TIMESTAMP); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* … */ }
+1176: if arrow_type.unit == "ms":
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_type, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* … */ }
+1177: return col_source_t.col_source_dt64ms_tz_arrow
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64ms_tz_arrow;
goto __pyx_L0;
+1178: elif arrow_type.unit == "s":
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_type, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_s, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* … */ }
+1179: return col_source_t.col_source_dt64s_tz_arrow
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64s_tz_arrow;
goto __pyx_L0;
+1180: return 0
__pyx_r = 0; goto __pyx_L0;
1181:
1182:
+1183: cdef ssize_t _dataframe_resolve_at(
static Py_ssize_t __pyx_f_7questdb_7_client__dataframe_resolve_at(PyObject *__pyx_v_df, struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_cols, PyObject *__pyx_v_at, size_t __pyx_v_col_count, int64_t *__pyx_v_at_value_out, int __pyx_v_columnar) {
size_t __pyx_v_col_index;
PyObject *__pyx_v_dtype = 0;
struct __pyx_obj_7questdb_7_client_TimestampNanos *__pyx_v_at_nanos = 0;
int64_t __pyx_v_at_value;
int __pyx_v_at_source;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
Py_ssize_t __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -2L;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dtype);
__Pyx_XDECREF((PyObject *)__pyx_v_at_nanos);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1184: object df,
1185: col_t_arr* cols,
1186: object at,
1187: size_t col_count,
1188: int64_t* at_value_out,
1189: bint columnar) except -2:
1190: cdef size_t col_index
1191: cdef object dtype
1192: cdef PandasCol pandas_col
1193: cdef TimestampNanos at_nanos
1194: cdef int64_t at_value
1195: cdef int at_source
+1196: if at is None:
__pyx_t_1 = (__pyx_v_at == Py_None);
if (__pyx_t_1) {
/* … */
}
+1197: at_value_out[0] = _AT_IS_SERVER_NOW
(__pyx_v_at_value_out[0]) = __pyx_v_7questdb_7_client__AT_IS_SERVER_NOW;
+1198: return -1
__pyx_r = -1L;
goto __pyx_L0;
+1199: elif isinstance(at, TimestampNanos):
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_at, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_TimestampNanos);
if (__pyx_t_1) {
/* … */
}
+1200: at_nanos = at
__pyx_t_2 = __pyx_v_at;
__Pyx_INCREF(__pyx_t_2);
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_TimestampNanos))))) __PYX_ERR(1, 1200, __pyx_L1_error)
__pyx_v_at_nanos = ((struct __pyx_obj_7questdb_7_client_TimestampNanos *)__pyx_t_2);
__pyx_t_2 = 0;
+1201: at_value_out[0] = at_nanos._value
__pyx_t_3 = __pyx_v_at_nanos->_value;
(__pyx_v_at_value_out[0]) = __pyx_t_3;
+1202: return -1
__pyx_r = -1L;
goto __pyx_L0;
+1203: elif isinstance(at, cp_datetime):
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_at, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_datetime);
if (__pyx_t_1) {
/* … */
}
+1204: at_value = datetime_to_nanos(at)
if (!(likely(((__pyx_v_at) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_at, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1204, __pyx_L1_error) __pyx_t_3 = __pyx_f_7questdb_7_client_datetime_to_nanos(((PyDateTime_DateTime *)__pyx_v_at)); if (unlikely(__pyx_t_3 == ((int64_t)-1L) && PyErr_Occurred())) __PYX_ERR(1, 1204, __pyx_L1_error) __pyx_v_at_value = __pyx_t_3;
+1205: if at_value < 0:
__pyx_t_1 = (__pyx_v_at_value < 0);
if (unlikely(__pyx_t_1)) {
/* … */
}
+1206: raise ValueError(
__pyx_t_4 = NULL;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Bad_argument_at_Cannot_use_a_dat};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 1206, __pyx_L1_error)
1207: 'Bad argument `at`: Cannot use a datetime before the ' +
1208: 'Unix epoch (1970-01-01 00:00:00).')
+1209: at_value_out[0] = at_value
(__pyx_v_at_value_out[0]) = __pyx_v_at_value;
+1210: return -1
__pyx_r = -1L;
goto __pyx_L0;
+1211: elif isinstance(at, str):
__pyx_t_1 = PyUnicode_Check(__pyx_v_at);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+1212: _dataframe_get_loc(df, at, 'at', &col_index)
__pyx_t_2 = __pyx_v_at;
__Pyx_INCREF(__pyx_t_2);
if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(1, 1212, __pyx_L1_error)
__pyx_t_6 = __pyx_f_7questdb_7_client__dataframe_get_loc(__pyx_v_df, ((PyObject*)__pyx_t_2), __pyx_mstate_global->__pyx_n_u_at, (&__pyx_v_col_index)); if (unlikely(__pyx_t_6 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1212, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1213: elif isinstance(at, int):
__pyx_t_1 = PyLong_Check(__pyx_v_at);
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+1214: _bind_col_index('at', at, col_count, &col_index)
__pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_at); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1214, __pyx_L1_error) __pyx_t_6 = __pyx_f_7questdb_7_client__bind_col_index(__pyx_mstate_global->__pyx_n_u_at, __pyx_t_7, __pyx_v_col_count, (&__pyx_v_col_index)); if (unlikely(__pyx_t_6 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1214, __pyx_L1_error)
1215: else:
+1216: raise TypeError(
/*else*/ {
__pyx_t_4 = NULL;
+1217: f'Bad argument `at`: Unsupported type {_fqn(type(at))}. ' +
__pyx_t_8 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_at)))); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyUnicode_Unicode(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Bad_argument_at_Unsupported_type; __pyx_t_10[1] = __pyx_t_9; __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_Must_be_one_of_None_TimestampNa; __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, 36 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 86, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 1216, __pyx_L1_error) } __pyx_L3:;
1218: 'Must be one of: None, TimestampNanos, datetime, ' +
1219: 'int (column index), str (colum name)')
+1220: dtype = df.dtypes.iloc[col_index]
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_dtypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_iloc); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_col_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_dtype = __pyx_t_2; __pyx_t_2 = 0;
+1221: if _dataframe_classify_timestamp_dtype(dtype) != 0:
__pyx_t_7 = __pyx_f_7questdb_7_client__dataframe_classify_timestamp_dtype(__pyx_v_dtype); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_7 != 0);
if (__pyx_t_1) {
/* … */
}
+1222: at_value_out[0] = _AT_IS_SET_BY_COLUMN
(__pyx_v_at_value_out[0]) = __pyx_v_7questdb_7_client__AT_IS_SET_BY_COLUMN;
+1223: col = &cols.d[col_index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_col_index]));
+1224: col.setup.meta_target = meta_target_t.meta_target_at
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_at;
+1225: return col_index
__pyx_r = __pyx_v_col_index;
goto __pyx_L0;
+1226: if columnar:
if (__pyx_v_columnar) {
/* … */
}
1227: # ms / s Arrow timestamps resolved to the generic passthrough source
1228: # in `_dataframe_resolve_source_and_buffers`; the buffers are already
1229: # mapped, so override the source to the designated-ts unit and let the
1230: # Rust millis/seconds FFI widen to micros.
+1231: at_source = _dataframe_classify_at_timestamp_dtype(dtype)
__pyx_t_7 = __pyx_f_7questdb_7_client__dataframe_classify_at_timestamp_dtype(__pyx_v_dtype); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 1231, __pyx_L1_error)
__pyx_v_at_source = __pyx_t_7;
+1232: if at_source != 0:
__pyx_t_1 = (__pyx_v_at_source != 0);
if (__pyx_t_1) {
/* … */
}
+1233: at_value_out[0] = _AT_IS_SET_BY_COLUMN
(__pyx_v_at_value_out[0]) = __pyx_v_7questdb_7_client__AT_IS_SET_BY_COLUMN;
+1234: col = &cols.d[col_index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_col_index]));
+1235: col.setup.source = <col_source_t>at_source
__pyx_v_col->setup->source = ((enum __pyx_t_7questdb_7_client_col_source_t)__pyx_v_at_source);
+1236: col.setup.meta_target = meta_target_t.meta_target_at
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_at;
+1237: return col_index
__pyx_r = __pyx_v_col_index;
goto __pyx_L0;
+1238: raise TypeError(
__pyx_t_8 = NULL;
+1239: f'Bad argument `at`: Bad dtype `{dtype}` ' +
__pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* … */ __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_12, 7, 30 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 19 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11)); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_13}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 1238, __pyx_L1_error)
+1240: f'for the {at!r} column: Must be a {_SUPPORTED_DATETIMES} column.')
__pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_at), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_7questdb_7_client__SUPPORTED_DATETIMES); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_Bad_argument_at_Bad_dtype; __pyx_t_12[1] = __pyx_t_4; __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_for_the_2; __pyx_t_12[3] = __pyx_t_9; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_column_Must_be_a; __pyx_t_12[5] = __pyx_t_11; __pyx_t_12[6] = __pyx_mstate_global->__pyx_kp_u_column;
1241:
1242:
+1243: cdef void_int _dataframe_alloc_chunks(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_alloc_chunks(size_t __pyx_v_n_chunks, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct ArrowArray *__pyx_v_chunks;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("questdb._client._dataframe_alloc_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
1244: size_t n_chunks, col_t* col) except -1:
+1245: cdef ArrowArray* chunks = <ArrowArray*>calloc(
__pyx_v_chunks = ((struct ArrowArray *)calloc((__pyx_v_n_chunks + 1), (sizeof(struct ArrowArray))));
1246: n_chunks + 1, # See `_dataframe_col_advance` on why +1.
1247: sizeof(ArrowArray))
+1248: if chunks == NULL:
__pyx_t_1 = (__pyx_v_chunks == NULL);
if (unlikely(__pyx_t_1)) {
/* … */
}
+1249: raise MemoryError()
PyErr_NoMemory(); __PYX_ERR(1, 1249, __pyx_L1_error)
+1250: col.setup.chunks.chunks = chunks
__pyx_v_col->setup->chunks.chunks = __pyx_v_chunks;
+1251: col.setup.chunks.n_chunks = n_chunks
__pyx_v_col->setup->chunks.n_chunks = __pyx_v_n_chunks;
1252:
1253:
+1254: cdef void _dataframe_free_mapped_arrow(ArrowArray* arr) noexcept nogil:
static void __pyx_f_7questdb_7_client__dataframe_free_mapped_arrow(struct ArrowArray *__pyx_v_arr) {
/* … */
/* function exit code */
}
+1255: free(arr.buffers)
free(__pyx_v_arr->buffers);
+1256: arr.buffers = NULL
__pyx_v_arr->buffers = NULL;
+1257: arr.release = NULL
__pyx_v_arr->release = NULL;
1258:
1259:
+1260: cdef void_int _dataframe_series_as_pybuf(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, struct __pyx_opt_args_7questdb_7_client__dataframe_series_as_pybuf *__pyx_optional_args) {
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_18);
__Pyx_XDECREF(__pyx_t_27);
__Pyx_AddTraceback("questdb._client._dataframe_series_as_pybuf", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_nparr);
__Pyx_XDECREF(__pyx_v_ve);
__Pyx_XDECREF(__pyx_v_be);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
struct __pyx_opt_args_7questdb_7_client__dataframe_series_as_pybuf {
int __pyx_n;
PyObject *fallback_dtype;
};
+1261: PandasCol pandas_col, col_t* col, str fallback_dtype=None) except -1:
PyObject *__pyx_v_fallback_dtype = ((PyObject*)Py_None);
PyObject *__pyx_v_nparr = 0;
struct ArrowArray *__pyx_v_mapped;
CYTHON_UNUSED int __pyx_v_get_buf_ret;
PyObject *__pyx_v_ve = NULL;
PyObject *__pyx_v_be = NULL;
__pyx_t_7questdb_7_client_void_int __pyx_r;
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_fallback_dtype = __pyx_optional_args->fallback_dtype;
}
}
+1262: cdef object nparr = pandas_col.series.to_numpy(dtype=fallback_dtype)
__pyx_t_2 = __pyx_v_pandas_col->series; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_fallback_dtype, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(1, 1262, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_to_numpy, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_nparr = __pyx_t_1; __pyx_t_1 = 0;
1263: cdef ArrowArray* mapped
1264: cdef int get_buf_ret
+1265: if not PyObject_CheckBuffer(nparr):
__pyx_t_5 = (!PyObject_CheckBuffer(__pyx_v_nparr));
if (unlikely(__pyx_t_5)) {
/* … */
}
+1266: raise TypeError(
__pyx_t_4 = NULL;
+1267: f'Bad column {pandas_col.name!r}: Expected a buffer, got ' +
__pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* … */ __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_9, 7, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 25 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 1266, __pyx_L1_error)
+1268: f'{pandas_col.series!r} ({_fqn(type(pandas_col.series))})')
__pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->series), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_pandas_col->series)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_9[1] = __pyx_t_2; __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_Expected_a_buffer_got; __pyx_t_9[3] = __pyx_t_6; __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u__14; __pyx_t_9[5] = __pyx_t_8; __pyx_t_9[6] = __pyx_mstate_global->__pyx_kp_u__5;
+1269: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
goto __pyx_L9_try_end;
__pyx_L4_error:;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
/* … */
__pyx_L6_except_error:;
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
goto __pyx_L1_error;
__pyx_L9_try_end:;
}
1270: # Note! We don't need to support numpy strides since Pandas doesn't.
1271: # Also note that this guarantees a 1D buffer.
+1272: get_buf_ret = PyObject_GetBuffer(nparr, &col.setup.pybuf, PyBUF_SIMPLE)
__pyx_t_13 = PyObject_GetBuffer(__pyx_v_nparr, (&__pyx_v_col->setup->pybuf), PyBUF_SIMPLE); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(1, 1272, __pyx_L4_error) __pyx_v_get_buf_ret = __pyx_t_13;
+1273: except ValueError as ve:
__pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ValueError)))); if (__pyx_t_13) { __Pyx_AddTraceback("questdb._client._dataframe_series_as_pybuf", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_4) < 0) __PYX_ERR(1, 1273, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_v_ve = __pyx_t_7; /*try:*/ { /* … */ /*finally:*/ { __pyx_L15_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26); if ( unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __pyx_t_13 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ve); __pyx_v_ve = 0; } __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ErrRestore(__pyx_t_21, __pyx_t_22, __pyx_t_23); __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20; goto __pyx_L6_except_error; } } }
+1274: raise QuestDBError(
__pyx_t_6 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1274, __pyx_L15_error)
__Pyx_GOTREF(__pyx_t_2);
+1275: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1275, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 1275, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+1276: f'Bad column {pandas_col.name!r}: {ve}') from ve
__pyx_t_14 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1276, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = __Pyx_PyObject_FormatSimple(__pyx_v_ve, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 1276, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_17[1] = __pyx_t_14; __pyx_t_17[2] = __pyx_mstate_global->__pyx_kp_u_; __pyx_t_17[3] = __pyx_t_16; __pyx_t_18 = __Pyx_PyUnicode_Join(__pyx_t_17, 4, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_16), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16)); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1276, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_3 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_15, __pyx_t_18}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1274, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_ve); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(1, 1274, __pyx_L15_error) }
+1277: except BufferError as be:
__pyx_t_19 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_BufferError)))); if (__pyx_t_19) { __Pyx_AddTraceback("questdb._client._dataframe_series_as_pybuf", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_1) < 0) __PYX_ERR(1, 1277, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_v_be = __pyx_t_7; /*try:*/ { /* … */ /*finally:*/ { __pyx_L26_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21); if ( unlikely(__Pyx_GetException(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_19 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_28 = __pyx_filename; { __Pyx_DECREF(__pyx_v_be); __pyx_v_be = 0; } __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_22, __pyx_t_21); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ErrRestore(__pyx_t_26, __pyx_t_25, __pyx_t_24); __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_19; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_28; goto __pyx_L6_except_error; } } } goto __pyx_L6_except_error;
+1278: raise QuestDBError(
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1278, __pyx_L26_error)
__Pyx_GOTREF(__pyx_t_18);
+1279: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 1279, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1279, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+1280: f'Bad column {pandas_col.name!r}: Expected a buffer, got ' +
__pyx_t_15 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 1280, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_15); /* … */ __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_9, 7, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15) + 25 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_16) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_27) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_27)); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1280, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_18))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_18); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_18, __pyx__function); __pyx_t_3 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_6, __pyx_t_14}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1278, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_8); }
+1281: f'{pandas_col.series!r} ({_fqn(type(pandas_col.series))})') from be
__pyx_t_16 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->series), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 1281, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_14 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_pandas_col->series)))); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1281, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_27 = __Pyx_PyUnicode_Unicode(__pyx_t_14); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 1281, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_9[1] = __pyx_t_15; __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_Expected_a_buffer_got; __pyx_t_9[3] = __pyx_t_16; __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u__14; __pyx_t_9[5] = __pyx_t_27; __pyx_t_9[6] = __pyx_mstate_global->__pyx_kp_u__5; /* … */ __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_be); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(1, 1278, __pyx_L26_error) }
+1282: _dataframe_alloc_chunks(1, col)
__pyx_t_29 = __pyx_f_7questdb_7_client__dataframe_alloc_chunks(1, __pyx_v_col); if (unlikely(__pyx_t_29 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1282, __pyx_L1_error)
+1283: mapped = &col.setup.chunks.chunks[0]
__pyx_v_mapped = (&(__pyx_v_col->setup->chunks.chunks[0]));
1284:
1285: # Total number of elements.
+1286: mapped.length = (
__pyx_v_mapped->length = __Pyx_div_int64_t(((int64_t)__pyx_v_col->setup->pybuf.len), ((int64_t)__pyx_v_col->setup->pybuf.itemsize), 0);
+1287: <int64_t>col.setup.pybuf.len // <int64_t>col.setup.pybuf.itemsize)
if (unlikely(((int64_t)__pyx_v_col->setup->pybuf.itemsize) == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(1, 1287, __pyx_L1_error)
}
else if (sizeof(int64_t) == sizeof(long) && (!(((int64_t)-1) > 0)) && unlikely(((int64_t)__pyx_v_col->setup->pybuf.itemsize) == (int64_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(((int64_t)__pyx_v_col->setup->pybuf.len)))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
__PYX_ERR(1, 1287, __pyx_L1_error)
}
+1288: mapped.null_count = 0
__pyx_v_mapped->null_count = 0;
+1289: mapped.offset = 0
__pyx_v_mapped->offset = 0;
+1290: mapped.n_buffers = 2
__pyx_v_mapped->n_buffers = 2;
+1291: mapped.n_children = 0
__pyx_v_mapped->n_children = 0;
+1292: mapped.buffers = <const void**>calloc(2, sizeof(const void*))
__pyx_v_mapped->buffers = ((void const **)calloc(2, (sizeof(void const *))));
+1293: if mapped.buffers == NULL:
__pyx_t_5 = (__pyx_v_mapped->buffers == NULL);
if (unlikely(__pyx_t_5)) {
/* … */
}
+1294: raise MemoryError()
PyErr_NoMemory(); __PYX_ERR(1, 1294, __pyx_L1_error)
+1295: mapped.buffers[0] = NULL
(__pyx_v_mapped->buffers[0]) = NULL;
+1296: mapped.buffers[1] = <const void*>col.setup.pybuf.buf
(__pyx_v_mapped->buffers[1]) = ((void const *)__pyx_v_col->setup->pybuf.buf);
+1297: mapped.children = NULL
__pyx_v_mapped->children = NULL;
+1298: mapped.dictionary = NULL
__pyx_v_mapped->dictionary = NULL;
+1299: mapped.release = _dataframe_free_mapped_arrow # to cleanup allocated array.
__pyx_v_mapped->release = __pyx_f_7questdb_7_client__dataframe_free_mapped_arrow;
1300:
+1301: cdef list _dataframe_series_to_arrow_chunks(PandasCol pandas_col):
static PyObject *__pyx_f_7questdb_7_client__dataframe_series_to_arrow_chunks(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col) {
PyObject *__pyx_v_array = 0;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_series_to_arrow_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_array);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1302: cdef object array
+1303: _dataframe_require_pyarrow()
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_require_pyarrow(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1304: array = _PYARROW.Array.from_pandas(pandas_col.series)
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_Array); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_pandas_col->series}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_from_pandas, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_array = __pyx_t_1; __pyx_t_1 = 0;
+1305: if isinstance(array, _PYARROW.ChunkedArray):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_ChunkedArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_IsInstance(__pyx_v_array, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* … */ }
+1306: return array.chunks
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_mstate_global->__pyx_n_u_chunks); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(1, 1306, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0;
1307: else:
+1308: return [array]
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1308, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_array);
__Pyx_GIVEREF(__pyx_v_array);
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_array) != (0)) __PYX_ERR(1, 1308, __pyx_L1_error);
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
}
1309:
1310:
+1311: cdef void_int _dataframe_export_arrow_chunks(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_export_arrow_chunks(PyObject *__pyx_v_chunks, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
size_t __pyx_v_n_chunks;
size_t __pyx_v_chunk_index;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("questdb._client._dataframe_export_arrow_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1312: list chunks, col_t* col) except -1:
+1313: cdef size_t n_chunks = len(chunks)
if (unlikely(__pyx_v_chunks == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 1313, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyList_GET_SIZE(__pyx_v_chunks); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 1313, __pyx_L1_error)
__pyx_v_n_chunks = __pyx_t_1;
1314: cdef size_t chunk_index
+1315: _dataframe_alloc_chunks(n_chunks, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_alloc_chunks(__pyx_v_n_chunks, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1315, __pyx_L1_error)
+1316: for chunk_index in range(n_chunks):
__pyx_t_3 = __pyx_v_n_chunks;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_chunk_index = __pyx_t_5;
+1317: if chunk_index == 0:
__pyx_t_6 = (__pyx_v_chunk_index == 0);
if (__pyx_t_6) {
/* … */
goto __pyx_L5;
}
+1318: chunks[chunk_index]._export_to_c(
if (unlikely(__pyx_v_chunks == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 1318, __pyx_L1_error)
}
__pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_chunks, __pyx_v_chunk_index, size_t, 0, __Pyx_PyLong_FromSize_t, 1, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1318, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = __pyx_t_9;
__Pyx_INCREF(__pyx_t_8);
+1319: <uintptr_t>&col.setup.chunks.chunks[chunk_index],
__pyx_t_10 = __Pyx_PyLong_FromSize_t(((uintptr_t)(&(__pyx_v_col->setup->chunks.chunks[__pyx_v_chunk_index])))); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10);
+1320: <uintptr_t>&col.setup.arrow_schema)
__pyx_t_11 = __Pyx_PyLong_FromSize_t(((uintptr_t)(&__pyx_v_col->setup->arrow_schema))); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_10, __pyx_t_11}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_export_to_c, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1321: else:
+1322: chunks[chunk_index]._export_to_c(
/*else*/ {
if (unlikely(__pyx_v_chunks == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 1322, __pyx_L1_error)
}
__pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_chunks, __pyx_v_chunk_index, size_t, 0, __Pyx_PyLong_FromSize_t, 1, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__pyx_t_9 = __pyx_t_11;
__Pyx_INCREF(__pyx_t_9);
+1323: <uintptr_t>&col.setup.chunks.chunks[chunk_index])
__pyx_t_10 = __Pyx_PyLong_FromSize_t(((uintptr_t)(&(__pyx_v_col->setup->chunks.chunks[__pyx_v_chunk_index])))); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_export_to_c, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_L5:; }
1324:
1325:
+1326: cdef void_int _dataframe_series_as_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_series_as_arrow(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("questdb._client._dataframe_series_as_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1327: PandasCol pandas_col,
1328: col_t* col) except -1:
+1329: _dataframe_export_arrow_chunks(
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_export_arrow_chunks(((PyObject*)__pyx_t_1), __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1330: _dataframe_series_to_arrow_chunks(pandas_col), col)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_series_to_arrow_chunks(__pyx_v_pandas_col); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1);
1331:
1332:
+1333: cdef const char* _ARROW_FMT_INT8 = "c"
__pyx_v_7questdb_7_client__ARROW_FMT_INT8 = __pyx_k_c;
+1334: cdef const char* _ARROW_FMT_INT16 = "s"
__pyx_v_7questdb_7_client__ARROW_FMT_INT16 = __pyx_k_s;
+1335: cdef const char* _ARROW_FMT_INT32 = "i"
__pyx_v_7questdb_7_client__ARROW_FMT_INT32 = __pyx_k_i;
+1336: cdef const char* _ARROW_FMT_UTF8_STRING = 'u'
__pyx_v_7questdb_7_client__ARROW_FMT_UTF8_STRING = __pyx_k_u;
+1337: cdef const char* _ARROW_FMT_LRG_UTF8_STRING = 'U'
__pyx_v_7questdb_7_client__ARROW_FMT_LRG_UTF8_STRING = __pyx_k_U;
1338:
1339:
+1340: cdef void_int _dataframe_category_series_as_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_category_series_as_arrow(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
char const *__pyx_v_format;
PyObject *__pyx_v_chunks = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("questdb._client._dataframe_category_series_as_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_chunks);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1341: PandasCol pandas_col, col_t* col) except -1:
1342: cdef const char* format
+1343: cdef list chunks = _dataframe_series_to_arrow_chunks(pandas_col)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_series_to_arrow_chunks(__pyx_v_pandas_col); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_chunks = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
1344:
+1345: _dataframe_export_arrow_chunks(chunks, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_export_arrow_chunks(__pyx_v_chunks, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1345, __pyx_L1_error)
1346:
+1347: format = col.setup.arrow_schema.format
__pyx_t_3 = __pyx_v_col->setup->arrow_schema.format; __pyx_v_format = __pyx_t_3;
+1348: if strncmp(format, _ARROW_FMT_INT8, 1) == 0:
__pyx_t_4 = (strncmp(__pyx_v_format, __pyx_v_7questdb_7_client__ARROW_FMT_INT8, 1) == 0);
if (__pyx_t_4) {
/* … */
goto __pyx_L3;
}
+1349: col.setup.source = col_source_t.col_source_str_i8_cat
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_i8_cat;
+1350: elif strncmp(format, _ARROW_FMT_INT16, 1) == 0:
__pyx_t_4 = (strncmp(__pyx_v_format, __pyx_v_7questdb_7_client__ARROW_FMT_INT16, 1) == 0);
if (__pyx_t_4) {
/* … */
goto __pyx_L3;
}
+1351: col.setup.source = col_source_t.col_source_str_i16_cat
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_i16_cat;
+1352: elif strncmp(format, _ARROW_FMT_INT32, 1) == 0:
__pyx_t_4 = (strncmp(__pyx_v_format, __pyx_v_7questdb_7_client__ARROW_FMT_INT32, 1) == 0);
if (likely(__pyx_t_4)) {
/* … */
goto __pyx_L3;
}
+1353: col.setup.source = col_source_t.col_source_str_i32_cat
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_i32_cat;
1354: else:
+1355: raise QuestDBError(
/*else*/ {
__pyx_t_5 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
+1356: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+1357: f'Bad column {pandas_col.name!r}: ' +
__pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* … */ __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 45 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_12 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_12 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_8, __pyx_t_10}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 1355, __pyx_L1_error) } __pyx_L3:;
1358: 'Unsupported arrow category index type. ' +
+1359: f'Got {(<bytes>format).decode("utf-8")!r}.')
__pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (unlikely(__pyx_t_9 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode"); __PYX_ERR(1, 1359, __pyx_L1_error) } __pyx_t_10 = __Pyx_decode_bytes(((PyObject*)__pyx_t_9), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_10), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_11[1] = __pyx_t_7; __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_Unsupported_arrow_category_inde; __pyx_t_11[3] = __pyx_t_9; __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__2;
1360:
+1361: format = col.setup.arrow_schema.dictionary.format
__pyx_t_3 = __pyx_v_col->setup->arrow_schema.dictionary->format; __pyx_v_format = __pyx_t_3;
+1362: if (strncmp(format, _ARROW_FMT_UTF8_STRING, 1) != 0 and
__pyx_t_13 = (strncmp(__pyx_v_format, __pyx_v_7questdb_7_client__ARROW_FMT_UTF8_STRING, 1) != 0);
if (__pyx_t_13) {
} else {
__pyx_t_4 = __pyx_t_13;
goto __pyx_L5_bool_binop_done;
}
/* … */
if (unlikely(__pyx_t_4)) {
/* … */
}
+1363: strncmp(format, _ARROW_FMT_LRG_UTF8_STRING, 1) != 0):
__pyx_t_13 = (strncmp(__pyx_v_format, __pyx_v_7questdb_7_client__ARROW_FMT_LRG_UTF8_STRING, 1) != 0); __pyx_t_4 = __pyx_t_13; __pyx_L5_bool_binop_done:;
+1364: raise QuestDBError(
__pyx_t_6 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
+1365: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+1366: f'Bad column {pandas_col.name!r}: ' +
__pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* … */ __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 52 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_12 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_12 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_9}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 1364, __pyx_L1_error)
1367: 'Expected a category of strings, ' +
+1368: f'got a category of {pandas_col.series.dtype.categories.dtype}.')
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pandas_col->series, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_categories); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_11[1] = __pyx_t_8; __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_Expected_a_category_of_strings; __pyx_t_11[3] = __pyx_t_7; __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__2;
1369:
+1370: cdef void_int _dataframe_series_resolve_arrow(PandasCol pandas_col, object arrowtype, col_t *col) except -1:
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_series_resolve_arrow(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, PyObject *__pyx_v_arrowtype, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
int __pyx_v_is_decimal_col;
PyObject *__pyx_v_t_dec32 = 0;
PyObject *__pyx_v_t_dec64 = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
__Pyx_INCREF(__pyx_v_arrowtype);
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("questdb._client._dataframe_series_resolve_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_t_dec32);
__Pyx_XDECREF(__pyx_v_t_dec64);
__Pyx_XDECREF(__pyx_v_arrowtype);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+1371: cdef bint is_decimal_col = False
__pyx_v_is_decimal_col = 0;
+1372: _dataframe_require_pyarrow()
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_require_pyarrow(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1373: if arrowtype.id == _PYARROW.lib.Type_STRING:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Type_STRING); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1373, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1373, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* … */ }
+1374: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_5 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1374, __pyx_L1_error)
+1375: col.setup.source = col_source_t.col_source_str_utf8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_utf8_arrow;
+1376: col.scale = 0
__pyx_v_col->scale = 0;
+1377: return 0
__pyx_r = 0;
goto __pyx_L0;
+1378: elif arrowtype.id == _PYARROW.lib.Type_LARGE_STRING:
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_LARGE_STRING); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* … */ }
+1379: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_5 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1379, __pyx_L1_error)
+1380: col.setup.source = col_source_t.col_source_str_lrg_utf8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow;
+1381: col.scale = 0
__pyx_v_col->scale = 0;
+1382: return 0
__pyx_r = 0;
goto __pyx_L0;
1383:
1384: # Unwrap pyarrow extension types (e.g. `arrow.uuid` wrapping
1385: # `FixedSizeBinary(16)`) to their storage type so dispatch picks
1386: # the storage-shape source. The wire format is identical for both
1387: # forms; pyarrow may or may not have the extension registered at
1388: # runtime, so we accept either input and produce the same source.
1389: # pyarrow exposes no `Type_EXTENSION` constant in all versions we
1390: # support; check via `BaseExtensionType` instead.
+1391: if isinstance(arrowtype, _PYARROW.lib.BaseExtensionType):
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BaseExtensionType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = PyObject_IsInstance(__pyx_v_arrowtype, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1391, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* … */ }
+1392: arrowtype = arrowtype.storage_type
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_storage_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_arrowtype, __pyx_t_1); __pyx_t_1 = 0;
1393:
+1394: cdef object t_dec32 = getattr(_PYARROW.lib, 'Type_DECIMAL32', None)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_GetAttr3(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Type_DECIMAL32, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_t_dec32 = __pyx_t_3; __pyx_t_3 = 0;
+1395: cdef object t_dec64 = getattr(_PYARROW.lib, 'Type_DECIMAL64', None)
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_GetAttr3(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_DECIMAL64, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_t_dec64 = __pyx_t_1; __pyx_t_1 = 0;
+1396: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_5 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1396, __pyx_L1_error)
+1397: if t_dec32 is not None and arrowtype.id == t_dec32:
__pyx_t_6 = (__pyx_v_t_dec32 != Py_None);
if (__pyx_t_6) {
} else {
__pyx_t_4 = __pyx_t_6;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1397, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_t_dec32, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1397, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1397, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = __pyx_t_6;
__pyx_L6_bool_binop_done:;
if (__pyx_t_4) {
/* … */
goto __pyx_L5;
}
+1398: col.setup.source = col_source_t.col_source_decimal32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_decimal32_arrow;
+1399: is_decimal_col = True
__pyx_v_is_decimal_col = 1;
+1400: elif t_dec64 is not None and arrowtype.id == t_dec64:
__pyx_t_6 = (__pyx_v_t_dec64 != Py_None);
if (__pyx_t_6) {
} else {
__pyx_t_4 = __pyx_t_6;
goto __pyx_L8_bool_binop_done;
}
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1400, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_t_dec64, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1400, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1400, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_4 = __pyx_t_6;
__pyx_L8_bool_binop_done:;
if (__pyx_t_4) {
/* … */
goto __pyx_L5;
}
+1401: col.setup.source = col_source_t.col_source_decimal64_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_decimal64_arrow;
+1402: is_decimal_col = True
__pyx_v_is_decimal_col = 1;
+1403: elif arrowtype.id == _PYARROW.lib.Type_DECIMAL128:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_DECIMAL128); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1403, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1403, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+1404: col.setup.source = col_source_t.col_source_decimal128_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_decimal128_arrow;
+1405: is_decimal_col = True
__pyx_v_is_decimal_col = 1;
+1406: elif arrowtype.id == _PYARROW.lib.Type_DECIMAL256:
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Type_DECIMAL256); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+1407: col.setup.source = col_source_t.col_source_decimal256_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_decimal256_arrow;
+1408: is_decimal_col = True
__pyx_v_is_decimal_col = 1;
+1409: elif arrowtype.id == _PYARROW.lib.Type_BOOL:
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Type_BOOL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+1410: col.setup.source = col_source_t.col_source_bool_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_bool_arrow;
+1411: elif arrowtype.id == _PYARROW.lib.Type_FLOAT:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_FLOAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1411, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1411, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+1412: col.setup.source = col_source_t.col_source_f32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_f32_arrow;
+1413: elif arrowtype.id == _PYARROW.lib.Type_DOUBLE:
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Type_DOUBLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+1414: col.setup.source = col_source_t.col_source_f64_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_f64_arrow;
+1415: elif arrowtype.id == _PYARROW.lib.Type_INT8:
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Type_INT8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+1416: col.setup.source = col_source_t.col_source_i8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i8_arrow;
+1417: elif arrowtype.id == _PYARROW.lib.Type_INT16:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_INT16); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+1418: col.setup.source = col_source_t.col_source_i16_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i16_arrow;
+1419: elif arrowtype.id == _PYARROW.lib.Type_INT32:
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Type_INT32); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1419, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1419, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+1420: col.setup.source = col_source_t.col_source_i32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i32_arrow;
+1421: elif arrowtype.id == _PYARROW.lib.Type_INT64:
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Type_INT64); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+1422: col.setup.source = col_source_t.col_source_i64_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i64_arrow;
+1423: elif (arrowtype.id == _PYARROW.lib.Type_FIXED_SIZE_BINARY
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L10_bool_binop_done; } /* … */ if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+1424: and arrowtype.byte_width == 16):
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_byte_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_16, 16, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1424, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __pyx_t_6; __pyx_L10_bool_binop_done:;
+1425: col.setup.source = col_source_t.col_source_fsb16_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_fsb16_arrow;
+1426: elif (arrowtype.id == _PYARROW.lib.Type_FIXED_SIZE_BINARY
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Type_FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L12_bool_binop_done; } /* … */ if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+1427: and arrowtype.byte_width == 32):
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_byte_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_32, 32, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_6; __pyx_L12_bool_binop_done:;
+1428: col.setup.source = col_source_t.col_source_fsb32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_fsb32_arrow;
+1429: elif arrowtype.id == _PYARROW.lib.Type_UINT32:
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Type_UINT32); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1429, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1429, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+1430: col.setup.source = col_source_t.col_source_u32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u32_arrow;
1431: else:
+1432: col.setup.source = col_source_t.col_source_arrow_passthrough
/*else*/ {
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_arrow_passthrough;
+1433: col.scale = 0
__pyx_v_col->scale = 0;
+1434: return 0
__pyx_r = 0;
goto __pyx_L0;
}
__pyx_L5:;
+1435: if is_decimal_col:
if (__pyx_v_is_decimal_col) {
/* … */
goto __pyx_L14;
}
+1436: if arrowtype.scale < 0 or arrowtype.scale > 76:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_scale); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L16_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_mstate_global->__pyx_int_76, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __pyx_t_6; __pyx_L16_bool_binop_done:; if (unlikely(__pyx_t_4)) { /* … */ }
+1437: raise QuestDBError(
__pyx_t_3 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
+1438: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+1439: f'Bad column {pandas_col.name!r}: ' +
__pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* … */ __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 28 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 41, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_12 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_12 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_8, __pyx_t_9}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 1437, __pyx_L1_error)
+1440: f'Unsupported decimal scale {arrowtype.scale}: ' +
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_scale); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_11[1] = __pyx_t_7; __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_Unsupported_decimal_scale; __pyx_t_11[3] = __pyx_t_10; __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u_Must_be_in_the_range_0_to_76_in;
1441: 'Must be in the range 0 to 76 inclusive.')
+1442: col.scale = <uint8_t>arrowtype.scale
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_scale); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = __Pyx_PyLong_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_13 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 1442, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_col->scale = ((uint8_t)__pyx_t_13);
1443: else:
+1444: col.scale = 0
/*else*/ {
__pyx_v_col->scale = 0;
}
__pyx_L14:;
+1445: return 0
__pyx_r = 0; goto __pyx_L0;
1446:
+1447: cdef inline bint _dataframe_is_float_nan(PyObject* obj) noexcept:
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_is_float_nan(PyObject *__pyx_v_obj) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
+1448: return PyFloat_CheckExact(obj) and isnan(PyFloat_AS_DOUBLE(obj))
__pyx_t_2 = PyFloat_CheckExact(__pyx_v_obj); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } __pyx_t_2 = isnan(PyFloat_AS_DOUBLE(__pyx_v_obj)); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; goto __pyx_L0;
1449:
1450:
+1451: cdef inline bint _dataframe_is_null_pyobj(PyObject* obj) noexcept:
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(PyObject *__pyx_v_obj) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
1452: return (
+1453: (obj == Py_None) or
__pyx_t_2 = (__pyx_v_obj == Py_None);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
+1454: (obj == <PyObject*>_PANDAS_NA) or
__pyx_t_2 = (__pyx_v_obj == ((PyObject *)__pyx_v_7questdb_7_client__PANDAS_NA));
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
+1455: (obj == <PyObject*>_PANDAS_NAT) or
__pyx_t_2 = (__pyx_v_obj == ((PyObject *)__pyx_v_7questdb_7_client__PANDAS_NAT));
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
+1456: _dataframe_is_float_nan(obj))
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_is_float_nan(__pyx_v_obj); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; goto __pyx_L0;
1457:
1458: # noinspection PyUnreachableCode
+1459: cdef void_int _dataframe_series_sniff_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_series_sniff_pyobj(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
size_t __pyx_v_el_index;
size_t __pyx_v_n_elements;
PyObject **__pyx_v_obj_arr;
PyObject *__pyx_v_obj;
PyArrayObject *__pyx_v_arr;
npy_int __pyx_v_arr_type;
PyArray_Descr *__pyx_v_arr_descr = 0;
PyObject *__pyx_v_arr_type_name = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_AddTraceback("questdb._client._dataframe_series_sniff_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_arr_descr);
__Pyx_XDECREF(__pyx_v_arr_type_name);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1460: PandasCol pandas_col, col_t* col) except -1:
1461: """
1462: Deduct the type of the object column.
1463: Object columns can contain pretty much anything, but they usually don't.
1464: We make an educated guess by finding the first non-null value in the column.
1465: """
1466: # To access elements.
1467: cdef size_t el_index
+1468: cdef size_t n_elements = len(pandas_col.series)
__pyx_t_1 = __pyx_v_pandas_col->series; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 1468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_elements = __pyx_t_2;
1469: cdef PyObject** obj_arr
1470: cdef PyObject* obj
1471:
1472: # To access elements which are themselves arrays.
1473: cdef PyArrayObject* arr
1474: cdef npy_int arr_type
1475: cdef cnp.dtype arr_descr # A cython defn for `PyArray_Descr*`
1476: cdef str arr_type_name
1477:
+1478: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_3 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_3 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1478, __pyx_L1_error)
+1479: obj_arr = <PyObject**>(col.setup.pybuf.buf)
__pyx_v_obj_arr = ((PyObject **)__pyx_v_col->setup->pybuf.buf);
+1480: for el_index in range(n_elements):
__pyx_t_4 = __pyx_v_n_elements;
__pyx_t_5 = __pyx_t_4;
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_v_el_index = __pyx_t_6;
+1481: obj = obj_arr[el_index]
__pyx_v_obj = (__pyx_v_obj_arr[__pyx_v_el_index]);
+1482: if not _dataframe_is_null_pyobj(obj):
__pyx_t_7 = (!__pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_obj));
if (__pyx_t_7) {
/* … */
}
}
+1483: if PyBool_Check(obj):
__pyx_t_7 = PyBool_Check(__pyx_v_obj);
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+1484: col.setup.source = col_source_t.col_source_bool_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_bool_pyobj;
+1485: elif PyLong_CheckExact(obj):
__pyx_t_7 = PyLong_CheckExact(__pyx_v_obj);
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+1486: col.setup.source = col_source_t.col_source_int_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_int_pyobj;
+1487: elif PyFloat_CheckExact(obj):
__pyx_t_7 = PyFloat_CheckExact(__pyx_v_obj);
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+1488: col.setup.source = col_source_t.col_source_float_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_float_pyobj;
+1489: elif PyUnicode_CheckExact(obj):
__pyx_t_7 = PyUnicode_CheckExact(__pyx_v_obj);
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+1490: col.setup.source = col_source_t.col_source_str_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_pyobj;
+1491: elif PyArray_CheckExact(obj):
__pyx_t_7 = PyArray_CheckExact(__pyx_v_obj);
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+1492: arr = <PyArrayObject*>obj
__pyx_v_arr = ((PyArrayObject *)__pyx_v_obj);
+1493: arr_type = PyArray_TYPE(arr)
__pyx_v_arr_type = PyArray_TYPE(__pyx_v_arr);
+1494: if arr_type == NPY_DOUBLE:
__pyx_t_7 = (__pyx_v_arr_type == NPY_DOUBLE);
if (__pyx_t_7) {
/* … */
goto __pyx_L7;
}
+1495: col.setup.source = col_source_t.col_source_arr_f64_numpyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_arr_f64_numpyobj;
1496: else:
+1497: arr_type_name = '??unknown??'
/*else*/ {
__Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_unknown_2);
__pyx_v_arr_type_name = __pyx_mstate_global->__pyx_kp_u_unknown_2;
+1498: arr_descr = cnp.PyArray_DescrFromType(arr_type)
__pyx_t_1 = ((PyObject *)PyArray_DescrFromType(__pyx_v_arr_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arr_descr = ((PyArray_Descr *)__pyx_t_1); __pyx_t_1 = 0;
+1499: if arr_descr is not None:
__pyx_t_7 = (((PyObject *)__pyx_v_arr_descr) != Py_None);
if (__pyx_t_7) {
/* … */
}
1500: # numpy 2.x returns str; 1.x returned bytes.
+1501: arr_type_name = arr_descr.name
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr_descr), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(1, 1501, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_arr_type_name, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0;
+1502: if isinstance(arr_type_name, bytes):
__pyx_t_7 = PyBytes_Check(__pyx_v_arr_type_name);
if (__pyx_t_7) {
/* … */
}
+1503: arr_type_name = arr_type_name.decode('ascii')
__pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyUnicode_Type__decode, __pyx_v_arr_type_name, __pyx_mstate_global->__pyx_n_u_ascii); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(1, 1503, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_arr_type_name, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0;
+1504: raise QuestDBError(
__pyx_t_8 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1504, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
+1505: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+1506: f'Bad column {pandas_col.name!r}: ' +
__pyx_t_10 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); /* … */ __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_13, 5, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 84 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12)); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_15 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); assert(__pyx_t_8); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); __pyx_t_15 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_11, __pyx_t_14}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_15, (3-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 1504, __pyx_L1_error) } __pyx_L7:;
1507: 'Unsupported object column containing a numpy array ' +
+1508: f'of an unsupported element type {arr_type_name}.')
__pyx_t_12 = __Pyx_PyUnicode_Unicode(__pyx_v_arr_type_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_13[1] = __pyx_t_10; __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u_Unsupported_object_column_conta; __pyx_t_13[3] = __pyx_t_12; __pyx_t_13[4] = __pyx_mstate_global->__pyx_kp_u__2;
+1509: elif PyBytes_CheckExact(obj):
__pyx_t_7 = PyBytes_CheckExact(__pyx_v_obj);
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+1510: col.setup.source = col_source_t.col_source_bytes_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_bytes_pyobj;
+1511: elif isinstance(<object>obj, _uuid.UUID):
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_uuid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_UUID); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = PyObject_IsInstance(((PyObject *)__pyx_v_obj), __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 1511, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_7) { /* … */ goto __pyx_L6; }
+1512: col.setup.source = col_source_t.col_source_uuid_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_uuid_pyobj;
+1513: elif isinstance(<object>obj, _ipaddress.IPv4Address):
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ipaddress); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_IPv4Address); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = PyObject_IsInstance(((PyObject *)__pyx_v_obj), __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 1513, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { /* … */ goto __pyx_L6; }
+1514: col.setup.source = col_source_t.col_source_ipv4_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_ipv4_pyobj;
+1515: elif isinstance(<object>obj, datetime.datetime):
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = PyObject_IsInstance(((PyObject *)__pyx_v_obj), __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 1515, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_7) { /* … */ goto __pyx_L6; }
+1516: col.setup.source = col_source_t.col_source_datetime_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_datetime_pyobj;
+1517: elif isinstance(<object>obj, Decimal):
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_Decimal); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = PyObject_IsInstance(((PyObject *)__pyx_v_obj), __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 1517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (likely(__pyx_t_7)) { /* … */ goto __pyx_L6; }
+1518: col.setup.source = col_source_t.col_source_decimal_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_decimal_pyobj;
1519: else:
+1520: raise QuestDBError(
/*else*/ {
__pyx_t_1 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1520, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
+1521: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+1522: f'Bad column {pandas_col.name!r}: ' +
__pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_16[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_16[1] = __pyx_t_11; __pyx_t_16[2] = __pyx_mstate_global->__pyx_kp_u_Unsupported_object_column_conta_2; __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_16, 3, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 57, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11)); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+1523: f'Unsupported object column containing an object of type ' +
__pyx_t_10 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+1524: _fqn(type(<object>obj)) + '.')
__pyx_t_11 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_obj))))); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); /* … */ __pyx_t_11 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_10, __pyx_mstate_global->__pyx_kp_u__2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_15 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14); assert(__pyx_t_1); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_14, __pyx__function); __pyx_t_15 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_8, __pyx_t_11}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_15, (3-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(1, 1520, __pyx_L1_error) } __pyx_L6:;
+1525: return 0
__pyx_r = 0;
goto __pyx_L0;
1526:
1527: # We haven't returned yet, so we've hit an object column that
1528: # exclusively has null values. We will just skip this column.
+1529: col.setup.source = col_source_t.col_source_nulls
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_nulls;
1530:
1531:
+1532: cdef void_int _dataframe_resolve_source_and_buffers(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_resolve_source_and_buffers(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
PyObject *__pyx_v_dtype = 0;
int __pyx_v_ts_col_source;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_source_and_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dtype);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1533: PandasCol pandas_col, col_t* col) except -1:
+1534: cdef object dtype = pandas_col.dtype
__pyx_t_1 = __pyx_v_pandas_col->dtype;
__Pyx_INCREF(__pyx_t_1);
__pyx_v_dtype = __pyx_t_1;
__pyx_t_1 = 0;
+1535: cdef int ts_col_source = _dataframe_classify_timestamp_dtype(dtype)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_classify_timestamp_dtype(__pyx_v_dtype); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1535, __pyx_L1_error)
__pyx_v_ts_col_source = __pyx_t_2;
+1536: if ts_col_source != 0:
__pyx_t_3 = (__pyx_v_ts_col_source != 0);
if (__pyx_t_3) {
/* … */
goto __pyx_L3;
}
+1537: col.setup.source = <col_source_t>ts_col_source
__pyx_v_col->setup->source = ((enum __pyx_t_7questdb_7_client_col_source_t)__pyx_v_ts_col_source);
+1538: if col.setup.source == col_source_t.col_source_dt64ns_numpy:
switch (__pyx_v_col->setup->source) {
case __pyx_e_7questdb_7_client_col_source_dt64ns_numpy:
/* … */
break;
case __pyx_e_7questdb_7_client_col_source_dt64us_numpy:
+1539: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1539, __pyx_L1_error)
+1540: elif col.setup.source == col_source_t.col_source_dt64us_numpy:
break;
default:
1541: # NumPy-backed datetimes are serialized from the raw array buffer.
1542: # This source type covers both native datetime64[us] columns and
1543: # coarser numpy datetime64 units that we normalize to microseconds.
+1544: _dataframe_series_as_pybuf(
__pyx_t_5.__pyx_n = 1;
__pyx_t_5.fallback_dtype = __pyx_mstate_global->__pyx_kp_u_datetime64_us;
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, &__pyx_t_5); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1544, __pyx_L1_error)
1545: pandas_col, col, 'datetime64[us]')
1546: else:
+1547: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1547, __pyx_L1_error)
break;
}
+1548: elif isinstance(dtype, _NUMPY_BOOL):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_BOOL; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1548, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1549: col.setup.source = col_source_t.col_source_bool_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_bool_numpy;
+1550: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1550, __pyx_L1_error)
+1551: elif isinstance(dtype, _PANDAS.BooleanDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_BooleanDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1552: col.setup.source = col_source_t.col_source_bool_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_bool_arrow;
+1553: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1553, __pyx_L1_error)
+1554: elif isinstance(dtype, _NUMPY_UINT8):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_UINT8; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1555: col.setup.source = col_source_t.col_source_u8_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u8_numpy;
+1556: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1556, __pyx_L1_error)
+1557: elif isinstance(dtype, _NUMPY_INT8):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_INT8; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1558: col.setup.source = col_source_t.col_source_i8_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i8_numpy;
+1559: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1559, __pyx_L1_error)
+1560: elif isinstance(dtype, _NUMPY_UINT16):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_UINT16; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1561: col.setup.source = col_source_t.col_source_u16_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u16_numpy;
+1562: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1562, __pyx_L1_error)
+1563: elif isinstance(dtype, _NUMPY_INT16):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_INT16; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1564: col.setup.source = col_source_t.col_source_i16_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i16_numpy;
+1565: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1565, __pyx_L1_error)
+1566: elif isinstance(dtype, _NUMPY_UINT32):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_UINT32; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1567: col.setup.source = col_source_t.col_source_u32_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u32_numpy;
+1568: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1568, __pyx_L1_error)
+1569: elif isinstance(dtype, _NUMPY_INT32):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_INT32; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1570: col.setup.source = col_source_t.col_source_i32_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i32_numpy;
+1571: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1571, __pyx_L1_error)
+1572: elif isinstance(dtype, _NUMPY_UINT64):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_UINT64; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1573: col.setup.source = col_source_t.col_source_u64_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u64_numpy;
+1574: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1574, __pyx_L1_error)
+1575: elif isinstance(dtype, _NUMPY_INT64):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_INT64; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1576: col.setup.source = col_source_t.col_source_i64_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i64_numpy;
+1577: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1577, __pyx_L1_error)
+1578: elif isinstance(dtype, _PANDAS.UInt8Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_UInt8Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1578, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1579: col.setup.source = col_source_t.col_source_u8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u8_arrow;
+1580: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1580, __pyx_L1_error)
+1581: elif isinstance(dtype, _PANDAS.Int8Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_Int8Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1582: col.setup.source = col_source_t.col_source_i8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i8_arrow;
+1583: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1583, __pyx_L1_error)
+1584: elif isinstance(dtype, _PANDAS.UInt16Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_UInt16Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1585: col.setup.source = col_source_t.col_source_u16_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u16_arrow;
+1586: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1586, __pyx_L1_error)
+1587: elif isinstance(dtype, _PANDAS.Int16Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_Int16Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1588: col.setup.source = col_source_t.col_source_i16_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i16_arrow;
+1589: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1589, __pyx_L1_error)
+1590: elif isinstance(dtype, _PANDAS.UInt32Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_UInt32Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1590, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1591: col.setup.source = col_source_t.col_source_u32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u32_arrow;
+1592: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1592, __pyx_L1_error)
+1593: elif isinstance(dtype, _PANDAS.Int32Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_Int32Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1593, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1594: col.setup.source = col_source_t.col_source_i32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i32_arrow;
+1595: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1595, __pyx_L1_error)
+1596: elif isinstance(dtype, _PANDAS.UInt64Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_UInt64Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1596, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1597: col.setup.source = col_source_t.col_source_u64_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u64_arrow;
+1598: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1598, __pyx_L1_error)
+1599: elif isinstance(dtype, _PANDAS.Int64Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_Int64Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1600: col.setup.source = col_source_t.col_source_i64_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i64_arrow;
+1601: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1601, __pyx_L1_error)
+1602: elif isinstance(dtype, _NUMPY_FLOAT32):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_FLOAT32; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1603: col.setup.source = col_source_t.col_source_f32_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_f32_numpy;
+1604: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1604, __pyx_L1_error)
+1605: elif isinstance(dtype, _NUMPY_FLOAT64):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_FLOAT64; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1605, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1606: col.setup.source = col_source_t.col_source_f64_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_f64_numpy;
+1607: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1607, __pyx_L1_error)
+1608: elif isinstance(dtype, _PANDAS.Float32Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_Float32Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1608, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1609: col.setup.source = col_source_t.col_source_f32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_f32_arrow;
+1610: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1610, __pyx_L1_error)
+1611: elif isinstance(dtype, _PANDAS.Float64Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_Float64Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1611, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1612: col.setup.source = col_source_t.col_source_f64_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_f64_arrow;
+1613: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1613, __pyx_L1_error)
+1614: elif isinstance(dtype, _PANDAS.StringDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_StringDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1614, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1615: if dtype.storage == 'pyarrow':
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_storage); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pyarrow, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L4; }
+1616: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1616, __pyx_L1_error)
+1617: if strncmp(col.setup.arrow_schema.format, _ARROW_FMT_UTF8_STRING, 1) == 0:
__pyx_t_3 = (strncmp(__pyx_v_col->setup->arrow_schema.format, __pyx_v_7questdb_7_client__ARROW_FMT_UTF8_STRING, 1) == 0);
if (__pyx_t_3) {
/* … */
goto __pyx_L5;
}
+1618: col.setup.source = col_source_t.col_source_str_utf8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_utf8_arrow;
+1619: elif strncmp(col.setup.arrow_schema.format, _ARROW_FMT_LRG_UTF8_STRING, 1) == 0:
__pyx_t_3 = (strncmp(__pyx_v_col->setup->arrow_schema.format, __pyx_v_7questdb_7_client__ARROW_FMT_LRG_UTF8_STRING, 1) == 0);
if (likely(__pyx_t_3)) {
/* … */
goto __pyx_L5;
}
+1620: col.setup.source = col_source_t.col_source_str_lrg_utf8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow;
1621: else:
+1622: raise QuestDBError(
/*else*/ {
__pyx_t_6 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
+1623: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+1624: f'Unknown string dtype storage: {dtype.storage} ' +
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_storage); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* … */ __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_12, 7, 30 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 20, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11)); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+1625: f'for column {pandas_col.name} of dtype {dtype}. ' +
__pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_pandas_col->name); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_Unknown_string_dtype_storage; __pyx_t_12[1] = __pyx_t_10; __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_for_column; __pyx_t_12[3] = __pyx_t_8; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_of_dtype; __pyx_t_12[5] = __pyx_t_11; __pyx_t_12[6] = __pyx_mstate_global->__pyx_kp_u_Format_specifier;
+1626: f'Format specifier: ' + repr(bytes(col.setup.arrow_schema.format).decode('latin-1')))
__pyx_t_8 = NULL;
__pyx_t_10 = __Pyx_PyBytes_FromString(__pyx_v_col->setup->arrow_schema.format); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_14 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_10};
__pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
}
__pyx_t_10 = __Pyx_decode_bytes(__pyx_t_11, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeLatin1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_11 = PyObject_Repr(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_13, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_14 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
assert(__pyx_t_6);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
__pyx_t_14 = 0;
}
#endif
{
PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_9, __pyx_t_10};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(1, 1622, __pyx_L1_error)
}
__pyx_L5:;
+1627: elif dtype.storage == 'python':
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_storage); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_python, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_3)) { /* … */ goto __pyx_L4; }
+1628: col.setup.source = col_source_t.col_source_str_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_pyobj;
+1629: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1629, __pyx_L1_error)
1630: else:
+1631: raise QuestDBError(
/*else*/ {
__pyx_t_7 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1631, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
+1632: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1633: f'Unknown string dtype storage: f{dtype.storage} ' +
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_storage); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* … */ __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_12, 7, 31 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); assert(__pyx_t_7); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_14 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_8}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 1631, __pyx_L1_error) } __pyx_L4:;
+1634: f'for column {pandas_col.name} of dtype {dtype}.')
__pyx_t_9 = __Pyx_PyUnicode_Unicode(__pyx_v_pandas_col->name); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_v_dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_Unknown_string_dtype_storage_f; __pyx_t_12[1] = __pyx_t_11; __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_for_column; __pyx_t_12[3] = __pyx_t_9; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_of_dtype; __pyx_t_12[5] = __pyx_t_13; __pyx_t_12[6] = __pyx_mstate_global->__pyx_kp_u__2;
+1635: elif isinstance(dtype, _PANDAS.CategoricalDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_CategoricalDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1635, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1636: _dataframe_category_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_category_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1636, __pyx_L1_error)
+1637: elif isinstance(dtype, _NUMPY_OBJECT):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_OBJECT; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1638: _dataframe_series_sniff_pyobj(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_sniff_pyobj(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1638, __pyx_L1_error)
+1639: elif isinstance(dtype, _PANDAS.ArrowDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_ArrowDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1639, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_3)) { /* … */ goto __pyx_L3; }
+1640: _dataframe_series_resolve_arrow(pandas_col, dtype.pyarrow_dtype, col)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_pyarrow_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_resolve_arrow(__pyx_v_pandas_col, __pyx_t_1, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1640, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1641: else:
+1642: raise QuestDBError(
/*else*/ {
__pyx_t_10 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1642, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
+1643: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1644: f'Unsupported dtype {dtype} for column {pandas_col.name!r}. ' +
__pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_13 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_15[0] = __pyx_mstate_global->__pyx_kp_u_Unsupported_dtype; __pyx_t_15[1] = __pyx_t_6; __pyx_t_15[2] = __pyx_mstate_global->__pyx_kp_u_for_column; __pyx_t_15[3] = __pyx_t_13; __pyx_t_15[4] = __pyx_mstate_global->__pyx_kp_u_Raise_an_issue_if_you_think_it; __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_15, 5, 18 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 106, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_10); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_14 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_7, __pyx_t_9}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 1642, __pyx_L1_error) } __pyx_L3:;
1645: 'Raise an issue if you think it should be supported: ' +
1646: 'https://github.com/questdb/py-questdb-client/issues.')
1647:
+1648: cdef void_int _dataframe_resolve_target(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_resolve_target(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyObject *__pyx_v_field_targets) {
enum __pyx_t_7questdb_7_client_col_target_t __pyx_v_target;
PyObject *__pyx_v_target_sources = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_target", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_target_sources);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1649: PandasCol pandas_col, col_t* col, tuple field_targets) except -1:
1650: cdef col_target_t target
1651: cdef set target_sources
+1652: if col.setup.meta_target in _DIRECT_META_TARGETS:
__pyx_t_1 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_meta_target_t(__pyx_v_col->setup->meta_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_7questdb_7_client__DIRECT_META_TARGETS == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(1, 1652, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_7questdb_7_client__DIRECT_META_TARGETS, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1653: col.setup.target = <col_target_t><int>col.setup.meta_target
__pyx_v_col->setup->target = ((enum __pyx_t_7questdb_7_client_col_target_t)((int)__pyx_v_col->setup->meta_target));
+1654: return 0
__pyx_r = 0;
goto __pyx_L0;
+1655: for target in field_targets:
if (unlikely(__pyx_v_field_targets == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(1, 1655, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_field_targets; __Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = 0;
for (;;) {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1655, __pyx_L1_error)
#endif
if (__pyx_t_3 >= __pyx_temp) break;
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3));
#else
__pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
#endif
++__pyx_t_3;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1655, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = ((enum __pyx_t_7questdb_7_client_col_target_t)__Pyx_PyLong_As_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1655, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_target = __pyx_t_5;
/* … */
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1656: target_sources = _TARGET_TO_SOURCES[target]
if (unlikely(__pyx_v_7questdb_7_client__TARGET_TO_SOURCES == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 1656, __pyx_L1_error)
}
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_v_target); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1656, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_7questdb_7_client__TARGET_TO_SOURCES, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1656, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(PySet_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_6))) __PYX_ERR(1, 1656, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_target_sources, ((PyObject*)__pyx_t_6));
__pyx_t_6 = 0;
+1657: if col.setup.source in target_sources:
__pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_col->setup->source); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_v_target_sources == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(1, 1657, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_t_6, __pyx_v_target_sources, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1657, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* … */ }
+1658: col.setup.target = target
__pyx_v_col->setup->target = __pyx_v_target;
+1659: return 0
__pyx_r = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
+1660: if col.setup.source in _COLUMNAR_ONLY_PYOBJ_SOURCES:
__pyx_t_1 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_col->setup->source); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_7questdb_7_client__COLUMNAR_ONLY_PYOBJ_SOURCES, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1660, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { /* … */ }
+1661: raise QuestDBError(
__pyx_t_6 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
+1662: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+1663: f'Column {pandas_col.name!r} holds '
__pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* … */ __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, 7 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 117, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_12 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_12 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_8, __pyx_t_10}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 1661, __pyx_L1_error)
+1664: f'{_PYOBJ_SOURCE_DESCR[col.setup.source]} objects, which are only '
if (unlikely(__pyx_v_7questdb_7_client__PYOBJ_SOURCE_DESCR == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 1664, __pyx_L1_error)
}
__pyx_t_9 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_col->setup->source); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1664, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_7questdb_7_client__PYOBJ_SOURCE_DESCR, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1664, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1664, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Column_2;
__pyx_t_11[1] = __pyx_t_7;
__pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_holds;
__pyx_t_11[3] = __pyx_t_9;
__pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u_objects_which_are_only_supporte;
1665: f'supported on the columnar QuestDB.dataframe() path, not the '
1666: f'row-oriented Sender.dataframe().')
+1667: raise QuestDBError(
__pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10);
+1668: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+1669: f'Could not map column source type (code {col.setup.source} for ' +
__pyx_t_8 = __Pyx_PyUnicode_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_col->setup->source, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* … */ __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_13, 7, 39 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 3 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 18, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_12 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_12 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_6, __pyx_t_14}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 1667, __pyx_L1_error)
+1670: f'column {pandas_col.name!r} ' +
__pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9);
+1671: f' ({pandas_col.dtype}) to any ILP type.')
__pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_pandas_col->dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Could_not_map_column_source_type; __pyx_t_13[1] = __pyx_t_8; __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u_for_column; __pyx_t_13[3] = __pyx_t_9; __pyx_t_13[4] = __pyx_mstate_global->__pyx_kp_u__15; __pyx_t_13[5] = __pyx_t_7; __pyx_t_13[6] = __pyx_mstate_global->__pyx_kp_u_to_any_ILP_type;
1672:
1673:
+1674: cdef void _dataframe_init_cursor(col_t* col) noexcept nogil:
static void __pyx_f_7questdb_7_client__dataframe_init_cursor(struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
/* … */
/* function exit code */
}
+1675: col.cursor.chunk = col.setup.chunks.chunks
__pyx_t_1 = __pyx_v_col->setup->chunks.chunks; __pyx_v_col->cursor.chunk = __pyx_t_1;
+1676: col.cursor.chunk_index = 0
__pyx_v_col->cursor.chunk_index = 0;
+1677: while ((col.cursor.chunk_index < col.setup.chunks.n_chunks) and
while (1) {
__pyx_t_3 = (__pyx_v_col->cursor.chunk_index < __pyx_v_col->setup->chunks.n_chunks);
if (__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L5_bool_binop_done;
}
+1678: (col.cursor.chunk.length == 0)):
__pyx_t_3 = (__pyx_v_col->cursor.chunk->length == 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
if (!__pyx_t_2) break;
+1679: col.cursor.chunk_index += 1
__pyx_v_col->cursor.chunk_index = (__pyx_v_col->cursor.chunk_index + 1);
+1680: col.cursor.chunk += 1
__pyx_v_col->cursor.chunk = (__pyx_v_col->cursor.chunk + 1); }
+1681: col.cursor.offset = col.cursor.chunk.offset
__pyx_t_4 = __pyx_v_col->cursor.chunk->offset; __pyx_v_col->cursor.offset = __pyx_t_4;
+1682: col.cursor.dictionary_large_offsets = (
__pyx_v_col->cursor.dictionary_large_offsets = __pyx_t_2;
+1683: col.setup.arrow_schema.dictionary != NULL and
__pyx_t_3 = (__pyx_v_col->setup->arrow_schema.dictionary != NULL);
if (__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L7_bool_binop_done;
}
1684: strncmp(
1685: col.setup.arrow_schema.dictionary.format,
1686: _ARROW_FMT_LRG_UTF8_STRING,
+1687: 1) == 0)
__pyx_t_3 = (strncmp(__pyx_v_col->setup->arrow_schema.dictionary->format, __pyx_v_7questdb_7_client__ARROW_FMT_LRG_UTF8_STRING, 1) == 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:;
1688:
1689:
+1690: cdef void_int _dataframe_resolve_cols(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_resolve_cols(CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_pandas_cols, struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_cols, int *__pyx_v_any_cols_need_gil_out) {
size_t __pyx_v_index;
size_t __pyx_v_len_dataframe_cols;
struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col = 0;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_cols", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_pandas_col);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1691: qdb_pystr_buf* b,
1692: list pandas_cols,
1693: col_t_arr* cols,
1694: bint* any_cols_need_gil_out) except -1:
1695: cdef size_t index
+1696: cdef size_t len_dataframe_cols = len(pandas_cols)
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 1696, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyList_GET_SIZE(__pyx_v_pandas_cols); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 1696, __pyx_L1_error)
__pyx_v_len_dataframe_cols = __pyx_t_1;
1697: cdef PandasCol pandas_col
1698: cdef col_t* col
+1699: any_cols_need_gil_out[0] = False
(__pyx_v_any_cols_need_gil_out[0]) = 0;
+1700: for index in range(len_dataframe_cols):
__pyx_t_2 = __pyx_v_len_dataframe_cols;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4;
+1701: pandas_col = pandas_cols[index]
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 1701, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_pandas_cols, __pyx_v_index, size_t, 0, __Pyx_PyLong_FromSize_t, 1, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1701, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_PandasCol))))) __PYX_ERR(1, 1701, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_pandas_col, ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_5));
__pyx_t_5 = 0;
+1702: col = &cols.d[index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_index]));
1703:
1704: # The target is resolved in stages:
1705: # * We first assign all column `.meta_target`s to be fields.
1706: # * Then, depending on argument parsing some/none of the columns
1707: # obtain a meta-target of "table", "symbol" or "at".
1708: # * Finally, based on the source, any remaining "meta_target_field"
1709: # columns are converted to the appropriate target.
1710: # See: _dataframe_resolve_col_targets_and_dc(..).
+1711: col.setup.meta_target = meta_target_t.meta_target_field
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_field;
1712:
1713: # We will sort columns later. The index will be used to achieve a stable
1714: # sort among columns with the same `.meta_target`.
+1715: col.setup.orig_index = index
__pyx_v_col->setup->orig_index = __pyx_v_index;
1716:
+1717: _dataframe_resolve_source_and_buffers(pandas_col, col)
__pyx_t_6 = __pyx_f_7questdb_7_client__dataframe_resolve_source_and_buffers(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_6 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1717, __pyx_L1_error)
+1718: _dataframe_init_cursor(col)
__pyx_f_7questdb_7_client__dataframe_init_cursor(__pyx_v_col);
+1719: if col_source_needs_gil(col.setup.source):
__pyx_t_7 = __pyx_f_7questdb_7_client_col_source_needs_gil(__pyx_v_col->setup->source);
if (__pyx_t_7) {
/* … */
}
}
+1720: any_cols_need_gil_out[0] = True
(__pyx_v_any_cols_need_gil_out[0]) = 1;
1721:
1722:
+1723: cdef void_int _dataframe_resolve_cols_target_name_and_dc(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_resolve_cols_target_name_and_dc(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_pandas_cols, struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_cols, PyObject *__pyx_v_field_targets) {
size_t __pyx_v_index;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_cols_target_name_and_dc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_pandas_col);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1724: qdb_pystr_buf* b,
1725: list pandas_cols,
1726: col_t_arr* cols,
1727: tuple field_targets) except -1:
1728: cdef size_t index
1729: cdef col_t* col
1730: cdef PandasCol pandas_col
+1731: for index in range(cols.size):
__pyx_t_1 = __pyx_v_cols->size;
__pyx_t_2 = __pyx_t_1;
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_index = __pyx_t_3;
+1732: col = &cols.d[index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_index]));
+1733: pandas_col = pandas_cols[index]
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 1733, __pyx_L1_error)
}
__pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_pandas_cols, __pyx_v_index, size_t, 0, __Pyx_PyLong_FromSize_t, 1, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1733, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_PandasCol))))) __PYX_ERR(1, 1733, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_pandas_col, ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_4));
__pyx_t_4 = 0;
+1734: _dataframe_resolve_target(pandas_col, col, field_targets)
__pyx_t_5 = __pyx_f_7questdb_7_client__dataframe_resolve_target(__pyx_v_pandas_col, __pyx_v_col, __pyx_v_field_targets); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1734, __pyx_L1_error)
+1735: if col.setup.source not in _TARGET_TO_SOURCES[col.setup.target]:
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_col->setup->source); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__pyx_v_7questdb_7_client__TARGET_TO_SOURCES == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 1735, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_v_col->setup->target); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_7questdb_7_client__TARGET_TO_SOURCES, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_7, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 1735, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_t_8)) { /* … */ }
+1736: raise ValueError(
__pyx_t_4 = NULL;
+1737: f'Bad value: Column {pandas_col.name!r} ' +
__pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* … */ __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_12, 7, 18 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 24 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_13 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(1, 1736, __pyx_L1_error)
+1738: f'({pandas_col.dtype}) is not ' +
__pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_pandas_col->dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9);
+1739: f'supported as a {_TARGET_NAMES[col.setup.target]} column.')
if (unlikely(__pyx_v_7questdb_7_client__TARGET_NAMES == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 1739, __pyx_L1_error)
}
__pyx_t_10 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_v_col->setup->target); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1739, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_7questdb_7_client__TARGET_NAMES, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1739, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_11, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1739, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_Bad_value_Column;
__pyx_t_12[1] = __pyx_t_6;
__pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u__14;
__pyx_t_12[3] = __pyx_t_9;
__pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_is_not_supported_as_a;
__pyx_t_12[5] = __pyx_t_10;
__pyx_t_12[6] = __pyx_mstate_global->__pyx_kp_u_column;
+1740: col.dispatch_code = <col_dispatch_code_t>(
__pyx_v_col->dispatch_code = ((enum __pyx_t_7questdb_7_client_col_dispatch_code_t)(((int)__pyx_v_col->setup->source) + ((int)__pyx_v_col->setup->target)));
1741: <int>col.setup.source + <int>col.setup.target)
1742:
1743: # Since we don't need to send the column names for 'table' and
1744: # 'at' columns, we don't need to validate and encode them as
1745: # column names. This allows unsupported names for these columns.
+1746: if ((col.setup.meta_target != meta_target_t.meta_target_table) and
switch (__pyx_v_col->setup->meta_target) {
case __pyx_e_7questdb_7_client_meta_target_table:
case __pyx_e_7questdb_7_client_meta_target_at:
/* … */
__pyx_t_8 = 0;
/* … */
break;
default:
__pyx_t_8 = 1;
break;
}
if (__pyx_t_8) {
/* … */
}
}
1747: (col.setup.meta_target != meta_target_t.meta_target_at)):
+1748: str_to_column_name_copy(b, pandas_col.name, &col.name)
__pyx_t_7 = __pyx_v_pandas_col->name;
__Pyx_INCREF(__pyx_t_7);
__pyx_t_5 = __pyx_f_7questdb_7_client_str_to_column_name_copy(__pyx_v_b, ((PyObject*)__pyx_t_7), (&__pyx_v_col->name)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1748, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1749:
1750:
+1751: cdef int _dataframe_compare_cols(const void* lhs, const void* rhs) noexcept nogil:
static int __pyx_f_7questdb_7_client__dataframe_compare_cols(void const *__pyx_v_lhs, void const *__pyx_v_rhs) {
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_lhs_col;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_rhs_col;
int __pyx_v_source_diff;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
+1752: cdef col_t* lhs_col = <col_t*>lhs
__pyx_v_lhs_col = ((struct __pyx_t_7questdb_7_client_col_t *)__pyx_v_lhs);
+1753: cdef col_t* rhs_col = <col_t*>rhs
__pyx_v_rhs_col = ((struct __pyx_t_7questdb_7_client_col_t *)__pyx_v_rhs);
+1754: cdef int source_diff = lhs_col.setup.meta_target - rhs_col.setup.meta_target
__pyx_v_source_diff = (__pyx_v_lhs_col->setup->meta_target - __pyx_v_rhs_col->setup->meta_target);
+1755: if source_diff != 0:
__pyx_t_1 = (__pyx_v_source_diff != 0);
if (__pyx_t_1) {
/* … */
}
+1756: return source_diff
__pyx_r = __pyx_v_source_diff;
goto __pyx_L0;
+1757: return <int>lhs_col.setup.orig_index - <int>rhs_col.setup.orig_index
__pyx_r = (((int)__pyx_v_lhs_col->setup->orig_index) - ((int)__pyx_v_rhs_col->setup->orig_index)); goto __pyx_L0;
1758:
1759: # noinspection PyUnreachableCode
+1760: cdef void_int _dataframe_resolve_args(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_resolve_args(PyObject *__pyx_v_df, PyObject *__pyx_v_table_name, PyObject *__pyx_v_table_name_col, PyObject *__pyx_v_symbols, PyObject *__pyx_v_at, struct qdb_pystr_buf *__pyx_v_b, size_t __pyx_v_col_count, struct line_sender_table_name *__pyx_v_c_table_name_out, int64_t *__pyx_v_at_value_out, struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_cols, int *__pyx_v_any_cols_need_gil_out, PyObject *__pyx_v_field_targets) {
Py_ssize_t __pyx_v_name_col;
Py_ssize_t __pyx_v_at_col;
PyObject *__pyx_v_pandas_cols = 0;
PyObject *__pyx_7genexpr__pyx_v_index = NULL;
PyObject *__pyx_7genexpr__pyx_v_name = NULL;
PyObject *__pyx_7genexpr__pyx_v_series = NULL;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_pandas_cols);
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_index);
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_name);
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_series);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1761: object df,
1762: object table_name,
1763: object table_name_col,
1764: object symbols,
1765: object at,
1766: qdb_pystr_buf* b,
1767: size_t col_count,
1768: line_sender_table_name* c_table_name_out,
1769: int64_t* at_value_out,
1770: col_t_arr* cols,
1771: bint* any_cols_need_gil_out,
1772: tuple field_targets) except -1:
1773: cdef ssize_t name_col
1774: cdef ssize_t at_col
1775:
+1776: cdef list pandas_cols = [
{ /* enter inner scope */
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1776, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
__pyx_t_2 = __pyx_mstate_global->__pyx_int_0;
+1777: PandasCol(name, df.dtypes.iloc[index], series)
__pyx_t_7 = NULL;
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_dtypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1777, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_iloc); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1777, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_7genexpr__pyx_v_index); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1777, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_12 = 1;
{
PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_7genexpr__pyx_v_name, __pyx_t_10, __pyx_7genexpr__pyx_v_series};
__pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7questdb_7_client_PandasCol, __pyx_callargs+__pyx_t_12, (4-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1777, __pyx_L5_error)
__Pyx_GOTREF((PyObject *)__pyx_t_8);
}
if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(1, 1776, __pyx_L5_error)
__Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_index); __pyx_7genexpr__pyx_v_index = 0;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __pyx_7genexpr__pyx_v_name = 0;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_series); __pyx_7genexpr__pyx_v_series = 0;
goto __pyx_L8_exit_scope;
__pyx_L5_error:;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_index); __pyx_7genexpr__pyx_v_index = 0;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __pyx_7genexpr__pyx_v_name = 0;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_series); __pyx_7genexpr__pyx_v_series = 0;
goto __pyx_L1_error;
__pyx_L8_exit_scope:;
} /* exit inner scope */
__pyx_v_pandas_cols = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
+1778: for index, (name, series) in enumerate(df.items())]
__pyx_t_4 = 0;
if (unlikely(__pyx_v_df == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
__PYX_ERR(1, 1778, __pyx_L5_error)
}
__pyx_t_7 = __Pyx_dict_iterator(__pyx_v_df, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1778, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_3);
__pyx_t_3 = __pyx_t_7;
__pyx_t_7 = 0;
while (1) {
__pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6);
if (unlikely(__pyx_t_9 == 0)) break;
if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 1778, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_name, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_series, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_INCREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_index, __pyx_t_2);
__pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1778, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2);
__pyx_t_2 = __pyx_t_8;
__pyx_t_8 = 0;
+1779: _dataframe_resolve_cols(b, pandas_cols, cols, any_cols_need_gil_out)
__pyx_t_13 = __pyx_f_7questdb_7_client__dataframe_resolve_cols(__pyx_v_b, __pyx_v_pandas_cols, __pyx_v_cols, __pyx_v_any_cols_need_gil_out); if (unlikely(__pyx_t_13 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1779, __pyx_L1_error)
+1780: name_col = _dataframe_resolve_table_name(
__pyx_t_14 = __pyx_f_7questdb_7_client__dataframe_resolve_table_name(__pyx_v_b, __pyx_v_df, __pyx_v_pandas_cols, __pyx_v_cols, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_col_count, __pyx_v_c_table_name_out); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-2L))) __PYX_ERR(1, 1780, __pyx_L1_error)
__pyx_v_name_col = __pyx_t_14;
1781: b,
1782: df,
1783: pandas_cols,
1784: cols,
1785: table_name,
1786: table_name_col,
1787: col_count,
1788: c_table_name_out)
+1789: at_col = _dataframe_resolve_at(
__pyx_t_14 = __pyx_f_7questdb_7_client__dataframe_resolve_at(__pyx_v_df, __pyx_v_cols, __pyx_v_at, __pyx_v_col_count, __pyx_v_at_value_out, __pyx_t_15); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-2L))) __PYX_ERR(1, 1789, __pyx_L1_error)
__pyx_v_at_col = __pyx_t_14;
1790: df, cols, at, col_count, at_value_out,
+1791: field_targets is _FIELD_TARGETS_QWP)
__pyx_t_15 = (__pyx_v_field_targets == __pyx_v_7questdb_7_client__FIELD_TARGETS_QWP);
+1792: _dataframe_resolve_symbols(df, pandas_cols, cols, name_col, at_col, symbols)
__pyx_t_13 = __pyx_f_7questdb_7_client__dataframe_resolve_symbols(__pyx_v_df, __pyx_v_pandas_cols, __pyx_v_cols, __pyx_v_name_col, __pyx_v_at_col, __pyx_v_symbols); if (unlikely(__pyx_t_13 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1792, __pyx_L1_error)
+1793: _dataframe_resolve_cols_target_name_and_dc(
__pyx_t_13 = __pyx_f_7questdb_7_client__dataframe_resolve_cols_target_name_and_dc(__pyx_v_b, __pyx_v_pandas_cols, __pyx_v_cols, __pyx_v_field_targets); if (unlikely(__pyx_t_13 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1793, __pyx_L1_error)
1794: b, pandas_cols, cols, field_targets)
+1795: qsort(cols.d, col_count, sizeof(col_t), _dataframe_compare_cols)
qsort(__pyx_v_cols->d, __pyx_v_col_count, (sizeof(struct __pyx_t_7questdb_7_client_col_t)), __pyx_f_7questdb_7_client__dataframe_compare_cols);
1796:
1797:
+1798: cdef void_int _dataframe_plan_build(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_plan_build(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_df, PyObject *__pyx_v_table_name, PyObject *__pyx_v_table_name_col, PyObject *__pyx_v_symbols, PyObject *__pyx_v_at, struct __pyx_t_7questdb_7_client_dataframe_plan_t *__pyx_v_plan, PyObject *__pyx_v_field_targets) {
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("questdb._client._dataframe_plan_build", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1799: qdb_pystr_buf* b,
1800: object df,
1801: object table_name,
1802: object table_name_col,
1803: object symbols,
1804: object at,
1805: dataframe_plan_t* plan,
1806: tuple field_targets) except -1:
+1807: _dataframe_may_import_deps()
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_may_import_deps(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1808: _dataframe_check_is_dataframe(df)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_check_is_dataframe(__pyx_v_df); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1809: plan.row_count = len(df)
__pyx_t_2 = PyObject_Length(__pyx_v_df); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 1809, __pyx_L1_error) __pyx_v_plan->row_count = __pyx_t_2;
+1810: if (len(df.columns) == 0) or (plan.row_count == 0):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 1810, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_2 == 0); if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__pyx_v_plan->row_count == 0); __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+1811: plan.col_count = 0
__pyx_v_plan->col_count = 0;
+1812: return 0
__pyx_r = 0;
goto __pyx_L0;
1813:
+1814: plan.col_count = len(df.columns)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 1814, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_plan->col_count = __pyx_t_2;
+1815: qdb_pystr_buf_clear(b)
qdb_pystr_buf_clear(__pyx_v_b);
+1816: plan.cols = col_t_arr_new(plan.col_count)
__pyx_v_plan->cols = __pyx_f_7questdb_7_client_col_t_arr_new(__pyx_v_plan->col_count);
+1817: if plan.cols.d == NULL:
__pyx_t_3 = (__pyx_v_plan->cols.d == NULL);
if (unlikely(__pyx_t_3)) {
/* … */
}
+1818: raise MemoryError()
PyErr_NoMemory(); __PYX_ERR(1, 1818, __pyx_L1_error)
+1819: _dataframe_resolve_args(
__pyx_t_6 = __pyx_f_7questdb_7_client__dataframe_resolve_args(__pyx_v_df, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_symbols, __pyx_t_1, __pyx_v_b, __pyx_v_plan->col_count, (&__pyx_v_plan->c_table_name), (&__pyx_v_plan->at_value), (&__pyx_v_plan->cols), (&__pyx_v_plan->any_cols_need_gil), __pyx_v_field_targets); if (unlikely(__pyx_t_6 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1819, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1820: df,
1821: table_name,
1822: table_name_col,
1823: symbols,
+1824: at if not isinstance(at, ServerTimestampType) else None,
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ServerTimestampType); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_IsInstance(__pyx_v_at, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1824, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { __Pyx_INCREF(__pyx_v_at); __pyx_t_1 = __pyx_v_at; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; }
1825: b,
1826: plan.col_count,
1827: &plan.c_table_name,
1828: &plan.at_value,
1829: &plan.cols,
1830: &plan.any_cols_need_gil,
1831: field_targets)
1832:
1833: # Headers and table names stored in `b` are borrowed by the plan.
1834: # Serialization rewinds to this point for every row without dropping
1835: # those borrowed strings.
+1836: plan.str_buf_marker = qdb_pystr_buf_tell(b)
__pyx_v_plan->str_buf_marker = qdb_pystr_buf_tell(__pyx_v_b);
1837:
1838:
+1839: cdef object _dataframe_plan_debug_str(const char* buf, size_t length):
static PyObject *__pyx_f_7questdb_7_client__dataframe_plan_debug_str(char const *__pyx_v_buf, size_t __pyx_v_length) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_plan_debug_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+1840: if buf == NULL:
__pyx_t_1 = (__pyx_v_buf == NULL);
if (__pyx_t_1) {
/* … */
}
+1841: return None
__Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0;
+1842: return PyUnicode_FromStringAndSize(buf, <Py_ssize_t>length)
__Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyUnicode_FromStringAndSize(__pyx_v_buf, ((Py_ssize_t)__pyx_v_length)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0;
1843:
1844:
+1845: def _debug_dataframe_plan(
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7_client_3_debug_dataframe_plan(PyObject *__pyx_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7questdb_7_client_3_debug_dataframe_plan = {"_debug_dataframe_plan", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7questdb_7_client_3_debug_dataframe_plan, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7questdb_7_client_3_debug_dataframe_plan(PyObject *__pyx_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_df = 0;
PyObject *__pyx_v_table_name = 0;
PyObject *__pyx_v_table_name_col = 0;
PyObject *__pyx_v_symbols = 0;
PyObject *__pyx_v_at = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_debug_dataframe_plan (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_df,&__pyx_mstate_global->__pyx_n_u_table_name,&__pyx_mstate_global->__pyx_n_u_table_name_col,&__pyx_mstate_global->__pyx_n_u_symbols,&__pyx_mstate_global->__pyx_n_u_at,0};
PyObject* values[5] = {0,0,0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 1845, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 1845, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_debug_dataframe_plan", 0) < (0)) __PYX_ERR(1, 1845, __pyx_L3_error)
/* … */
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_7questdb_7_client_2_debug_dataframe_plan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_df, PyObject *__pyx_v_table_name, PyObject *__pyx_v_table_name_col, PyObject *__pyx_v_symbols, PyObject *__pyx_v_at) {
struct qdb_pystr_buf *__pyx_v_b;
struct __pyx_t_7questdb_7_client_dataframe_plan_t __pyx_v_plan;
size_t __pyx_v_col_index;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
PyObject *__pyx_v_cols = 0;
PyObject *__pyx_v_at_value = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("questdb._client._debug_dataframe_plan", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_cols);
__Pyx_XDECREF(__pyx_v_at_value);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_15 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 1845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_15);
/* … */
__pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7_client_3_debug_dataframe_plan, 0, __pyx_mstate_global->__pyx_n_u_debug_dataframe_plan, NULL, __pyx_mstate_global->__pyx_n_u_questdb__client, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
#endif
__Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_15);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_debug_dataframe_plan, __pyx_t_4) < (0)) __PYX_ERR(1, 1845, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1846: object df,
1847: *,
+1848: object table_name=None,
if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None)); /* … */ if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None)); /* … */ if (PyDict_SetItem(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_table_name, Py_None) < (0)) __PYX_ERR(1, 1845, __pyx_L1_error)
+1849: object table_name_col=None,
if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_auto))); /* … */ if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_auto))); /* … */ if (PyDict_SetItem(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_table_name_col, Py_None) < (0)) __PYX_ERR(1, 1845, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_symbols, ((PyObject*)__pyx_mstate_global->__pyx_n_u_auto)) < (0)) __PYX_ERR(1, 1845, __pyx_L1_error)
1850: object symbols='auto',
+1851: object at=None):
if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_debug_dataframe_plan", 1, 1, 1, i); __PYX_ERR(1, 1845, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 1845, __pyx_L3_error) /* … */ if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None)); } __pyx_v_df = values[0]; __pyx_v_table_name = values[1]; __pyx_v_table_name_col = values[2]; __pyx_v_symbols = values[3]; __pyx_v_at = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_debug_dataframe_plan", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 1845, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("questdb._client._debug_dataframe_plan", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7questdb_7_client_2_debug_dataframe_plan(__pyx_self, __pyx_v_df, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_symbols, __pyx_v_at); /* … */ if (PyDict_SetItem(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_at, Py_None) < (0)) __PYX_ERR(1, 1845, __pyx_L1_error)
+1852: cdef qdb_pystr_buf* b = qdb_pystr_buf_new()
__pyx_v_b = qdb_pystr_buf_new();
+1853: cdef dataframe_plan_t plan = dataframe_plan_blank()
__pyx_v_plan = __pyx_f_7questdb_7_client_dataframe_plan_blank();
1854: cdef size_t col_index
1855: cdef col_t* col
+1856: cdef list cols = []
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cols = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+1857: try:
/*try:*/ {
+1858: _dataframe_plan_build(
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_plan_build(__pyx_v_b, __pyx_v_df, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_symbols, __pyx_v_at, (&__pyx_v_plan), ((PyObject*)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 1858, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1859: b,
1860: df,
1861: table_name,
1862: table_name_col,
1863: symbols,
1864: at,
1865: &plan,
+1866: _FIELD_TARGETS_ROW)
__pyx_t_1 = __pyx_v_7questdb_7_client__FIELD_TARGETS_ROW;
__Pyx_INCREF(__pyx_t_1);
+1867: for col_index in range(plan.col_count):
__pyx_t_3 = __pyx_v_plan.col_count;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_col_index = __pyx_t_5;
+1868: col = &plan.cols.d[col_index]
__pyx_v_col = (&(__pyx_v_plan.cols.d[__pyx_v_col_index]));
+1869: cols.append({
__pyx_t_8 = __Pyx_PyList_Append(__pyx_v_cols, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 1869, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; }
+1870: 'orig_index': col.setup.orig_index,
__pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1870, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyLong_FromSize_t(__pyx_v_col->setup->orig_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1870, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_orig_index, __pyx_t_6) < (0)) __PYX_ERR(1, 1870, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1871: 'orig_name': df.columns[col.setup.orig_index],
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1871, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_col->setup->orig_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1871, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_orig_name, __pyx_t_7) < (0)) __PYX_ERR(1, 1870, __pyx_L4_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+1872: 'target': _TARGET_NAMES[col.setup.target],
if (unlikely(__pyx_v_7questdb_7_client__TARGET_NAMES == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 1872, __pyx_L4_error)
}
__pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_v_col->setup->target); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1872, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_7questdb_7_client__TARGET_NAMES, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1872, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_target, __pyx_t_6) < (0)) __PYX_ERR(1, 1870, __pyx_L4_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1873: 'target_name': _dataframe_plan_debug_str(
__pyx_t_6 = __pyx_f_7questdb_7_client__dataframe_plan_debug_str(__pyx_v_col->name.buf, __pyx_v_col->name.len); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1873, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_target_name, __pyx_t_6) < (0)) __PYX_ERR(1, 1870, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1874: col.name.buf,
1875: col.name.len),
+1876: 'source_code': <int>col.setup.source,
__pyx_t_6 = __Pyx_PyLong_From_int(((int)__pyx_v_col->setup->source)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1876, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_source_code, __pyx_t_6) < (0)) __PYX_ERR(1, 1870, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1877: 'dispatch_code': <int>col.dispatch_code,
__pyx_t_6 = __Pyx_PyLong_From_int(((int)__pyx_v_col->dispatch_code)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1877, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_dispatch_code, __pyx_t_6) < (0)) __PYX_ERR(1, 1870, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1878: })
+1879: if plan.at_value == _AT_IS_SERVER_NOW:
__pyx_t_9 = (__pyx_v_plan.at_value == __pyx_v_7questdb_7_client__AT_IS_SERVER_NOW);
if (__pyx_t_9) {
/* … */
goto __pyx_L8;
}
+1880: at_value = 'server_now'
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_server_now);
__pyx_v_at_value = __pyx_mstate_global->__pyx_n_u_server_now;
+1881: elif plan.at_value == _AT_IS_SET_BY_COLUMN:
__pyx_t_9 = (__pyx_v_plan.at_value == __pyx_v_7questdb_7_client__AT_IS_SET_BY_COLUMN);
if (__pyx_t_9) {
/* … */
goto __pyx_L8;
}
+1882: at_value = 'column'
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_column_2);
__pyx_v_at_value = __pyx_mstate_global->__pyx_n_u_column_2;
1883: else:
+1884: at_value = plan.at_value
/*else*/ {
__pyx_t_1 = __Pyx_PyLong_From_int64_t(__pyx_v_plan.at_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1884, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_at_value = __pyx_t_1;
__pyx_t_1 = 0;
}
__pyx_L8:;
+1885: return {
__Pyx_XDECREF(__pyx_r);
+1886: 'row_count': plan.row_count,
__pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1886, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyLong_FromSize_t(__pyx_v_plan.row_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1886, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_row_count, __pyx_t_6) < (0)) __PYX_ERR(1, 1886, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1887: 'col_count': plan.col_count,
__pyx_t_6 = __Pyx_PyLong_FromSize_t(__pyx_v_plan.col_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1887, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_col_count, __pyx_t_6) < (0)) __PYX_ERR(1, 1886, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1888: 'fixed_table_name': _dataframe_plan_debug_str(
__pyx_t_6 = __pyx_f_7questdb_7_client__dataframe_plan_debug_str(__pyx_v_plan.c_table_name.buf, __pyx_v_plan.c_table_name.len); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1888, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_fixed_table_name, __pyx_t_6) < (0)) __PYX_ERR(1, 1886, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1889: plan.c_table_name.buf,
1890: plan.c_table_name.len),
+1891: 'at_value': at_value,
if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_at_value, __pyx_v_at_value) < (0)) __PYX_ERR(1, 1886, __pyx_L4_error)
+1892: 'any_cols_need_gil': bool(plan.any_cols_need_gil),
__pyx_t_7 = NULL;
__pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_plan.any_cols_need_gil); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1892, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_3 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_10};
__pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1892, __pyx_L4_error)
__Pyx_GOTREF((PyObject *)__pyx_t_6);
}
if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_any_cols_need_gil, ((PyObject *)__pyx_t_6)) < (0)) __PYX_ERR(1, 1886, __pyx_L4_error)
__Pyx_DECREF((PyObject *)__pyx_t_6); __pyx_t_6 = 0;
+1893: 'cols': cols,
if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_cols, __pyx_v_cols) < (0)) __PYX_ERR(1, 1886, __pyx_L4_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L3_return; }
1894: }
1895: finally:
+1896: dataframe_plan_release(&plan)
/*finally:*/ {
__pyx_L4_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
if ( unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
__Pyx_XGOTREF(__pyx_t_14);
__Pyx_XGOTREF(__pyx_t_15);
__Pyx_XGOTREF(__pyx_t_16);
__Pyx_XGOTREF(__pyx_t_17);
__Pyx_XGOTREF(__pyx_t_18);
__Pyx_XGOTREF(__pyx_t_19);
__pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
{
__pyx_f_7questdb_7_client_dataframe_plan_release((&__pyx_v_plan));
/* … */
__pyx_f_7questdb_7_client_dataframe_plan_release((&__pyx_v_plan));
+1897: qdb_pystr_buf_free(b)
qdb_pystr_buf_free(__pyx_v_b);
}
__Pyx_XGIVEREF(__pyx_t_17);
__Pyx_XGIVEREF(__pyx_t_18);
__Pyx_XGIVEREF(__pyx_t_19);
__Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
__Pyx_XGIVEREF(__pyx_t_14);
__Pyx_XGIVEREF(__pyx_t_15);
__Pyx_XGIVEREF(__pyx_t_16);
__Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
__pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
__pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
goto __pyx_L1_error;
}
__pyx_L3_return: {
__pyx_t_19 = __pyx_r;
__pyx_r = 0;
/* … */
qdb_pystr_buf_free(__pyx_v_b);
__pyx_r = __pyx_t_19;
__pyx_t_19 = 0;
goto __pyx_L0;
}
}
1898:
1899:
+1900: cdef inline bint _dataframe_arrow_get_bool(col_cursor_t* cursor) noexcept nogil:
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_get_bool(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
1901: return (
+1902: (<uint8_t*>cursor.chunk.buffers[1])[cursor.offset // 8] &
__pyx_r = ((((uint8_t *)(__pyx_v_cursor->chunk->buffers[1]))[(__pyx_v_cursor->offset / 8)]) & (1 << (__pyx_v_cursor->offset % 8))); goto __pyx_L0;
1903: (1 << (cursor.offset % 8))
1904: )
1905:
1906:
+1907: cdef inline bint _dataframe_arrow_is_valid(col_cursor_t* cursor) noexcept nogil:
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_is_valid(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
1908: """Check if the value is set according to the validity bitmap."""
1909: return (
+1910: cursor.chunk.null_count == 0 or
__pyx_t_2 = (__pyx_v_cursor->chunk->null_count == 0);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
1911: (
+1912: (<uint8_t*>cursor.chunk.buffers[0])[cursor.offset // 8] &
__pyx_t_2 = (((((uint8_t *)(__pyx_v_cursor->chunk->buffers[0]))[(__pyx_v_cursor->offset / 8)]) & (1 << (__pyx_v_cursor->offset % 8))) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; goto __pyx_L0;
1913: (1 << (cursor.offset % 8))
1914: )
1915: )
1916:
1917:
+1918: cdef inline void _dataframe_arrow_get_cat_value(
static CYTHON_INLINE void __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_value(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, size_t __pyx_v_key, size_t *__pyx_v_len_out, char const **__pyx_v_buf_out) {
int32_t *__pyx_v_value_index_access;
int64_t *__pyx_v_value_lrg_index_access;
int32_t __pyx_v_value_begin;
int64_t __pyx_v_value_lrg_begin;
uint8_t *__pyx_v_value_char_access;
/* … */
/* function exit code */
}
1919: col_cursor_t* cursor,
1920: size_t key,
1921: size_t* len_out,
1922: const char** buf_out) noexcept nogil:
1923: cdef int32_t* value_index_access
1924: cdef int64_t* value_lrg_index_access
1925: cdef int32_t value_begin
1926: cdef int64_t value_lrg_begin
1927: cdef uint8_t* value_char_access
+1928: value_char_access = <uint8_t*>cursor.chunk.dictionary.buffers[2]
__pyx_v_value_char_access = ((uint8_t *)(__pyx_v_cursor->chunk->dictionary->buffers[2]));
+1929: if cursor.dictionary_large_offsets:
if (__pyx_v_cursor->dictionary_large_offsets) {
/* … */
goto __pyx_L3;
}
+1930: value_lrg_index_access = <int64_t*>cursor.chunk.dictionary.buffers[1]
__pyx_v_value_lrg_index_access = ((int64_t *)(__pyx_v_cursor->chunk->dictionary->buffers[1]));
+1931: value_lrg_begin = value_lrg_index_access[key]
__pyx_v_value_lrg_begin = (__pyx_v_value_lrg_index_access[__pyx_v_key]);
+1932: len_out[0] = <size_t>(
(__pyx_v_len_out[0]) = ((size_t)((__pyx_v_value_lrg_index_access[(__pyx_v_key + 1)]) - __pyx_v_value_lrg_begin));
1933: value_lrg_index_access[key + 1] - value_lrg_begin)
+1934: buf_out[0] = <const char*>&value_char_access[
(__pyx_v_buf_out[0]) = ((char const *)(&(__pyx_v_value_char_access[((size_t)__pyx_v_value_lrg_begin)])));
1935: <size_t>value_lrg_begin]
1936: else:
+1937: value_index_access = <int32_t*>cursor.chunk.dictionary.buffers[1]
/*else*/ {
__pyx_v_value_index_access = ((int32_t *)(__pyx_v_cursor->chunk->dictionary->buffers[1]));
+1938: value_begin = value_index_access[key]
__pyx_v_value_begin = (__pyx_v_value_index_access[__pyx_v_key]);
+1939: len_out[0] = value_index_access[key + 1] - value_begin
(__pyx_v_len_out[0]) = ((__pyx_v_value_index_access[(__pyx_v_key + 1)]) - __pyx_v_value_begin);
+1940: buf_out[0] = <const char*>&value_char_access[value_begin]
(__pyx_v_buf_out[0]) = ((char const *)(&(__pyx_v_value_char_access[__pyx_v_value_begin]))); } __pyx_L3:;
1941:
1942:
+1943: cdef inline bint _dataframe_arrow_get_cat_i8(
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i8(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, size_t *__pyx_v_len_out, char const **__pyx_v_buf_out) {
int __pyx_v_valid;
int8_t *__pyx_v_key_access;
int8_t __pyx_v_key;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
1944: col_cursor_t* cursor, size_t* len_out, const char** buf_out) noexcept nogil:
+1945: cdef bint valid = _dataframe_arrow_is_valid(cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid(__pyx_v_cursor);
1946: cdef int8_t* key_access
1947: cdef int8_t key
+1948: if valid:
if (__pyx_v_valid) {
/* … */
}
+1949: key_access = <int8_t*>cursor.chunk.buffers[1]
__pyx_v_key_access = ((int8_t *)(__pyx_v_cursor->chunk->buffers[1]));
+1950: key = key_access[cursor.offset]
__pyx_v_key = (__pyx_v_key_access[__pyx_v_cursor->offset]);
+1951: _dataframe_arrow_get_cat_value(cursor, <size_t>key, len_out, buf_out)
__pyx_f_7questdb_7_client__dataframe_arrow_get_cat_value(__pyx_v_cursor, ((size_t)__pyx_v_key), __pyx_v_len_out, __pyx_v_buf_out);
+1952: return valid
__pyx_r = __pyx_v_valid; goto __pyx_L0;
1953:
1954:
+1955: cdef inline bint _dataframe_arrow_get_cat_i16(
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i16(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, size_t *__pyx_v_len_out, char const **__pyx_v_buf_out) {
int __pyx_v_valid;
int16_t *__pyx_v_key_access;
int16_t __pyx_v_key;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
1956: col_cursor_t* cursor, size_t* len_out, const char** buf_out) noexcept nogil:
+1957: cdef bint valid = _dataframe_arrow_is_valid(cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid(__pyx_v_cursor);
1958: cdef int16_t* key_access
1959: cdef int16_t key
+1960: if valid:
if (__pyx_v_valid) {
/* … */
}
+1961: key_access = <int16_t*>cursor.chunk.buffers[1]
__pyx_v_key_access = ((int16_t *)(__pyx_v_cursor->chunk->buffers[1]));
+1962: key = key_access[cursor.offset]
__pyx_v_key = (__pyx_v_key_access[__pyx_v_cursor->offset]);
+1963: _dataframe_arrow_get_cat_value(cursor, <size_t>key, len_out, buf_out)
__pyx_f_7questdb_7_client__dataframe_arrow_get_cat_value(__pyx_v_cursor, ((size_t)__pyx_v_key), __pyx_v_len_out, __pyx_v_buf_out);
+1964: return valid
__pyx_r = __pyx_v_valid; goto __pyx_L0;
1965:
1966:
+1967: cdef inline bint _dataframe_arrow_get_cat_i32(
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i32(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, size_t *__pyx_v_len_out, char const **__pyx_v_buf_out) {
int __pyx_v_valid;
int32_t *__pyx_v_key_access;
int32_t __pyx_v_key;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
1968: col_cursor_t* cursor, size_t* len_out, const char** buf_out) noexcept nogil:
+1969: cdef bint valid = _dataframe_arrow_is_valid(cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid(__pyx_v_cursor);
1970: cdef int32_t* key_access
1971: cdef int32_t key
+1972: if valid:
if (__pyx_v_valid) {
/* … */
}
+1973: key_access = <int32_t*>cursor.chunk.buffers[1]
__pyx_v_key_access = ((int32_t *)(__pyx_v_cursor->chunk->buffers[1]));
+1974: key = key_access[cursor.offset]
__pyx_v_key = (__pyx_v_key_access[__pyx_v_cursor->offset]);
+1975: _dataframe_arrow_get_cat_value(cursor, <size_t>key, len_out, buf_out)
__pyx_f_7questdb_7_client__dataframe_arrow_get_cat_value(__pyx_v_cursor, ((size_t)__pyx_v_key), __pyx_v_len_out, __pyx_v_buf_out);
+1976: return valid
__pyx_r = __pyx_v_valid; goto __pyx_L0;
1977:
1978:
+1979: cdef inline bint _dataframe_arrow_str_utf8(
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, size_t *__pyx_v_len_out, char const **__pyx_v_buf_out) {
int32_t *__pyx_v_index_access;
uint8_t *__pyx_v_char_access;
int32_t __pyx_v_begin;
int __pyx_v_valid;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
1980: col_cursor_t* cursor,
1981: size_t* len_out,
1982: const char** buf_out) noexcept nogil:
1983: cdef int32_t* index_access
1984: cdef uint8_t* char_access
1985: cdef int32_t begin
+1986: cdef bint valid = _dataframe_arrow_is_valid(cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid(__pyx_v_cursor);
+1987: if valid:
if (__pyx_v_valid) {
/* … */
}
+1988: index_access = <int32_t*>cursor.chunk.buffers[1]
__pyx_v_index_access = ((int32_t *)(__pyx_v_cursor->chunk->buffers[1]));
+1989: char_access = <uint8_t*>cursor.chunk.buffers[2]
__pyx_v_char_access = ((uint8_t *)(__pyx_v_cursor->chunk->buffers[2]));
+1990: begin = index_access[cursor.offset]
__pyx_v_begin = (__pyx_v_index_access[__pyx_v_cursor->offset]);
+1991: len_out[0] = index_access[cursor.offset + 1] - begin
(__pyx_v_len_out[0]) = ((__pyx_v_index_access[(__pyx_v_cursor->offset + 1)]) - __pyx_v_begin);
+1992: buf_out[0] = <const char*>&char_access[begin]
(__pyx_v_buf_out[0]) = ((char const *)(&(__pyx_v_char_access[__pyx_v_begin])));
+1993: return valid
__pyx_r = __pyx_v_valid; goto __pyx_L0;
1994:
+1995: cdef inline bint _dataframe_arrow_str_utf8_lrg(
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8_lrg(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, size_t *__pyx_v_len_out, char const **__pyx_v_buf_out) {
int64_t *__pyx_v_index_access;
uint8_t *__pyx_v_char_access;
int64_t __pyx_v_begin;
int __pyx_v_valid;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
1996: col_cursor_t* cursor,
1997: size_t* len_out,
1998: const char** buf_out) noexcept nogil:
1999: cdef int64_t* index_access
2000: cdef uint8_t* char_access
2001: cdef int64_t begin
+2002: cdef bint valid = _dataframe_arrow_is_valid(cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid(__pyx_v_cursor);
+2003: if valid:
if (__pyx_v_valid) {
/* … */
}
+2004: index_access = <int64_t*>cursor.chunk.buffers[1]
__pyx_v_index_access = ((int64_t *)(__pyx_v_cursor->chunk->buffers[1]));
+2005: char_access = <uint8_t*>cursor.chunk.buffers[2]
__pyx_v_char_access = ((uint8_t *)(__pyx_v_cursor->chunk->buffers[2]));
+2006: begin = index_access[cursor.offset]
__pyx_v_begin = (__pyx_v_index_access[__pyx_v_cursor->offset]);
+2007: len_out[0] = index_access[cursor.offset + 1] - begin
(__pyx_v_len_out[0]) = ((__pyx_v_index_access[(__pyx_v_cursor->offset + 1)]) - __pyx_v_begin);
+2008: buf_out[0] = <const char*>&char_access[begin]
(__pyx_v_buf_out[0]) = ((char const *)(&(__pyx_v_char_access[__pyx_v_begin])));
+2009: return valid
__pyx_r = __pyx_v_valid; goto __pyx_L0;
2010:
2011:
+2012: cdef inline void_int _dataframe_cell_str_pyobj_to_utf8(
static CYTHON_INLINE __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_cell_str_pyobj_to_utf8(struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, int *__pyx_v_valid_out, struct line_sender_utf8 *__pyx_v_utf8_out) {
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._dataframe_cell_str_pyobj_to_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2013: qdb_pystr_buf* b,
2014: col_cursor_t* cursor,
2015: bint* valid_out,
2016: line_sender_utf8* utf8_out) except -1:
+2017: cdef PyObject** access = <PyObject**>cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_cursor->chunk->buffers[1]));
+2018: cdef PyObject* cell = access[cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_cursor->offset]);
+2019: if PyUnicode_CheckExact(cell):
__pyx_t_1 = PyUnicode_CheckExact(__pyx_v_cell);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+2020: str_to_utf8(b, cell, utf8_out)
__pyx_t_2 = __pyx_f_7questdb_7_client_str_to_utf8(__pyx_v_b, __pyx_v_cell, __pyx_v_utf8_out); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 2020, __pyx_L1_error)
+2021: valid_out[0] = True
(__pyx_v_valid_out[0]) = 1;
+2022: elif _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+2023: valid_out[0] = False
(__pyx_v_valid_out[0]) = 0;
2024: else:
+2025: raise ValueError(
/*else*/ {
__pyx_t_4 = NULL;
2026: 'Expected a string, ' +
+2027: f'got an object of type {_fqn(type(<object>cell))}.')
__pyx_t_5 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyUnicode_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Expected_a_string_got_an_object; __pyx_t_7[1] = __pyx_t_6; __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__2; __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, 41 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 2025, __pyx_L1_error) } __pyx_L3:;
2028:
2029:
+2030: cdef void_int _dataframe_serialize_cell_table__str_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
struct line_sender_table_name __pyx_v_c_table_name;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_table__str_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2031: line_sender_buffer* ls_buf,
2032: qdb_pystr_buf* b,
2033: col_t* col) except -1:
+2034: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2035: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+2036: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
2037: cdef line_sender_table_name c_table_name
+2038: if not PyUnicode_CheckExact(cell):
__pyx_t_1 = (!PyUnicode_CheckExact(__pyx_v_cell));
if (__pyx_t_1) {
/* … */
}
+2039: if _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (unlikely(__pyx_t_1)) {
/* … */
}
+2040: raise ValueError('Expected a table name, got a null value')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Expected_a_table_name_got_a_null};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2040, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 2040, __pyx_L1_error)
2041: else:
+2042: raise ValueError(
/*else*/ {
__pyx_t_3 = NULL;
2043: 'Expected a table name (str object), ' +
+2044: f'got an object of type {_fqn(type(<object>cell))}.')
__pyx_t_5 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyUnicode_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Expected_a_table_name_str_object; __pyx_t_7[1] = __pyx_t_6; __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__2; __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, 58 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2042, __pyx_L1_error) }
+2045: str_to_table_name(b, cell, &c_table_name)
__pyx_t_8 = __pyx_f_7questdb_7_client_str_to_table_name(__pyx_v_b, __pyx_v_cell, (&__pyx_v_c_table_name)); if (unlikely(__pyx_t_8 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 2045, __pyx_L1_error)
+2046: if not line_sender_buffer_table(ls_buf, c_table_name, &err):
__pyx_t_1 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2047: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2047, __pyx_L1_error)
2048:
2049:
+2050: cdef void_int _dataframe_serialize_cell_table__str_utf8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_utf8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
size_t __pyx_v_c_len;
char const *__pyx_v_buf;
struct line_sender_table_name __pyx_v_c_table_name;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_table__str_utf8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2051: line_sender_buffer* ls_buf,
2052: qdb_pystr_buf* b,
2053: col_t* col,
2054: PyThreadState** gs) except -1:
+2055: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2056: cdef size_t c_len
2057: cdef const char* buf
2058: cdef line_sender_table_name c_table_name
+2059: if _dataframe_arrow_str_utf8(&col.cursor, &c_len, &buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8((&__pyx_v_col->cursor), (&__pyx_v_c_len), (&__pyx_v_buf));
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+2060: if not line_sender_table_name_init(&c_table_name, c_len, buf, &err):
__pyx_t_1 = (!line_sender_table_name_init((&__pyx_v_c_table_name), __pyx_v_c_len, __pyx_v_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2061: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2061, __pyx_L1_error)
+2062: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2062, __pyx_L1_error)
+2063: if not line_sender_buffer_table(ls_buf, c_table_name, &err):
__pyx_t_1 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2064: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2064, __pyx_L1_error)
+2065: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2065, __pyx_L1_error)
2066: else:
+2067: _ensure_has_gil(gs)
/*else*/ {
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2067, __pyx_L1_error)
+2068: raise ValueError('Table name cannot be null')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Table_name_cannot_be_null};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2068, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 2068, __pyx_L1_error)
}
__pyx_L3:;
2069:
+2070: cdef void_int _dataframe_serialize_cell_table__str_lrg_utf8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_lrg_utf8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
size_t __pyx_v_c_len;
char const *__pyx_v_buf;
struct line_sender_table_name __pyx_v_c_table_name;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_table__str_lrg_utf8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2071: line_sender_buffer* ls_buf,
2072: qdb_pystr_buf* b,
2073: col_t* col,
2074: PyThreadState** gs) except -1:
+2075: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2076: cdef size_t c_len
2077: cdef const char* buf
2078: cdef line_sender_table_name c_table_name
+2079: if _dataframe_arrow_str_utf8_lrg(&col.cursor, &c_len, &buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8_lrg((&__pyx_v_col->cursor), (&__pyx_v_c_len), (&__pyx_v_buf));
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+2080: if not line_sender_table_name_init(&c_table_name, c_len, buf, &err):
__pyx_t_1 = (!line_sender_table_name_init((&__pyx_v_c_table_name), __pyx_v_c_len, __pyx_v_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2081: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2081, __pyx_L1_error)
+2082: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2082, __pyx_L1_error)
+2083: if not line_sender_buffer_table(ls_buf, c_table_name, &err):
__pyx_t_1 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2084: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2084, __pyx_L1_error)
+2085: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2085, __pyx_L1_error)
2086: else:
+2087: _ensure_has_gil(gs)
/*else*/ {
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2087, __pyx_L1_error)
+2088: raise ValueError('Table name cannot be null')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Table_name_cannot_be_null};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2088, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 2088, __pyx_L1_error)
}
__pyx_L3:;
2089:
2090:
+2091: cdef void_int _dataframe_serialize_cell_table__str_i8_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_i8_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
size_t __pyx_v_c_len;
char const *__pyx_v_c_buf;
struct line_sender_table_name __pyx_v_c_table_name;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_table__str_i8_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2092: line_sender_buffer* ls_buf,
2093: qdb_pystr_buf* b,
2094: col_t* col,
2095: PyThreadState** gs) except -1:
+2096: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2097: cdef size_t c_len
2098: cdef const char* c_buf
2099: cdef line_sender_table_name c_table_name
+2100: if _dataframe_arrow_get_cat_i8(&col.cursor, &c_len, &c_buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i8((&__pyx_v_col->cursor), (&__pyx_v_c_len), (&__pyx_v_c_buf));
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+2101: if not line_sender_table_name_init(&c_table_name, c_len, c_buf, &err):
__pyx_t_1 = (!line_sender_table_name_init((&__pyx_v_c_table_name), __pyx_v_c_len, __pyx_v_c_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2102: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2102, __pyx_L1_error)
+2103: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2103, __pyx_L1_error)
+2104: if not line_sender_buffer_table(ls_buf, c_table_name, &err):
__pyx_t_1 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2105: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2105, __pyx_L1_error)
+2106: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2106, __pyx_L1_error)
2107: else:
+2108: _ensure_has_gil(gs)
/*else*/ {
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2108, __pyx_L1_error)
+2109: raise ValueError('Table name cannot be null')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Table_name_cannot_be_null};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 2109, __pyx_L1_error)
}
__pyx_L3:;
2110:
2111:
+2112: cdef void_int _dataframe_serialize_cell_table__str_i16_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_i16_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
size_t __pyx_v_c_len;
char const *__pyx_v_c_buf;
struct line_sender_table_name __pyx_v_c_table_name;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_table__str_i16_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2113: line_sender_buffer* ls_buf,
2114: qdb_pystr_buf* b,
2115: col_t* col,
2116: PyThreadState** gs) except -1:
+2117: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2118: cdef size_t c_len
2119: cdef const char* c_buf
2120: cdef line_sender_table_name c_table_name
+2121: if _dataframe_arrow_get_cat_i16(&col.cursor, &c_len, &c_buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i16((&__pyx_v_col->cursor), (&__pyx_v_c_len), (&__pyx_v_c_buf));
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+2122: if not line_sender_table_name_init(&c_table_name, c_len, c_buf, &err):
__pyx_t_1 = (!line_sender_table_name_init((&__pyx_v_c_table_name), __pyx_v_c_len, __pyx_v_c_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2123: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2123, __pyx_L1_error)
+2124: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2124, __pyx_L1_error)
+2125: if not line_sender_buffer_table(ls_buf, c_table_name, &err):
__pyx_t_1 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2126: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2126, __pyx_L1_error)
+2127: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2127, __pyx_L1_error)
2128: else:
+2129: _ensure_has_gil(gs)
/*else*/ {
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2129, __pyx_L1_error)
+2130: raise ValueError('Table name cannot be null')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Table_name_cannot_be_null};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 2130, __pyx_L1_error)
}
__pyx_L3:;
2131:
2132:
+2133: cdef void_int _dataframe_serialize_cell_table__str_i32_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_i32_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
size_t __pyx_v_c_len;
char const *__pyx_v_c_buf;
struct line_sender_table_name __pyx_v_c_table_name;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_table__str_i32_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2134: line_sender_buffer* ls_buf,
2135: qdb_pystr_buf* b,
2136: col_t* col,
2137: PyThreadState** gs) except -1:
+2138: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2139: cdef size_t c_len
2140: cdef const char* c_buf
2141: cdef line_sender_table_name c_table_name
+2142: if _dataframe_arrow_get_cat_i32(&col.cursor, &c_len, &c_buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i32((&__pyx_v_col->cursor), (&__pyx_v_c_len), (&__pyx_v_c_buf));
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+2143: if not line_sender_table_name_init(&c_table_name, c_len, c_buf, &err):
__pyx_t_1 = (!line_sender_table_name_init((&__pyx_v_c_table_name), __pyx_v_c_len, __pyx_v_c_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2144: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2144, __pyx_L1_error)
+2145: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2145, __pyx_L1_error)
+2146: if not line_sender_buffer_table(ls_buf, c_table_name, &err):
__pyx_t_1 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2147: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2147, __pyx_L1_error)
+2148: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2148, __pyx_L1_error)
2149: else:
+2150: _ensure_has_gil(gs)
/*else*/ {
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2150, __pyx_L1_error)
+2151: raise ValueError('Table name cannot be null')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Table_name_cannot_be_null};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 2151, __pyx_L1_error)
}
__pyx_L3:;
2152:
2153:
+2154: cdef void_int _dataframe_serialize_cell_symbol__str_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_symbol__str_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2155: line_sender_buffer* ls_buf,
2156: qdb_pystr_buf* b,
2157: col_t* col) except -1:
+2158: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2159: cdef bint valid = False
__pyx_v_valid = 0;
2160: cdef line_sender_utf8 utf8
+2161: _dataframe_cell_str_pyobj_to_utf8(b, &col.cursor, &valid, &utf8)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_cell_str_pyobj_to_utf8(__pyx_v_b, (&__pyx_v_col->cursor), (&__pyx_v_valid), (&__pyx_v_utf8)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 2161, __pyx_L1_error)
+2162: if valid and not line_sender_buffer_symbol(ls_buf, col.name, utf8, &err):
if (__pyx_v_valid) {
} else {
__pyx_t_2 = __pyx_v_valid;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_3 = (!line_sender_buffer_symbol(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
__pyx_t_2 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_2)) {
/* … */
}
+2163: raise c_err_to_py(err)
__pyx_t_4 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 2163, __pyx_L1_error)
2164:
2165:
+2166: cdef void_int _dataframe_serialize_cell_symbol__str_utf8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_utf8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_symbol__str_utf8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2167: line_sender_buffer* ls_buf,
2168: qdb_pystr_buf* b,
2169: col_t* col,
2170: PyThreadState** gs) except -1:
+2171: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2172: cdef line_sender_utf8 utf8
+2173: if _dataframe_arrow_str_utf8(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+2174: if not line_sender_buffer_symbol(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_symbol(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2175: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2175, __pyx_L1_error)
+2176: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2176, __pyx_L1_error)
2177:
+2178: cdef void_int _dataframe_serialize_cell_symbol__str_lrg_utf8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_lrg_utf8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_symbol__str_lrg_utf8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2179: line_sender_buffer* ls_buf,
2180: qdb_pystr_buf* b,
2181: col_t* col,
2182: PyThreadState** gs) except -1:
+2183: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2184: cdef line_sender_utf8 utf8
+2185: if _dataframe_arrow_str_utf8_lrg(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8_lrg((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+2186: if not line_sender_buffer_symbol(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_symbol(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2187: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2187, __pyx_L1_error)
+2188: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2188, __pyx_L1_error)
2189:
2190:
+2191: cdef void_int _dataframe_serialize_cell_symbol__str_i8_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_i8_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_symbol__str_i8_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2192: line_sender_buffer* ls_buf,
2193: qdb_pystr_buf* b,
2194: col_t* col,
2195: PyThreadState** gs) except -1:
+2196: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2197: cdef line_sender_utf8 utf8
+2198: if _dataframe_arrow_get_cat_i8(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i8((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+2199: if not line_sender_buffer_symbol(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_symbol(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2200: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2200, __pyx_L1_error)
+2201: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2201, __pyx_L1_error)
2202:
2203:
+2204: cdef void_int _dataframe_serialize_cell_symbol__str_i16_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_i16_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_symbol__str_i16_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2205: line_sender_buffer* ls_buf,
2206: qdb_pystr_buf* b,
2207: col_t* col,
2208: PyThreadState** gs) except -1:
+2209: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2210: cdef line_sender_utf8 utf8
+2211: if _dataframe_arrow_get_cat_i16(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i16((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+2212: if not line_sender_buffer_symbol(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_symbol(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2213: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2213, __pyx_L1_error)
+2214: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2214, __pyx_L1_error)
2215:
2216:
+2217: cdef void_int _dataframe_serialize_cell_symbol__str_i32_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_i32_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_symbol__str_i32_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2218: line_sender_buffer* ls_buf,
2219: qdb_pystr_buf* b,
2220: col_t* col,
2221: PyThreadState** gs) except -1:
+2222: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2223: cdef line_sender_utf8 utf8
+2224: if _dataframe_arrow_get_cat_i32(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i32((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+2225: if not line_sender_buffer_symbol(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_symbol(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2226: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2226, __pyx_L1_error)
+2227: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2227, __pyx_L1_error)
2228:
2229:
+2230: cdef void_int _dataframe_serialize_cell_column_bool__bool_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_bool__bool_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_bool__bool_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2231: line_sender_buffer* ls_buf,
2232: qdb_pystr_buf* b,
2233: col_t* col) except -1:
+2234: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2235: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+2236: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2237: if PyBool_Check(cell):
__pyx_t_1 = PyBool_Check(__pyx_v_cell);
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+2238: if not line_sender_buffer_column_bool(
__pyx_t_1 = (!line_sender_buffer_column_bool(__pyx_v_ls_buf, __pyx_v_col->name, (__pyx_v_cell == Py_True), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
2239: ls_buf, col.name, cell == Py_True, &err):
+2240: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2240, __pyx_L1_error)
+2241: elif _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (unlikely(__pyx_t_1)) {
/* … */
}
+2242: raise ValueError('Cannot insert null values into a boolean column.')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Cannot_insert_null_values_into_a};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 2242, __pyx_L1_error)
2243: else:
+2244: raise ValueError(
/*else*/ {
__pyx_t_3 = NULL;
+2245: 'Expected an object of type bool, got a ' +
__pyx_t_6 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Expected_an_object_of_type_bool, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2246: _fqn(type(<object>cell)) + '.')
__pyx_t_5 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* … */ __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_6, __pyx_mstate_global->__pyx_kp_u__2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2244, __pyx_L1_error) } __pyx_L3:;
2247:
2248:
+2249: cdef void_int _dataframe_serialize_cell_column_bool__bool_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_bool__bool_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
uint8_t *__pyx_v_access;
uint8_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_bool__bool_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2250: line_sender_buffer* ls_buf,
2251: qdb_pystr_buf* b,
2252: col_t* col,
2253: PyThreadState** gs) except -1:
+2254: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2255: cdef uint8_t* access = <uint8_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint8_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2256: cdef uint8_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2257: if not line_sender_buffer_column_bool(ls_buf, col.name, not not cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_bool(__pyx_v_ls_buf, __pyx_v_col->name, (!(!(__pyx_v_cell != 0))), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2258: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2258, __pyx_L1_error)
+2259: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2259, __pyx_L1_error)
2260:
2261:
+2262: cdef void_int _dataframe_serialize_cell_column_bool__bool_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_bool__bool_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int __pyx_v_value;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_bool__bool_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2263: line_sender_buffer* ls_buf,
2264: qdb_pystr_buf* b,
2265: col_t* col,
2266: PyThreadState** gs) except -1:
+2267: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2268: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2269: cdef bint value
+2270: if valid:
if (likely(__pyx_v_valid)) {
/* … */
goto __pyx_L3;
}
+2271: value = _dataframe_arrow_get_bool(&col.cursor)
__pyx_v_value = __pyx_f_7questdb_7_client__dataframe_arrow_get_bool((&__pyx_v_col->cursor));
+2272: if not line_sender_buffer_column_bool(ls_buf, col.name, value, &err):
__pyx_t_1 = (!line_sender_buffer_column_bool(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_value, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2273: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2273, __pyx_L1_error)
+2274: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2274, __pyx_L1_error)
2275: else:
+2276: _ensure_has_gil(gs)
/*else*/ {
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2276, __pyx_L1_error)
+2277: raise ValueError('Cannot insert null values into a boolean column.')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Cannot_insert_null_values_into_a};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 2277, __pyx_L1_error)
}
__pyx_L3:;
2278:
2279:
+2280: cdef void_int _dataframe_serialize_cell_column_i64__int_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__int_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
int64_t __pyx_v_value;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__int_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2281: line_sender_buffer* ls_buf,
2282: qdb_pystr_buf* b,
2283: col_t* col) except -1:
+2284: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2285: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+2286: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
2287: cdef int64_t value
+2288: if PyLong_CheckExact(cell):
__pyx_t_1 = PyLong_CheckExact(__pyx_v_cell);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+2289: value = PyLong_AsLongLong(cell)
__pyx_t_2 = PyLong_AsLongLong(__pyx_v_cell); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(1, 2289, __pyx_L1_error) __pyx_v_value = __pyx_t_2;
+2290: if not line_sender_buffer_column_i64(ls_buf, col.name, value, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_value, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2291: raise c_err_to_py(err)
__pyx_t_3 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 2291, __pyx_L1_error)
+2292: elif _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (likely(__pyx_t_1)) {
goto __pyx_L3;
}
2293: pass
2294: else:
+2295: raise ValueError(
/*else*/ {
__pyx_t_4 = NULL;
+2296: 'Expected an object of type int, got an object of type ' +
__pyx_t_6 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Expected_an_object_of_type_int_g, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2297: _fqn(type(<object>cell)) + '.')
__pyx_t_5 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* … */ __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_6, __pyx_mstate_global->__pyx_kp_u__2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 2295, __pyx_L1_error) } __pyx_L3:;
2298:
2299:
+2300: cdef void_int _dataframe_serialize_cell_column_i64__u8_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u8_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
uint8_t *__pyx_v_access;
uint8_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u8_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2301: line_sender_buffer* ls_buf,
2302: qdb_pystr_buf* b,
2303: col_t* col,
2304: PyThreadState** gs) except -1:
+2305: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2306: cdef uint8_t* access = <uint8_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint8_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2307: cdef uint8_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2308: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2309: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2309, __pyx_L1_error)
+2310: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2310, __pyx_L1_error)
2311:
2312:
+2313: cdef void_int _dataframe_serialize_cell_column_i64__i8_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i8_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int8_t *__pyx_v_access;
int8_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i8_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2314: line_sender_buffer* ls_buf,
2315: qdb_pystr_buf* b,
2316: col_t* col,
2317: PyThreadState** gs) except -1:
+2318: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2319: cdef int8_t* access = <int8_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int8_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2320: cdef int8_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2321: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2322: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2322, __pyx_L1_error)
+2323: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2323, __pyx_L1_error)
2324:
2325:
+2326: cdef void_int _dataframe_serialize_cell_column_i64__u16_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u16_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
uint16_t *__pyx_v_access;
uint16_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u16_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2327: line_sender_buffer* ls_buf,
2328: qdb_pystr_buf* b,
2329: col_t* col,
2330: PyThreadState** gs) except -1:
+2331: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2332: cdef uint16_t* access = <uint16_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint16_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2333: cdef uint16_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2334: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2335: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2335, __pyx_L1_error)
+2336: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2336, __pyx_L1_error)
2337:
2338:
+2339: cdef void_int _dataframe_serialize_cell_column_i64__i16_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i16_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int16_t *__pyx_v_access;
int16_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i16_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2340: line_sender_buffer* ls_buf,
2341: qdb_pystr_buf* b,
2342: col_t* col,
2343: PyThreadState** gs) except -1:
+2344: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2345: cdef int16_t* access = <int16_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int16_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2346: cdef int16_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2347: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2348: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2348, __pyx_L1_error)
+2349: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2349, __pyx_L1_error)
2350:
2351:
+2352: cdef void_int _dataframe_serialize_cell_column_i64__u32_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u32_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
uint32_t *__pyx_v_access;
uint32_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u32_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2353: line_sender_buffer* ls_buf,
2354: qdb_pystr_buf* b,
2355: col_t* col,
2356: PyThreadState** gs) except -1:
+2357: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2358: cdef uint32_t* access = <uint32_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint32_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2359: cdef uint32_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2360: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2361: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2361, __pyx_L1_error)
+2362: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2362, __pyx_L1_error)
2363:
2364:
+2365: cdef void_int _dataframe_serialize_cell_column_i64__i32_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i32_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int32_t *__pyx_v_access;
int32_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i32_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2366: line_sender_buffer* ls_buf,
2367: qdb_pystr_buf* b,
2368: col_t* col,
2369: PyThreadState** gs) except -1:
+2370: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2371: cdef int32_t* access = <int32_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int32_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2372: cdef int32_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2373: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2374: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2374, __pyx_L1_error)
+2375: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2375, __pyx_L1_error)
2376:
2377:
+2378: cdef void_int _dataframe_serialize_cell_column_i64__u64_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u64_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
uint64_t *__pyx_v_access;
uint64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u64_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2379: line_sender_buffer* ls_buf,
2380: qdb_pystr_buf* b,
2381: col_t* col,
2382: PyThreadState** gs) except -1:
+2383: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2384: cdef uint64_t* access = <uint64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2385: cdef uint64_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2386: if cell > <uint64_t>INT64_MAX:
__pyx_t_1 = (__pyx_v_cell > ((uint64_t)INT64_MAX));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2387: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2387, __pyx_L1_error)
+2388: raise OverflowError('uint64 value too large for int64 column type.')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_uint64_value_too_large_for_int64};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 2388, __pyx_L1_error)
+2389: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2390: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2390, __pyx_L1_error)
+2391: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2391, __pyx_L1_error)
2392:
2393:
+2394: cdef void_int _dataframe_serialize_cell_column_i64__i64_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i64_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i64_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2395: line_sender_buffer* ls_buf,
2396: qdb_pystr_buf* b,
2397: col_t* col,
2398: PyThreadState** gs) except -1:
+2399: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2400: cdef int64_t* access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2401: cdef int64_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2402: if not line_sender_buffer_column_i64(ls_buf, col.name, cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2403: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2403, __pyx_L1_error)
+2404: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2404, __pyx_L1_error)
2405:
2406:
+2407: cdef void_int _dataframe_serialize_cell_column_i64__u8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint8_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2408: line_sender_buffer* ls_buf,
2409: qdb_pystr_buf* b,
2410: col_t* col,
2411: PyThreadState** gs) except -1:
+2412: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2413: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2414: cdef uint8_t* access
+2415: if valid:
if (__pyx_v_valid) {
/* … */
}
+2416: access = <uint8_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint8_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2417: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
2418: ls_buf,
2419: col.name,
2420: <int64_t>access[col.cursor.offset],
2421: &err):
+2422: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2422, __pyx_L1_error)
+2423: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2423, __pyx_L1_error)
2424:
2425:
+2426: cdef void_int _dataframe_serialize_cell_column_i64__i8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int8_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2427: line_sender_buffer* ls_buf,
2428: qdb_pystr_buf* b,
2429: col_t* col,
2430: PyThreadState** gs) except -1:
+2431: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2432: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2433: cdef int8_t* access
+2434: if valid:
if (__pyx_v_valid) {
/* … */
}
+2435: access = <int8_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int8_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2436: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
2437: ls_buf,
2438: col.name,
2439: <int64_t>access[col.cursor.offset],
2440: &err):
+2441: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2441, __pyx_L1_error)
+2442: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2442, __pyx_L1_error)
2443:
2444:
+2445: cdef void_int _dataframe_serialize_cell_column_i64__u16_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u16_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint16_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u16_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2446: line_sender_buffer* ls_buf,
2447: qdb_pystr_buf* b,
2448: col_t* col,
2449: PyThreadState** gs) except -1:
+2450: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2451: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2452: cdef uint16_t* access
+2453: if valid:
if (__pyx_v_valid) {
/* … */
}
+2454: access = <uint16_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint16_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2455: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
2456: ls_buf,
2457: col.name,
2458: <int64_t>access[col.cursor.offset],
2459: &err):
+2460: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2460, __pyx_L1_error)
+2461: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2461, __pyx_L1_error)
2462:
2463:
+2464: cdef void_int _dataframe_serialize_cell_column_i64__i16_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i16_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int16_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i16_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2465: line_sender_buffer* ls_buf,
2466: qdb_pystr_buf* b,
2467: col_t* col,
2468: PyThreadState** gs) except -1:
+2469: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2470: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2471: cdef int16_t* access
+2472: if valid:
if (__pyx_v_valid) {
/* … */
}
+2473: access = <int16_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int16_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2474: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
2475: ls_buf,
2476: col.name,
2477: <int64_t>access[col.cursor.offset],
2478: &err):
+2479: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2479, __pyx_L1_error)
+2480: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2480, __pyx_L1_error)
2481:
2482:
+2483: cdef void_int _dataframe_serialize_cell_column_i64__u32_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u32_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint32_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u32_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2484: line_sender_buffer* ls_buf,
2485: qdb_pystr_buf* b,
2486: col_t* col,
2487: PyThreadState** gs) except -1:
+2488: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2489: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2490: cdef uint32_t* access
+2491: if valid:
if (__pyx_v_valid) {
/* … */
}
+2492: access = <uint32_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint32_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2493: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
2494: ls_buf,
2495: col.name,
2496: <int64_t>access[col.cursor.offset],
2497: &err):
+2498: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2498, __pyx_L1_error)
+2499: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2499, __pyx_L1_error)
2500:
2501:
+2502: cdef void_int _dataframe_serialize_cell_column_i64__i32_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i32_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int32_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i32_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2503: line_sender_buffer* ls_buf,
2504: qdb_pystr_buf* b,
2505: col_t* col,
2506: PyThreadState** gs) except -1:
+2507: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2508: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2509: cdef int32_t* access
+2510: if valid:
if (__pyx_v_valid) {
/* … */
}
+2511: access = <int32_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int32_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2512: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
2513: ls_buf,
2514: col.name,
2515: <int64_t>access[col.cursor.offset],
2516: &err):
+2517: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2517, __pyx_L1_error)
+2518: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2518, __pyx_L1_error)
2519:
2520:
+2521: cdef void_int _dataframe_serialize_cell_column_i64__u64_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u64_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint64_t *__pyx_v_access;
uint64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u64_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2522: line_sender_buffer* ls_buf,
2523: qdb_pystr_buf* b,
2524: col_t* col,
2525: PyThreadState** gs) except -1:
+2526: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2527: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2528: cdef uint64_t* access
2529: cdef uint64_t cell
+2530: if valid:
if (__pyx_v_valid) {
/* … */
}
+2531: access = <uint64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2532: cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2533: if cell > <uint64_t>INT64_MAX:
__pyx_t_1 = (__pyx_v_cell > ((uint64_t)INT64_MAX));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2534: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2534, __pyx_L1_error)
+2535: raise OverflowError('uint64 value too large for int64 column type.')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_uint64_value_too_large_for_int64};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 2535, __pyx_L1_error)
+2536: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
2537: ls_buf,
2538: col.name,
2539: <int64_t>cell,
2540: &err):
+2541: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2541, __pyx_L1_error)
+2542: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2542, __pyx_L1_error)
2543:
2544:
+2545: cdef void_int _dataframe_serialize_cell_column_i64__i64_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i64_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int64_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i64_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2546: line_sender_buffer* ls_buf,
2547: qdb_pystr_buf* b,
2548: col_t* col,
2549: PyThreadState** gs) except -1:
+2550: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2551: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2552: cdef int64_t* access
+2553: if valid:
if (__pyx_v_valid) {
/* … */
}
+2554: access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2555: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, (__pyx_v_access[__pyx_v_col->cursor.offset]), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
2556: ls_buf,
2557: col.name,
2558: access[col.cursor.offset],
2559: &err):
+2560: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2560, __pyx_L1_error)
+2561: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2561, __pyx_L1_error)
2562:
2563:
+2564: cdef void_int _dataframe_serialize_cell_column_f64__float_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__float_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
double __pyx_v_value;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_f64__float_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2565: line_sender_buffer* ls_buf,
2566: qdb_pystr_buf* b,
2567: col_t* col) except -1:
+2568: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2569: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+2570: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
2571: cdef double value
+2572: if PyFloat_CheckExact(cell):
__pyx_t_1 = PyFloat_CheckExact(__pyx_v_cell);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+2573: value = PyFloat_AS_DOUBLE(cell)
__pyx_v_value = PyFloat_AS_DOUBLE(__pyx_v_cell);
+2574: if not line_sender_buffer_column_f64(ls_buf, col.name, value, &err):
__pyx_t_1 = (!line_sender_buffer_column_f64(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_value, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2575: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2575, __pyx_L1_error)
+2576: elif _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (likely(__pyx_t_1)) {
goto __pyx_L3;
}
2577: pass
2578: else:
+2579: raise ValueError(
/*else*/ {
__pyx_t_3 = NULL;
+2580: 'Expected an object of type float, got an object of type ' +
__pyx_t_5 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Expected_an_object_of_type_float, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+2581: _fqn(type(<object>cell)) + '.')
__pyx_t_4 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* … */ __pyx_t_4 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_5, __pyx_mstate_global->__pyx_kp_u__2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2579, __pyx_L1_error) } __pyx_L3:;
2582:
2583:
+2584: cdef void_int _dataframe_serialize_cell_column_f64__f32_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f32_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
float *__pyx_v_access;
float __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_f64__f32_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2585: line_sender_buffer* ls_buf,
2586: qdb_pystr_buf* b,
2587: col_t* col,
2588: PyThreadState** gs) except -1:
+2589: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2590: # Note: This is the C `float` type, not the Python `float` type.
+2591: cdef float* access = <float*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((float *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2592: cdef float cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2593: if not line_sender_buffer_column_f64(ls_buf, col.name, <double>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_f64(__pyx_v_ls_buf, __pyx_v_col->name, ((double)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2594: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2594, __pyx_L1_error)
+2595: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2595, __pyx_L1_error)
2596:
2597:
+2598: cdef void_int _dataframe_serialize_cell_column_f64__f64_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f64_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
double *__pyx_v_access;
double __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_f64__f64_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2599: line_sender_buffer* ls_buf,
2600: qdb_pystr_buf* b,
2601: col_t* col,
2602: PyThreadState** gs) except -1:
+2603: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2604: cdef double* access = <double*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((double *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2605: cdef double cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2606: if not line_sender_buffer_column_f64(ls_buf, col.name, cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_f64(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2607: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2607, __pyx_L1_error)
+2608: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2608, __pyx_L1_error)
2609:
2610:
+2611: cdef void_int _dataframe_serialize_cell_column_f64__f32_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f32_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
float *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_f64__f32_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2612: line_sender_buffer* ls_buf,
2613: qdb_pystr_buf* b,
2614: col_t* col,
2615: PyThreadState** gs) except -1:
+2616: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2617: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2618: cdef float* access
+2619: if valid:
if (__pyx_v_valid) {
/* … */
}
+2620: access = <float*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((float *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2621: if not line_sender_buffer_column_f64(
__pyx_t_1 = (!line_sender_buffer_column_f64(__pyx_v_ls_buf, __pyx_v_col->name, ((double)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
2622: ls_buf,
2623: col.name,
2624: <double>access[col.cursor.offset],
2625: &err):
+2626: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2626, __pyx_L1_error)
+2627: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2627, __pyx_L1_error)
2628:
2629:
+2630: cdef void_int _dataframe_serialize_cell_column_f64__f64_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f64_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
double *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_f64__f64_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2631: line_sender_buffer* ls_buf,
2632: qdb_pystr_buf* b,
2633: col_t* col,
2634: PyThreadState** gs) except -1:
+2635: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2636: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2637: cdef double* access
+2638: if valid:
if (__pyx_v_valid) {
/* … */
}
+2639: access = <double*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((double *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2640: if not line_sender_buffer_column_f64(
__pyx_t_1 = (!line_sender_buffer_column_f64(__pyx_v_ls_buf, __pyx_v_col->name, (__pyx_v_access[__pyx_v_col->cursor.offset]), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
2641: ls_buf,
2642: col.name,
2643: access[col.cursor.offset],
2644: &err):
+2645: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2645, __pyx_L1_error)
+2646: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2646, __pyx_L1_error)
2647:
2648:
+2649: cdef void_int _dataframe_serialize_cell_column_str__str_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_str__str_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2650: line_sender_buffer* ls_buf,
2651: qdb_pystr_buf* b,
2652: col_t* col) except -1:
+2653: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2654: cdef bint valid = False
__pyx_v_valid = 0;
2655: cdef line_sender_utf8 utf8
+2656: _dataframe_cell_str_pyobj_to_utf8(b, &col.cursor, &valid, &utf8)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_cell_str_pyobj_to_utf8(__pyx_v_b, (&__pyx_v_col->cursor), (&__pyx_v_valid), (&__pyx_v_utf8)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 2656, __pyx_L1_error)
+2657: if valid and not line_sender_buffer_column_str(
if (__pyx_v_valid) {
} else {
__pyx_t_2 = __pyx_v_valid;
goto __pyx_L4_bool_binop_done;
}
/* … */
__pyx_t_3 = (!line_sender_buffer_column_str(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
__pyx_t_2 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
/* … */
if (unlikely(__pyx_t_2)) {
/* … */
}
2658: ls_buf, col.name, utf8, &err):
+2659: raise c_err_to_py(err)
__pyx_t_4 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 2659, __pyx_L1_error)
2660:
2661:
+2662: cdef void_int _dataframe_serialize_cell_column_str__str_utf8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_utf8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_str__str_utf8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2663: line_sender_buffer* ls_buf,
2664: qdb_pystr_buf* b,
2665: col_t* col,
2666: PyThreadState** gs) except -1:
+2667: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2668: cdef line_sender_utf8 utf8
+2669: if _dataframe_arrow_str_utf8(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+2670: if not line_sender_buffer_column_str(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_column_str(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2671: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2671, __pyx_L1_error)
+2672: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2672, __pyx_L1_error)
2673:
+2674: cdef void_int _dataframe_serialize_cell_column_str__str_lrg_utf8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_lrg_utf8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_str__str_lrg_utf8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2675: line_sender_buffer* ls_buf,
2676: qdb_pystr_buf* b,
2677: col_t* col,
2678: PyThreadState** gs) except -1:
+2679: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2680: cdef line_sender_utf8 utf8
+2681: if _dataframe_arrow_str_utf8_lrg(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8_lrg((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+2682: if not line_sender_buffer_column_str(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_column_str(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2683: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2683, __pyx_L1_error)
+2684: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2684, __pyx_L1_error)
2685:
2686:
+2687: cdef void_int _dataframe_serialize_cell_column_str__str_i8_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_i8_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_str__str_i8_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2688: line_sender_buffer* ls_buf,
2689: qdb_pystr_buf* b,
2690: col_t* col,
2691: PyThreadState** gs) except -1:
+2692: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2693: cdef line_sender_utf8 utf8
+2694: if _dataframe_arrow_get_cat_i8(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i8((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+2695: if not line_sender_buffer_column_str(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_column_str(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2696: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2696, __pyx_L1_error)
+2697: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2697, __pyx_L1_error)
2698:
2699:
+2700: cdef void_int _dataframe_serialize_cell_column_str__str_i16_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_i16_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_str__str_i16_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2701: line_sender_buffer* ls_buf,
2702: qdb_pystr_buf* b,
2703: col_t* col,
2704: PyThreadState** gs) except -1:
+2705: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2706: cdef line_sender_utf8 utf8
+2707: if _dataframe_arrow_get_cat_i16(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i16((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+2708: if not line_sender_buffer_column_str(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_column_str(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2709: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2709, __pyx_L1_error)
+2710: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2710, __pyx_L1_error)
2711:
2712:
+2713: cdef void_int _dataframe_serialize_cell_column_str__str_i32_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_i32_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_str__str_i32_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2714: line_sender_buffer* ls_buf,
2715: qdb_pystr_buf* b,
2716: col_t* col,
2717: PyThreadState** gs) except -1:
+2718: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
2719: cdef line_sender_utf8 utf8
+2720: if _dataframe_arrow_get_cat_i32(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i32((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+2721: if not line_sender_buffer_column_str(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_column_str(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2722: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2722, __pyx_L1_error)
+2723: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2723, __pyx_L1_error)
2724:
2725:
+2726: cdef void_int _dataframe_serialize_cell_column_ts__dt64ns_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64ns_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_ts__dt64ns_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2727: line_sender_buffer* ls_buf,
2728: qdb_pystr_buf* b,
2729: col_t* col,
2730: PyThreadState** gs) except -1:
+2731: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2732: cdef int64_t* access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2733: cdef int64_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2734: if cell != _NAT:
__pyx_t_1 = (__pyx_v_cell != __pyx_v_7questdb_7_client__NAT);
if (__pyx_t_1) {
/* … */
}
+2735: if not line_sender_buffer_column_ts_nanos(ls_buf, col.name, cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_ts_nanos(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2736: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2736, __pyx_L1_error)
+2737: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2737, __pyx_L1_error)
2738:
2739:
+2740: cdef void_int _dataframe_serialize_cell_column_ts__dt64us_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64us_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_ts__dt64us_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2741: line_sender_buffer* ls_buf,
2742: qdb_pystr_buf* b,
2743: col_t* col,
2744: PyThreadState** gs) except -1:
+2745: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2746: cdef int64_t* access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2747: cdef int64_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2748: if cell != _NAT:
__pyx_t_1 = (__pyx_v_cell != __pyx_v_7questdb_7_client__NAT);
if (__pyx_t_1) {
/* … */
}
+2749: if not line_sender_buffer_column_ts_micros(ls_buf, col.name, cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_ts_micros(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2750: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2750, __pyx_L1_error)
+2751: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2751, __pyx_L1_error)
2752:
2753:
+2754: cdef void_int _dataframe_serialize_cell_column_ts__datetime_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__datetime_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
PyObject *__pyx_v_dt = 0;
PyObject *__pyx_v_delta = 0;
int64_t __pyx_v_micros;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_ts__datetime_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dt);
__Pyx_XDECREF(__pyx_v_delta);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2755: line_sender_buffer* ls_buf,
2756: qdb_pystr_buf* b,
2757: col_t* col) except -1:
+2758: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2759: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+2760: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
2761: cdef object dt
2762: cdef object delta
2763: cdef int64_t micros
+2764: if _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (__pyx_t_1) {
/* … */
}
+2765: return 0
__pyx_r = 0;
goto __pyx_L0;
+2766: if not isinstance(<object>cell, cp_datetime):
__pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_cell), __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_datetime);
__pyx_t_2 = (!__pyx_t_1);
if (unlikely(__pyx_t_2)) {
/* … */
}
+2767: raise ValueError(
__pyx_t_4 = NULL;
+2768: 'Expected an object of type datetime, got an object of type ' +
__pyx_t_6 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Expected_an_object_of_type_datet, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2769: _fqn(type(<object>cell)) + '.')
__pyx_t_5 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* … */ __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_6, __pyx_mstate_global->__pyx_kp_u__2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 2767, __pyx_L1_error)
+2770: dt = <object>cell
__pyx_t_3 = ((PyObject *)__pyx_v_cell);
__Pyx_INCREF(__pyx_t_3);
__pyx_v_dt = __pyx_t_3;
__pyx_t_3 = 0;
+2771: if dt.tzinfo is None:
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_mstate_global->__pyx_n_u_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__pyx_t_3 == Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* … */ goto __pyx_L5; }
2772: micros = (
+2773: _days_from_civil(
__pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_f_7questdb_7_client__days_from_civil(PyDateTime_GET_YEAR(__pyx_v_dt), PyDateTime_GET_MONTH(__pyx_v_dt), PyDateTime_GET_DAY(__pyx_v_dt))); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3);
2774: PyDateTime_GET_YEAR(dt),
2775: PyDateTime_GET_MONTH(dt),
+2776: PyDateTime_GET_DAY(dt)) * 86_400_000_000
__pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_mstate_global->__pyx_int_86400000000); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+2777: + <int64_t>PyDateTime_DATE_GET_HOUR(dt) * 3_600_000_000
__pyx_t_3 = __Pyx_PyLong_From_int64_t(((int64_t)PyDateTime_DATE_GET_HOUR(__pyx_v_dt))); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_mstate_global->__pyx_int_3600000000); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+2778: + <int64_t>PyDateTime_DATE_GET_MINUTE(dt) * 60_000_000
__pyx_t_4 = __Pyx_PyLong_From_int64_t((((int64_t)PyDateTime_DATE_GET_MINUTE(__pyx_v_dt)) * 0x3938700)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+2779: + <int64_t>PyDateTime_DATE_GET_SECOND(dt) * 1_000_000
__pyx_t_4 = __Pyx_PyLong_From_int64_t((((int64_t)PyDateTime_DATE_GET_SECOND(__pyx_v_dt)) * 0xF4240)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+2780: + <int64_t>PyDateTime_DATE_GET_MICROSECOND(dt))
__pyx_t_4 = __Pyx_PyLong_From_int64_t(((int64_t)PyDateTime_DATE_GET_MICROSECOND(__pyx_v_dt))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __Pyx_PyLong_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 2780, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_micros = __pyx_t_8;
2781: else:
+2782: delta = dt - _EPOCH_AWARE_UTC
/*else*/ {
__pyx_t_5 = PyNumber_Subtract(__pyx_v_dt, __pyx_v_7questdb_7_client__EPOCH_AWARE_UTC); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2782, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_v_delta = __pyx_t_5;
__pyx_t_5 = 0;
+2783: micros = <int64_t>(
__pyx_v_micros = ((int64_t)__pyx_t_8); } __pyx_L5:;
+2784: delta.days * 86_400_000_000
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_mstate_global->__pyx_n_u_days); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_mstate_global->__pyx_int_86400000000); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2785: + delta.seconds * 1_000_000
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_mstate_global->__pyx_n_u_seconds); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyLong_MultiplyObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+2786: + delta.microseconds)
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_mstate_global->__pyx_n_u_microseconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyLong_As_int64_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 2786, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+2787: if not line_sender_buffer_column_ts_micros(ls_buf, col.name, micros, &err):
__pyx_t_2 = (!line_sender_buffer_column_ts_micros(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_micros, (&__pyx_v_err)));
if (unlikely(__pyx_t_2)) {
/* … */
}
+2788: raise c_err_to_py(err)
__pyx_t_4 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 2788, __pyx_L1_error)
+2789: return 0
__pyx_r = 0; goto __pyx_L0;
2790:
2791:
+2792: cdef void_int _dataframe_serialize_cell_column_arr_f64__arr_f64_numpyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_arr_f64__arr_f64_numpyobj(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
PyArrayObject *__pyx_v_arr;
npy_int __pyx_v_arr_type;
PyArray_Descr *__pyx_v_arr_descr = 0;
size_t __pyx_v_rank;
double const *__pyx_v_data_ptr;
struct line_sender_error *__pyx_v_err;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_arr_f64__arr_f64_numpyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_arr_descr);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2793: line_sender_buffer* ls_buf,
2794: qdb_pystr_buf* b,
2795: col_t* col) except -1:
+2796: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+2797: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
2798: cdef PyArrayObject* arr
2799: cdef npy_int arr_type
2800: cdef cnp.dtype arr_descr
+2801: if _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (__pyx_t_1) {
/* … */
}
+2802: return 0
__pyx_r = 0;
goto __pyx_L0;
+2803: if not PyArray_CheckExact(cell):
__pyx_t_1 = (!PyArray_CheckExact(__pyx_v_cell));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2804: raise ValueError(
__pyx_t_3 = NULL;
+2805: 'Expected an object of type numpy.ndarray, got an object of type ' +
__pyx_t_5 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Expected_an_object_of_type_numpy, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+2806: _fqn(type(<object>cell)) + '.')
__pyx_t_4 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* … */ __pyx_t_4 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_5, __pyx_mstate_global->__pyx_kp_u__2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2804, __pyx_L1_error)
+2807: arr = <PyArrayObject*>cell
__pyx_v_arr = ((PyArrayObject *)__pyx_v_cell);
+2808: arr_type = PyArray_TYPE(arr)
__pyx_v_arr_type = PyArray_TYPE(__pyx_v_arr);
+2809: if arr_type != NPY_DOUBLE:
__pyx_t_1 = (__pyx_v_arr_type != NPY_DOUBLE);
if (unlikely(__pyx_t_1)) {
/* … */
}
+2810: arr_descr = cnp.PyArray_DescrFromType(arr_type)
__pyx_t_2 = ((PyObject *)PyArray_DescrFromType(__pyx_v_arr_type)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_arr_descr = ((PyArray_Descr *)__pyx_t_2); __pyx_t_2 = 0;
+2811: raise QuestDBError(
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2811, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
+2812: QuestDBErrorCode.ArrayError,
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ArrayError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2813: f'Only float64 numpy arrays are supported, got dtype: {arr_descr}')
__pyx_t_5 = __Pyx_PyObject_FormatSimple(((PyObject *)__pyx_v_arr_descr), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Only_float64_numpy_arrays_are_su, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 2813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2811, __pyx_L1_error)
2814: cdef:
+2815: size_t rank = PyArray_NDIM(arr)
__pyx_v_rank = PyArray_NDIM(__pyx_v_arr);
+2816: const double* data_ptr = <const double *> PyArray_DATA(arr)
__pyx_v_data_ptr = ((double const *)PyArray_DATA(__pyx_v_arr));
+2817: line_sender_error * err = NULL
__pyx_v_err = NULL;
2818:
+2819: if PyArray_FLAGS(arr) & NPY_ARRAY_C_CONTIGUOUS != 0:
__pyx_t_1 = ((PyArray_FLAGS(__pyx_v_arr) & NPY_ARRAY_C_CONTIGUOUS) != 0);
if (__pyx_t_1) {
/* … */
goto __pyx_L6;
}
+2820: if not line_sender_buffer_column_f64_arr_c_major(
__pyx_t_1 = (!line_sender_buffer_column_f64_arr_c_major(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_rank, ((size_t const *)PyArray_DIMS(__pyx_v_arr)), __pyx_v_data_ptr, PyArray_SIZE(__pyx_v_arr), (&__pyx_v_err))); if (unlikely(__pyx_t_1)) { /* … */ }
2821: ls_buf,
2822: col.name,
2823: rank,
2824: <const size_t *> PyArray_DIMS(arr),
2825: data_ptr,
2826: PyArray_SIZE(arr),
2827: &err):
+2828: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2828, __pyx_L1_error)
2829: else:
+2830: if not line_sender_buffer_column_f64_arr_byte_strides(
/*else*/ {
/* … */
__pyx_t_1 = (!line_sender_buffer_column_f64_arr_byte_strides(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_rank, ((size_t const *)PyArray_DIMS(__pyx_v_arr)), ((Py_ssize_t const *)PyArray_STRIDES(__pyx_v_arr)), __pyx_v_data_ptr, PyArray_SIZE(__pyx_v_arr), (&__pyx_v_err)));
/* … */
if (unlikely(__pyx_t_1)) {
/* … */
}
}
__pyx_L6:;
2831: ls_buf,
2832: col.name,
2833: rank,
2834: <const size_t*> PyArray_DIMS(arr),
2835: <const ssize_t*> PyArray_STRIDES(arr), # N.B.: Strides expressed as byte jumps
2836: data_ptr,
2837: PyArray_SIZE(arr),
2838: &err):
+2839: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2839, __pyx_L1_error)
2840:
+2841: cdef void_int serialize_decimal_py_obj(line_sender_buffer *buf, line_sender_column_name c_name, PyObject* value) except -1:
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client_serialize_decimal_py_obj(struct line_sender_buffer *__pyx_v_buf, struct line_sender_column_name __pyx_v_c_name, PyObject *__pyx_v_value) {
struct line_sender_error *__pyx_v_err;
unsigned int __pyx_v_scale;
uint8_t __pyx_v_unscaled[32];
int __pyx_v_unscaled_length;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client.serialize_decimal_py_obj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+2842: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2843: cdef unsigned int scale = 0
__pyx_v_scale = 0;
2844: cdef uint8_t[32] unscaled
2845: cdef int unscaled_length
2846:
+2847: if not isinstance(<object>value, Decimal):
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Decimal); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(((PyObject *)__pyx_v_value), __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 2847, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (unlikely(__pyx_t_3)) { /* … */ }
+2848: raise ValueError(
__pyx_t_4 = NULL;
+2849: 'Expected an object of type Decimal, got an object of type ' +
__pyx_t_6 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Expected_an_object_of_type_Decim, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2850: _fqn(type(<object>value)) + '.')
__pyx_t_5 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_value))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* … */ __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_6, __pyx_mstate_global->__pyx_kp_u__2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 2848, __pyx_L1_error)
2851:
+2852: unscaled_length = decimal_pyobj_to_binary(
__pyx_t_8 = __pyx_f_7questdb_16mpdecimal_compat_decimal_pyobj_to_binary(__pyx_v_value, __pyx_v_unscaled, (&__pyx_v_scale), __pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 2852, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_unscaled_length = __pyx_t_8;
2853: value,
2854: unscaled,
2855: &scale,
+2856: QuestDBError,
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1);
+2857: QuestDBErrorCode.BadDataFrame)
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2858: if unscaled_length == 0:
__pyx_t_3 = (__pyx_v_unscaled_length == 0);
if (__pyx_t_3) {
/* … */
}
+2859: return 0
__pyx_r = 0;
goto __pyx_L0;
2860:
+2861: if not line_sender_buffer_column_dec(buf, c_name, scale, unscaled, <size_t>unscaled_length, &err):
__pyx_t_3 = (!line_sender_buffer_column_dec(__pyx_v_buf, __pyx_v_c_name, __pyx_v_scale, __pyx_v_unscaled, ((size_t)__pyx_v_unscaled_length), (&__pyx_v_err)));
if (unlikely(__pyx_t_3)) {
/* … */
}
+2862: raise c_err_to_py(err)
__pyx_t_4 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 2862, __pyx_L1_error)
2863:
+2864: return 0
__pyx_r = 0; goto __pyx_L0;
2865:
2866:
+2867: cdef void_int _dataframe_serialize_cell_column_decimal__decimal_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_decimal__decimal_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
2868: line_sender_buffer* ls_buf,
2869: qdb_pystr_buf* b,
2870: col_t* col) except -1:
+2871: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+2872: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
2873:
+2874: if _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (__pyx_t_1) {
/* … */
}
+2875: return 0
__pyx_r = 0;
goto __pyx_L0;
2876:
+2877: return serialize_decimal_py_obj(ls_buf, col.name, cell)
__pyx_t_2 = __pyx_f_7questdb_7_client_serialize_decimal_py_obj(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 2877, __pyx_L1_error)
__pyx_r = __pyx_t_2;
goto __pyx_L0;
2878:
2879:
+2880: cdef void_int _dataframe_serialize_cell_column_decimal__decimal32_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal32_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint32_t __pyx_v_value;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_decimal__decimal32_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2881: line_sender_buffer* ls_buf,
2882: qdb_pystr_buf* b,
2883: col_t* col,
2884: PyThreadState** gs) except -1:
+2885: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2886: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2887: cdef uint32_t value
+2888: if valid:
if (__pyx_v_valid) {
/* … */
}
+2889: value = bswap32((<uint32_t*>col.cursor.chunk.buffers[1])[col.cursor.offset])
__pyx_v_value = __pyx_f_7questdb_7_client_bswap32((((uint32_t *)(__pyx_v_col->cursor.chunk->buffers[1]))[__pyx_v_col->cursor.offset]));
+2890: if not line_sender_buffer_column_dec(ls_buf, col.name, col.scale, <uint8_t *> &value, sizeof(value), &err):
__pyx_t_1 = (!line_sender_buffer_column_dec(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_col->scale, ((uint8_t *)(&__pyx_v_value)), (sizeof(__pyx_v_value)), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2891: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2891, __pyx_L1_error)
+2892: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2892, __pyx_L1_error)
2893:
+2894: cdef void_int _dataframe_serialize_cell_column_decimal__decimal64_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal64_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint64_t __pyx_v_value;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_decimal__decimal64_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2895: line_sender_buffer* ls_buf,
2896: qdb_pystr_buf* b,
2897: col_t* col,
2898: PyThreadState** gs) except -1:
+2899: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2900: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2901: cdef uint64_t value
+2902: if valid:
if (__pyx_v_valid) {
/* … */
}
+2903: value = bswap64((<uint64_t*>col.cursor.chunk.buffers[1])[col.cursor.offset])
__pyx_v_value = __pyx_f_7questdb_7_client_bswap64((((uint64_t *)(__pyx_v_col->cursor.chunk->buffers[1]))[__pyx_v_col->cursor.offset]));
+2904: if not line_sender_buffer_column_dec(ls_buf, col.name, col.scale, <uint8_t *> &value, sizeof(value), &err):
__pyx_t_1 = (!line_sender_buffer_column_dec(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_col->scale, ((uint8_t *)(&__pyx_v_value)), (sizeof(__pyx_v_value)), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2905: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2905, __pyx_L1_error)
+2906: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2906, __pyx_L1_error)
2907:
+2908: cdef void_int _dataframe_serialize_cell_column_decimal__decimal128_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal128_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint64_t *__pyx_v_cell;
uint64_t __pyx_v_value[2];
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_decimal__decimal128_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2909: line_sender_buffer* ls_buf,
2910: qdb_pystr_buf* b,
2911: col_t* col,
2912: PyThreadState** gs) except -1:
+2913: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2914: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2915: cdef uint64_t *cell
2916: cdef uint64_t[2] value
+2917: if valid:
if (__pyx_v_valid) {
/* … */
}
+2918: cell = &(<uint64_t*>col.cursor.chunk.buffers[1])[col.cursor.offset << 1]
__pyx_v_cell = (&(((uint64_t *)(__pyx_v_col->cursor.chunk->buffers[1]))[(__pyx_v_col->cursor.offset << 1)]));
+2919: value[0] = bswap64(cell[1])
(__pyx_v_value[0]) = __pyx_f_7questdb_7_client_bswap64((__pyx_v_cell[1]));
+2920: value[1] = bswap64(cell[0])
(__pyx_v_value[1]) = __pyx_f_7questdb_7_client_bswap64((__pyx_v_cell[0]));
+2921: if not line_sender_buffer_column_dec(ls_buf, col.name, col.scale, <uint8_t *> value, 16, &err):
__pyx_t_1 = (!line_sender_buffer_column_dec(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_col->scale, ((uint8_t *)__pyx_v_value), 16, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2922: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2922, __pyx_L1_error)
+2923: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2923, __pyx_L1_error)
2924:
+2925: cdef void_int _dataframe_serialize_cell_column_decimal__decimal256_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal256_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint64_t *__pyx_v_cell;
uint64_t __pyx_v_value[4];
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_decimal__decimal256_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2926: line_sender_buffer* ls_buf,
2927: qdb_pystr_buf* b,
2928: col_t* col,
2929: PyThreadState** gs) except -1:
+2930: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2931: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2932: cdef uint64_t *cell
2933: cdef uint64_t[4] value
+2934: if valid:
if (__pyx_v_valid) {
/* … */
}
+2935: cell = &(<uint64_t*>col.cursor.chunk.buffers[1])[col.cursor.offset << 2]
__pyx_v_cell = (&(((uint64_t *)(__pyx_v_col->cursor.chunk->buffers[1]))[(__pyx_v_col->cursor.offset << 2)]));
+2936: value[0] = bswap64(cell[3])
(__pyx_v_value[0]) = __pyx_f_7questdb_7_client_bswap64((__pyx_v_cell[3]));
+2937: value[1] = bswap64(cell[2])
(__pyx_v_value[1]) = __pyx_f_7questdb_7_client_bswap64((__pyx_v_cell[2]));
+2938: value[2] = bswap64(cell[1])
(__pyx_v_value[2]) = __pyx_f_7questdb_7_client_bswap64((__pyx_v_cell[1]));
+2939: value[3] = bswap64(cell[0])
(__pyx_v_value[3]) = __pyx_f_7questdb_7_client_bswap64((__pyx_v_cell[0]));
+2940: if not line_sender_buffer_column_dec(ls_buf, col.name, col.scale, <uint8_t *> value, 32, &err):
__pyx_t_1 = (!line_sender_buffer_column_dec(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_col->scale, ((uint8_t *)__pyx_v_value), 32, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2941: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2941, __pyx_L1_error)
+2942: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2942, __pyx_L1_error)
2943:
2944:
+2945: cdef void_int _dataframe_serialize_cell_column_ts__dt64ns_tz_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64ns_tz_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int64_t __pyx_v_cell;
int64_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_ts__dt64ns_tz_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2946: line_sender_buffer* ls_buf,
2947: qdb_pystr_buf* b,
2948: col_t* col,
2949: PyThreadState** gs) except -1:
+2950: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2951: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2952: cdef int64_t cell
2953: cdef int64_t* access
+2954: if valid:
if (__pyx_v_valid) {
/* … */
}
+2955: access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2956: cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2957: if not line_sender_buffer_column_ts_nanos(ls_buf, col.name, cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_ts_nanos(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2958: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2958, __pyx_L1_error)
+2959: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2959, __pyx_L1_error)
2960:
2961:
+2962: cdef void_int _dataframe_serialize_cell_column_ts__dt64us_tz_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64us_tz_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int64_t __pyx_v_cell;
int64_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_ts__dt64us_tz_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2963: line_sender_buffer* ls_buf,
2964: qdb_pystr_buf* b,
2965: col_t* col,
2966: PyThreadState** gs) except -1:
+2967: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2968: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
2969: cdef int64_t cell
2970: cdef int64_t* access
+2971: if valid:
if (__pyx_v_valid) {
/* … */
}
+2972: access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2973: cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2974: if not line_sender_buffer_column_ts_micros(ls_buf, col.name, cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_ts_micros(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2975: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2975, __pyx_L1_error)
+2976: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2976, __pyx_L1_error)
2977:
2978:
+2979: cdef void_int _dataframe_serialize_cell_at_dt64ns_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64ns_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_at_dt64ns_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2980: line_sender_buffer* ls_buf,
2981: qdb_pystr_buf* b,
2982: col_t* col,
2983: PyThreadState** gs) except -1:
+2984: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+2985: cdef int64_t* access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+2986: cdef int64_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+2987: if cell == _NAT:
__pyx_t_1 = (__pyx_v_cell == __pyx_v_7questdb_7_client__NAT);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+2988: if not line_sender_buffer_at_now(ls_buf, &err):
__pyx_t_1 = (!line_sender_buffer_at_now(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+2989: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2989, __pyx_L1_error)
+2990: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2990, __pyx_L1_error)
2991: else:
2992: # Note: ls_buf will validate against negative numbers.
+2993: if not line_sender_buffer_at_nanos(ls_buf, cell, &err):
/*else*/ {
__pyx_t_1 = (!line_sender_buffer_at_nanos(__pyx_v_ls_buf, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
}
__pyx_L3:;
+2994: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2994, __pyx_L1_error)
+2995: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 2995, __pyx_L1_error)
2996:
2997:
+2998: cdef void_int _dataframe_serialize_cell_at_dt64us_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64us_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_at_dt64us_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2999: line_sender_buffer* ls_buf,
3000: qdb_pystr_buf* b,
3001: col_t* col,
3002: PyThreadState** gs) except -1:
+3003: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3004: cdef int64_t* access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3005: cdef int64_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3006: if cell == _NAT:
__pyx_t_1 = (__pyx_v_cell == __pyx_v_7questdb_7_client__NAT);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+3007: if not line_sender_buffer_at_now(ls_buf, &err):
__pyx_t_1 = (!line_sender_buffer_at_now(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3008: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3008, __pyx_L1_error)
+3009: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 3009, __pyx_L1_error)
3010: else:
3011: # Note: ls_buf will validate against negative numbers.
+3012: if not line_sender_buffer_at_micros(ls_buf, cell, &err):
/*else*/ {
__pyx_t_1 = (!line_sender_buffer_at_micros(__pyx_v_ls_buf, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
}
__pyx_L3:;
+3013: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3013, __pyx_L1_error)
+3014: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 3014, __pyx_L1_error)
3015:
3016:
+3017: cdef void_int _dataframe_serialize_cell_at_dt64ns_tz_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64ns_tz_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_at_dt64ns_tz_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3018: line_sender_buffer* ls_buf,
3019: qdb_pystr_buf* b,
3020: col_t* col,
3021: PyThreadState** gs) except -1:
+3022: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3023: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3024: cdef int64_t* access
3025: cdef int64_t cell
+3026: if valid:
if (__pyx_v_valid) {
/* … */
goto __pyx_L3;
}
+3027: access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3028: cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
3029: # Note: ls_buf will validate against negative numbers.
+3030: if not line_sender_buffer_at_nanos(ls_buf, cell, &err):
__pyx_t_1 = (!line_sender_buffer_at_nanos(__pyx_v_ls_buf, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3031: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3031, __pyx_L1_error)
+3032: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 3032, __pyx_L1_error)
3033: else:
+3034: if not line_sender_buffer_at_now(ls_buf, &err):
/*else*/ {
__pyx_t_1 = (!line_sender_buffer_at_now(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
}
__pyx_L3:;
+3035: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3035, __pyx_L1_error)
+3036: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 3036, __pyx_L1_error)
3037:
3038:
+3039: cdef void_int _dataframe_serialize_cell_at_dt64us_tz_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64us_tz_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_at_dt64us_tz_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3040: line_sender_buffer* ls_buf,
3041: qdb_pystr_buf* b,
3042: col_t* col,
3043: PyThreadState** gs) except -1:
+3044: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3045: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3046: cdef int64_t* access
3047: cdef int64_t cell
+3048: if valid:
if (__pyx_v_valid) {
/* … */
goto __pyx_L3;
}
+3049: access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3050: cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
3051: # Note: ls_buf will validate against negative numbers.
+3052: if not line_sender_buffer_at_micros(ls_buf, cell, &err):
__pyx_t_1 = (!line_sender_buffer_at_micros(__pyx_v_ls_buf, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3053: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3053, __pyx_L1_error)
+3054: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 3054, __pyx_L1_error)
3055: else:
+3056: if not line_sender_buffer_at_now(ls_buf, &err):
/*else*/ {
__pyx_t_1 = (!line_sender_buffer_at_now(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
}
__pyx_L3:;
+3057: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3057, __pyx_L1_error)
+3058: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 3058, __pyx_L1_error)
3059:
3060:
+3061: cdef void_int _dataframe_serialize_cell(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell(struct line_sender_buffer *__pyx_v_ls_buf, struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
enum __pyx_t_7questdb_7_client_col_dispatch_code_t __pyx_v_dc;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3062: line_sender_buffer* ls_buf,
3063: qdb_pystr_buf* b,
3064: col_t* col,
3065: PyThreadState** gs) except -1:
+3066: cdef col_dispatch_code_t dc = col.dispatch_code
__pyx_t_1 = __pyx_v_col->dispatch_code; __pyx_v_dc = __pyx_t_1;
3067: global _dataframe_row_path_emissions
+3068: if _dataframe_count_row_path_emissions:
if (__pyx_v_7questdb_7_client__dataframe_count_row_path_emissions) {
/* … */
}
+3069: _dataframe_row_path_emissions += 1
__pyx_v_7questdb_7_client__dataframe_row_path_emissions = (__pyx_v_7questdb_7_client__dataframe_row_path_emissions + 1);
3070: # Note!: Code below will generate a `switch` statement.
3071: # Ensure this happens! Don't break the `dc == ...` pattern.
+3072: if dc == col_dispatch_code_t.col_dispatch_code_skip_nulls:
switch (__pyx_v_dc) {
case __pyx_e_7questdb_7_client_col_dispatch_code_skip_nulls:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_table__str_pyobj:
3073: pass # We skip a null column. Nothing to do.
+3074: elif dc == col_dispatch_code_t.col_dispatch_code_table__str_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_table__str_utf8_arrow:
+3075: _dataframe_serialize_cell_table__str_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3075, __pyx_L1_error)
+3076: elif dc == col_dispatch_code_t.col_dispatch_code_table__str_utf8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_table__str_lrg_utf8_arrow:
+3077: _dataframe_serialize_cell_table__str_utf8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_utf8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3077, __pyx_L1_error)
+3078: elif dc == col_dispatch_code_t.col_dispatch_code_table__str_lrg_utf8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_table__str_i8_cat:
+3079: _dataframe_serialize_cell_table__str_lrg_utf8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_lrg_utf8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3079, __pyx_L1_error)
+3080: elif dc == col_dispatch_code_t.col_dispatch_code_table__str_i8_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_table__str_i16_cat:
+3081: _dataframe_serialize_cell_table__str_i8_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_i8_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3081, __pyx_L1_error)
+3082: elif dc == col_dispatch_code_t.col_dispatch_code_table__str_i16_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_table__str_i32_cat:
+3083: _dataframe_serialize_cell_table__str_i16_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_i16_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3083, __pyx_L1_error)
+3084: elif dc == col_dispatch_code_t.col_dispatch_code_table__str_i32_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_pyobj:
+3085: _dataframe_serialize_cell_table__str_i32_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_i32_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3085, __pyx_L1_error)
+3086: elif dc == col_dispatch_code_t.col_dispatch_code_symbol__str_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_utf8_arrow:
+3087: _dataframe_serialize_cell_symbol__str_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3087, __pyx_L1_error)
+3088: elif dc == col_dispatch_code_t.col_dispatch_code_symbol__str_utf8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_lrg_utf8_arrow:
+3089: _dataframe_serialize_cell_symbol__str_utf8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_utf8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3089, __pyx_L1_error)
+3090: elif dc == col_dispatch_code_t.col_dispatch_code_symbol__str_lrg_utf8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_i8_cat:
+3091: _dataframe_serialize_cell_symbol__str_lrg_utf8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_lrg_utf8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3091, __pyx_L1_error)
+3092: elif dc == col_dispatch_code_t.col_dispatch_code_symbol__str_i8_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_i16_cat:
+3093: _dataframe_serialize_cell_symbol__str_i8_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_i8_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3093, __pyx_L1_error)
+3094: elif dc == col_dispatch_code_t.col_dispatch_code_symbol__str_i16_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_i32_cat:
+3095: _dataframe_serialize_cell_symbol__str_i16_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_i16_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3095, __pyx_L1_error)
+3096: elif dc == col_dispatch_code_t.col_dispatch_code_symbol__str_i32_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_bool__bool_pyobj:
+3097: _dataframe_serialize_cell_symbol__str_i32_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_i32_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3097, __pyx_L1_error)
+3098: elif dc == col_dispatch_code_t.col_dispatch_code_column_bool__bool_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_bool__bool_numpy:
+3099: _dataframe_serialize_cell_column_bool__bool_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_bool__bool_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3099, __pyx_L1_error)
+3100: elif dc == col_dispatch_code_t.col_dispatch_code_column_bool__bool_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_bool__bool_arrow:
+3101: _dataframe_serialize_cell_column_bool__bool_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_bool__bool_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3101, __pyx_L1_error)
+3102: elif dc == col_dispatch_code_t.col_dispatch_code_column_bool__bool_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__int_pyobj:
+3103: _dataframe_serialize_cell_column_bool__bool_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_bool__bool_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3103, __pyx_L1_error)
+3104: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__int_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u8_numpy:
+3105: _dataframe_serialize_cell_column_i64__int_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__int_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3105, __pyx_L1_error)
+3106: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u8_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i8_numpy:
+3107: _dataframe_serialize_cell_column_i64__u8_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u8_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3107, __pyx_L1_error)
+3108: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i8_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u16_numpy:
+3109: _dataframe_serialize_cell_column_i64__i8_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i8_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3109, __pyx_L1_error)
+3110: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u16_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i16_numpy:
+3111: _dataframe_serialize_cell_column_i64__u16_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u16_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3111, __pyx_L1_error)
+3112: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i16_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u32_numpy:
+3113: _dataframe_serialize_cell_column_i64__i16_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i16_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3113, __pyx_L1_error)
+3114: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u32_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i32_numpy:
+3115: _dataframe_serialize_cell_column_i64__u32_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u32_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3115, __pyx_L1_error)
+3116: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i32_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u64_numpy:
+3117: _dataframe_serialize_cell_column_i64__i32_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i32_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3117, __pyx_L1_error)
+3118: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u64_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i64_numpy:
+3119: _dataframe_serialize_cell_column_i64__u64_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u64_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3119, __pyx_L1_error)
+3120: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i64_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u8_arrow:
+3121: _dataframe_serialize_cell_column_i64__i64_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i64_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3121, __pyx_L1_error)
+3122: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i8_arrow:
+3123: _dataframe_serialize_cell_column_i64__u8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3123, __pyx_L1_error)
+3124: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u16_arrow:
+3125: _dataframe_serialize_cell_column_i64__i8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3125, __pyx_L1_error)
+3126: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u16_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i16_arrow:
+3127: _dataframe_serialize_cell_column_i64__u16_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u16_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3127, __pyx_L1_error)
+3128: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i16_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u32_arrow:
+3129: _dataframe_serialize_cell_column_i64__i16_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i16_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3129, __pyx_L1_error)
+3130: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u32_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i32_arrow:
+3131: _dataframe_serialize_cell_column_i64__u32_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u32_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3131, __pyx_L1_error)
+3132: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i32_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u64_arrow:
+3133: _dataframe_serialize_cell_column_i64__i32_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i32_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3133, __pyx_L1_error)
+3134: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u64_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i64_arrow:
+3135: _dataframe_serialize_cell_column_i64__u64_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u64_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3135, __pyx_L1_error)
+3136: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i64_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__float_pyobj:
+3137: _dataframe_serialize_cell_column_i64__i64_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i64_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3137, __pyx_L1_error)
+3138: elif dc == col_dispatch_code_t.col_dispatch_code_column_f64__float_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f32_numpy:
+3139: _dataframe_serialize_cell_column_f64__float_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__float_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3139, __pyx_L1_error)
+3140: elif dc == col_dispatch_code_t.col_dispatch_code_column_f64__f32_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f64_numpy:
+3141: _dataframe_serialize_cell_column_f64__f32_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f32_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3141, __pyx_L1_error)
+3142: elif dc == col_dispatch_code_t.col_dispatch_code_column_f64__f64_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f32_arrow:
+3143: _dataframe_serialize_cell_column_f64__f64_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f64_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3143, __pyx_L1_error)
+3144: elif dc == col_dispatch_code_t.col_dispatch_code_column_f64__f32_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f64_arrow:
+3145: _dataframe_serialize_cell_column_f64__f32_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f32_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3145, __pyx_L1_error)
+3146: elif dc == col_dispatch_code_t.col_dispatch_code_column_f64__f64_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_pyobj:
+3147: _dataframe_serialize_cell_column_f64__f64_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f64_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3147, __pyx_L1_error)
+3148: elif dc == col_dispatch_code_t.col_dispatch_code_column_str__str_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_utf8_arrow:
+3149: _dataframe_serialize_cell_column_str__str_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3149, __pyx_L1_error)
+3150: elif dc == col_dispatch_code_t.col_dispatch_code_column_str__str_utf8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_lrg_utf8_arrow:
+3151: _dataframe_serialize_cell_column_str__str_utf8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_utf8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3151, __pyx_L1_error)
+3152: elif dc == col_dispatch_code_t.col_dispatch_code_column_str__str_lrg_utf8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_i8_cat:
+3153: _dataframe_serialize_cell_column_str__str_lrg_utf8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_lrg_utf8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3153, __pyx_L1_error)
+3154: elif dc == col_dispatch_code_t.col_dispatch_code_column_str__str_i8_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_i16_cat:
+3155: _dataframe_serialize_cell_column_str__str_i8_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_i8_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3155, __pyx_L1_error)
+3156: elif dc == col_dispatch_code_t.col_dispatch_code_column_str__str_i16_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_i32_cat:
+3157: _dataframe_serialize_cell_column_str__str_i16_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_i16_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3157, __pyx_L1_error)
+3158: elif dc == col_dispatch_code_t.col_dispatch_code_column_str__str_i32_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64ns_numpy:
+3159: _dataframe_serialize_cell_column_str__str_i32_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_i32_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3159, __pyx_L1_error)
+3160: elif dc == col_dispatch_code_t.col_dispatch_code_column_ts__dt64ns_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64us_numpy:
+3161: _dataframe_serialize_cell_column_ts__dt64ns_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64ns_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3161, __pyx_L1_error)
+3162: elif dc == col_dispatch_code_t.col_dispatch_code_column_ts__dt64us_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__datetime_pyobj:
+3163: _dataframe_serialize_cell_column_ts__dt64us_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64us_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3163, __pyx_L1_error)
+3164: elif dc == col_dispatch_code_t.col_dispatch_code_column_ts__datetime_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_arr_f64__arr_f64_numpyobj:
+3165: _dataframe_serialize_cell_column_ts__datetime_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__datetime_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3165, __pyx_L1_error)
+3166: elif dc == col_dispatch_code_t.col_dispatch_code_column_arr_f64__arr_f64_numpyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal_pyobj:
+3167: _dataframe_serialize_cell_column_arr_f64__arr_f64_numpyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_arr_f64__arr_f64_numpyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3167, __pyx_L1_error)
+3168: elif dc == col_dispatch_code_t.col_dispatch_code_column_decimal__decimal_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal32_arrow:
+3169: _dataframe_serialize_cell_column_decimal__decimal_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3169, __pyx_L1_error)
+3170: elif dc == col_dispatch_code_t.col_dispatch_code_column_decimal__decimal32_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal64_arrow:
+3171: _dataframe_serialize_cell_column_decimal__decimal32_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal32_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3171, __pyx_L1_error)
+3172: elif dc == col_dispatch_code_t.col_dispatch_code_column_decimal__decimal64_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal128_arrow:
+3173: _dataframe_serialize_cell_column_decimal__decimal64_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal64_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3173, __pyx_L1_error)
+3174: elif dc == col_dispatch_code_t.col_dispatch_code_column_decimal__decimal128_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal256_arrow:
+3175: _dataframe_serialize_cell_column_decimal__decimal128_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal128_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3175, __pyx_L1_error)
+3176: elif dc == col_dispatch_code_t.col_dispatch_code_column_decimal__decimal256_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64ns_tz_arrow:
+3177: _dataframe_serialize_cell_column_decimal__decimal256_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal256_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3177, __pyx_L1_error)
+3178: elif dc == col_dispatch_code_t.col_dispatch_code_column_ts__dt64ns_tz_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64us_tz_arrow:
+3179: _dataframe_serialize_cell_column_ts__dt64ns_tz_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64ns_tz_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3179, __pyx_L1_error)
+3180: elif dc == col_dispatch_code_t.col_dispatch_code_column_ts__dt64us_tz_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64ns_numpy:
+3181: _dataframe_serialize_cell_column_ts__dt64us_tz_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64us_tz_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3181, __pyx_L1_error)
+3182: elif dc == col_dispatch_code_t.col_dispatch_code_at__dt64ns_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64us_numpy:
+3183: _dataframe_serialize_cell_at_dt64ns_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64ns_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3183, __pyx_L1_error)
+3184: elif dc == col_dispatch_code_t.col_dispatch_code_at__dt64us_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64ns_tz_arrow:
+3185: _dataframe_serialize_cell_at_dt64us_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64us_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3185, __pyx_L1_error)
+3186: elif dc == col_dispatch_code_t.col_dispatch_code_at__dt64ns_tz_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64us_tz_arrow:
+3187: _dataframe_serialize_cell_at_dt64ns_tz_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64ns_tz_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3187, __pyx_L1_error)
+3188: elif dc == col_dispatch_code_t.col_dispatch_code_at__dt64us_tz_arrow:
break;
default:
+3189: _dataframe_serialize_cell_at_dt64us_tz_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64us_tz_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3189, __pyx_L1_error)
3190: else:
+3191: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3191, __pyx_L1_error)
+3192: raise RuntimeError(f"Unknown column dispatch code: {dc}")
__pyx_t_4 = NULL;
__pyx_t_5 = __Pyx_PyUnicode_From_enum____pyx_t_7questdb_7_client_col_dispatch_code_t(__pyx_v_dc, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_column_dispatch_code, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_7 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(1, 3192, __pyx_L1_error)
break;
}
3193: # See earlier note about switch statement generation.
3194: # Don't add complex conditions above!
3195:
3196:
+3197: cdef void _dataframe_col_advance(col_t* col) noexcept nogil:
static void __pyx_f_7questdb_7_client__dataframe_col_advance(struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor;
/* … */
/* function exit code */
}
+3198: cdef col_cursor_t* cursor = &col.cursor
__pyx_v_cursor = (&__pyx_v_col->cursor);
+3199: cursor.offset += 1
__pyx_v_cursor->offset = (__pyx_v_cursor->offset + 1);
3200: # Note: We get away with accessing `cursor.chunk.offset` past the last
3201: # chunk because we've allocated one extra blank chunk.
+3202: while ((cursor.chunk_index < col.setup.chunks.n_chunks) and
while (1) {
__pyx_t_2 = (__pyx_v_cursor->chunk_index < __pyx_v_col->setup->chunks.n_chunks);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L5_bool_binop_done;
}
+3203: (cursor.offset ==
__pyx_t_2 = (__pyx_v_cursor->offset == ((size_t)(__pyx_v_cursor->chunk->offset + __pyx_v_cursor->chunk->length)));
__pyx_t_1 = __pyx_t_2;
__pyx_L5_bool_binop_done:;
if (!__pyx_t_1) break;
3204: <size_t>(cursor.chunk.offset + cursor.chunk.length))):
+3205: cursor.chunk_index += 1
__pyx_v_cursor->chunk_index = (__pyx_v_cursor->chunk_index + 1);
+3206: cursor.chunk += 1
__pyx_v_cursor->chunk = (__pyx_v_cursor->chunk + 1);
+3207: cursor.offset = cursor.chunk.offset
__pyx_t_3 = __pyx_v_cursor->chunk->offset;
__pyx_v_cursor->offset = __pyx_t_3;
}
3208:
3209:
+3210: cdef void_int _dataframe_handle_auto_flush(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_handle_auto_flush(struct __pyx_t_7questdb_7_client_auto_flush_t const *__pyx_v_af, struct line_sender_buffer *__pyx_v_ls_buf, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_flush_err;
struct line_sender_error *__pyx_v_marker_err;
int __pyx_v_flush_ok;
int __pyx_v_marker_ok;
int __pyx_v_had_gil;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("questdb._client._dataframe_handle_auto_flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3211: const auto_flush_t* af,
3212: line_sender_buffer* ls_buf,
3213: PyThreadState** gs) except -1:
+3214: cdef line_sender_error* flush_err = NULL
__pyx_v_flush_err = NULL;
+3215: cdef line_sender_error* marker_err = NULL
__pyx_v_marker_err = NULL;
3216: cdef bint flush_ok
3217: cdef bint marker_ok
+3218: if (af.sender == NULL) or (not should_auto_flush(&af.mode, ls_buf, af.last_flush_ms[0])):
__pyx_t_2 = (__pyx_v_af->sender == NULL);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_2 = __pyx_f_7questdb_7_client_should_auto_flush((&__pyx_v_af->mode), __pyx_v_ls_buf, (__pyx_v_af->last_flush_ms[0])); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 3218, __pyx_L1_error)
__pyx_t_3 = (!__pyx_t_2);
__pyx_t_1 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* … */
}
+3219: return 0
__pyx_r = 0;
goto __pyx_L0;
3220:
3221: # Always temporarily release GIL during a flush.
+3222: had_gil = _ensure_doesnt_have_gil(gs)
__pyx_t_1 = __pyx_f_7questdb_7_client__ensure_doesnt_have_gil(__pyx_v_gs); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 3222, __pyx_L1_error) __pyx_v_had_gil = __pyx_t_1;
+3223: flush_ok = line_sender_flush(af.sender, ls_buf, &flush_err)
__pyx_v_flush_ok = line_sender_flush(__pyx_v_af->sender, __pyx_v_ls_buf, (&__pyx_v_flush_err));
+3224: if flush_ok:
if (__pyx_v_flush_ok) {
/* … */
goto __pyx_L6;
}
+3225: af.last_flush_ms[0] = line_sender_now_micros() // 1000
(__pyx_v_af->last_flush_ms[0]) = __Pyx_div_int64_t(line_sender_now_micros(), 0x3E8, 1);
3226: else:
3227: # To avoid flush reattempt on Sender.__exit__.
+3228: line_sender_buffer_clear(ls_buf)
/*else*/ {
line_sender_buffer_clear(__pyx_v_ls_buf);
}
__pyx_L6:;
3229:
3230: # Flushing will have cleared the marker: We need to set it again
3231: # We need this also on error due to our error handling logic which will
3232: # try to rewind the buffer on error and fail if the marker is unset.
+3233: marker_ok = line_sender_buffer_set_marker(ls_buf, &marker_err)
__pyx_v_marker_ok = line_sender_buffer_set_marker(__pyx_v_ls_buf, (&__pyx_v_marker_err));
3234:
+3235: if had_gil or (not flush_ok) or (not marker_ok):
if (!__pyx_v_had_gil) {
} else {
__pyx_t_1 = __pyx_v_had_gil;
goto __pyx_L8_bool_binop_done;
}
__pyx_t_3 = (!__pyx_v_flush_ok);
if (!__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L8_bool_binop_done;
}
__pyx_t_3 = (!__pyx_v_marker_ok);
__pyx_t_1 = __pyx_t_3;
__pyx_L8_bool_binop_done:;
if (__pyx_t_1) {
/* … */
}
+3236: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3236, __pyx_L1_error)
3237:
+3238: if not flush_ok:
__pyx_t_1 = (!__pyx_v_flush_ok);
if (__pyx_t_1) {
/* … */
}
+3239: if not marker_ok:
__pyx_t_1 = (!__pyx_v_marker_ok);
if (__pyx_t_1) {
/* … */
}
+3240: line_sender_error_free(marker_err)
line_sender_error_free(__pyx_v_marker_err);
+3241: raise c_err_to_py_fmt(flush_err, _FLUSH_FMT)
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FLUSH_FMT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(1, 3241, __pyx_L1_error) __pyx_t_5 = __pyx_f_7questdb_7_client_c_err_to_py_fmt(__pyx_v_flush_err, ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(1, 3241, __pyx_L1_error)
3242:
3243: # The flush error takes precedence over the marker error.
+3244: if not marker_ok:
__pyx_t_1 = (!__pyx_v_marker_ok);
if (unlikely(__pyx_t_1)) {
/* … */
}
+3245: raise c_err_to_py(marker_err)
__pyx_t_5 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_marker_err); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(1, 3245, __pyx_L1_error)
3246:
3247:
3248: # Every how many cells to release and re-acquire the Python GIL.
3249: #
3250: # We've done some perf testing with some mixed column dtypes.
3251: # On a modern CPU we're doing over 8 million pandas cells per second.
3252: # By default, `sys.getswitchinterval()` is 0.005 seconds.
3253: # To accomodate this, we'd need to release the GIL every 40,000 cells.
3254: # This will be divided by the column count to get the row gil blip interval.
+3255: cdef size_t _CELL_GIL_BLIP_INTERVAL = 40000
__pyx_v_7questdb_7_client__CELL_GIL_BLIP_INTERVAL = 0x9C40;
3256:
3257:
+3258: cdef void_int _dataframe(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe(struct __pyx_t_7questdb_7_client_auto_flush_t __pyx_v_af, struct line_sender_buffer *__pyx_v_ls_buf, struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_df, PyObject *__pyx_v_table_name, PyObject *__pyx_v_table_name_col, PyObject *__pyx_v_symbols, PyObject *__pyx_v_at) {
struct __pyx_t_7questdb_7_client_dataframe_plan_t __pyx_v_plan;
struct line_sender_error *__pyx_v_err;
size_t __pyx_v_row_index;
size_t __pyx_v_col_index;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
size_t __pyx_v_row_gil_blip_interval;
PyThreadState *__pyx_v_gs;
int __pyx_v_was_serializing_cell;
int __pyx_v_was_auto_flush;
int __pyx_v_plan_has_content;
PyObject *__pyx_v_e = NULL;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_18);
__Pyx_XDECREF(__pyx_t_19);
__Pyx_XDECREF(__pyx_t_20);
__Pyx_XDECREF(__pyx_t_21);
__Pyx_XDECREF(__pyx_t_22);
__Pyx_XDECREF(__pyx_t_23);
__Pyx_XDECREF(__pyx_t_24);
__Pyx_XDECREF(__pyx_t_26);
__Pyx_XDECREF(__pyx_t_27);
__Pyx_XDECREF(__pyx_t_28);
__Pyx_XDECREF(__pyx_t_29);
__Pyx_AddTraceback("questdb._client._dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_e);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3259: auto_flush_t af,
3260: line_sender_buffer* ls_buf,
3261: qdb_pystr_buf* b,
3262: object df,
3263: object table_name,
3264: object table_name_col,
3265: object symbols,
3266: object at) except -1:
+3267: cdef dataframe_plan_t plan = dataframe_plan_blank()
__pyx_v_plan = __pyx_f_7questdb_7_client_dataframe_plan_blank();
+3268: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3269: cdef size_t row_index
3270: cdef size_t col_index
3271: cdef col_t* col
3272: cdef size_t row_gil_blip_interval
+3273: cdef PyThreadState* gs = NULL # GIL state. NULL means we have the GIL.
__pyx_v_gs = NULL;
3274: cdef bint had_gil
+3275: cdef bint was_serializing_cell = False
__pyx_v_was_serializing_cell = 0;
+3276: cdef bint was_auto_flush = False
__pyx_v_was_auto_flush = 0;
3277: cdef bint plan_has_content
3278:
+3279: try:
/*try:*/ {
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L11_try_end;
__pyx_L6_error:;
__Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
__Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
__Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
__Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
__Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
__Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
__Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
__Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
__Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
/* … */
__pyx_L8_except_error:;
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L4_error;
__pyx_L10_try_return:;
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L3_return;
__pyx_L11_try_end:;
}
}
+3280: _dataframe_plan_build(
__pyx_t_5 = __pyx_f_7questdb_7_client__dataframe_plan_build(__pyx_v_b, __pyx_v_df, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_symbols, __pyx_v_at, (&__pyx_v_plan), ((PyObject*)__pyx_t_4)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3280, __pyx_L6_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3281: b,
3282: df,
3283: table_name,
3284: table_name_col,
3285: symbols,
3286: at,
3287: &plan,
+3288: _FIELD_TARGETS_ROW)
__pyx_t_4 = __pyx_v_7questdb_7_client__FIELD_TARGETS_ROW;
__Pyx_INCREF(__pyx_t_4);
+3289: if (plan.col_count == 0) or (plan.row_count == 0):
__pyx_t_7 = (__pyx_v_plan.col_count == 0);
if (!__pyx_t_7) {
} else {
__pyx_t_6 = __pyx_t_7;
goto __pyx_L13_bool_binop_done;
}
__pyx_t_7 = (__pyx_v_plan.row_count == 0);
__pyx_t_6 = __pyx_t_7;
__pyx_L13_bool_binop_done:;
if (__pyx_t_6) {
/* … */
}
+3290: return 0 # Nothing to do.
__pyx_r = 0;
goto __pyx_L10_try_return;
+3291: line_sender_buffer_clear_marker(ls_buf)
line_sender_buffer_clear_marker(__pyx_v_ls_buf);
3292:
3293: # On error, undo all added lines.
+3294: if not line_sender_buffer_set_marker(ls_buf, &err):
__pyx_t_6 = (!line_sender_buffer_set_marker(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_6)) {
/* … */
}
+3295: raise c_err_to_py(err)
__pyx_t_4 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3295, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 3295, __pyx_L6_error)
3296:
+3297: row_gil_blip_interval = _CELL_GIL_BLIP_INTERVAL // plan.col_count
if (unlikely(__pyx_v_plan.col_count == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(1, 3297, __pyx_L6_error)
}
__pyx_v_row_gil_blip_interval = (__pyx_v_7questdb_7_client__CELL_GIL_BLIP_INTERVAL / __pyx_v_plan.col_count);
+3298: if row_gil_blip_interval < 400: # ceiling reached at 100 columns
__pyx_t_6 = (__pyx_v_row_gil_blip_interval < 0x190);
if (__pyx_t_6) {
/* … */
}
+3299: row_gil_blip_interval = 400
__pyx_v_row_gil_blip_interval = 0x190;
+3300: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L22_try_end;
__pyx_L17_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
/* … */
__pyx_L19_except_error:;
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
goto __pyx_L6_error;
__pyx_L22_try_end:;
}
3301: # Don't move this logic up! We need the GIL to execute a `try`.
3302: # Also we can't have any other `try` blocks between here and the
3303: # `finally` block.
+3304: if not plan.any_cols_need_gil:
__pyx_t_6 = (!__pyx_v_plan.any_cols_need_gil);
if (__pyx_t_6) {
/* … */
}
+3305: _ensure_doesnt_have_gil(&gs)
__pyx_t_6 = __pyx_f_7questdb_7_client__ensure_doesnt_have_gil((&__pyx_v_gs)); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 3305, __pyx_L17_error)
3306:
+3307: for row_index in range(plan.row_count):
__pyx_t_11 = __pyx_v_plan.row_count;
__pyx_t_12 = __pyx_t_11;
for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
__pyx_v_row_index = __pyx_t_13;
+3308: if (gs == NULL) and (row_index % row_gil_blip_interval == 0):
__pyx_t_7 = (__pyx_v_gs == NULL);
if (__pyx_t_7) {
} else {
__pyx_t_6 = __pyx_t_7;
goto __pyx_L27_bool_binop_done;
}
if (unlikely(__pyx_v_row_gil_blip_interval == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(1, 3308, __pyx_L17_error)
}
__pyx_t_7 = ((__pyx_v_row_index % __pyx_v_row_gil_blip_interval) == 0);
__pyx_t_6 = __pyx_t_7;
__pyx_L27_bool_binop_done:;
if (__pyx_t_6) {
/* … */
}
3309: # Release and re-acquire the GIL every so often.
3310: # This is to allow other python threads to run.
3311: # If we hold the GIL for too long, we can starve other
3312: # threads, for example timing out network activity.
+3313: _ensure_doesnt_have_gil(&gs)
__pyx_t_6 = __pyx_f_7questdb_7_client__ensure_doesnt_have_gil((&__pyx_v_gs)); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 3313, __pyx_L17_error)
+3314: _ensure_has_gil(&gs)
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3314, __pyx_L17_error)
3315:
+3316: qdb_pystr_buf_truncate(b, plan.str_buf_marker)
qdb_pystr_buf_truncate(__pyx_v_b, __pyx_v_plan.str_buf_marker);
3317:
3318: # Table-name from `table_name` arg in Python.
+3319: if plan.c_table_name.buf != NULL:
__pyx_t_6 = (__pyx_v_plan.c_table_name.buf != NULL);
if (__pyx_t_6) {
/* … */
}
+3320: if not line_sender_buffer_table(ls_buf, plan.c_table_name, &err):
__pyx_t_6 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_plan.c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_6)) {
/* … */
}
+3321: _ensure_has_gil(&gs)
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3321, __pyx_L17_error)
+3322: raise c_err_to_py(err)
__pyx_t_4 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3322, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 3322, __pyx_L17_error)
3323:
3324: # Serialize columns cells.
3325: # Note: Columns are sorted: table name, symbols, fields, at.
+3326: was_serializing_cell = True
__pyx_v_was_serializing_cell = 1;
+3327: for col_index in range(plan.col_count):
__pyx_t_14 = __pyx_v_plan.col_count;
__pyx_t_15 = __pyx_t_14;
for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
__pyx_v_col_index = __pyx_t_16;
+3328: col = &plan.cols.d[col_index]
__pyx_v_col = (&(__pyx_v_plan.cols.d[__pyx_v_col_index]));
+3329: _dataframe_serialize_cell(ls_buf, b, col, &gs) # may raise
__pyx_t_5 = __pyx_f_7questdb_7_client__dataframe_serialize_cell(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, (&__pyx_v_gs)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3329, __pyx_L17_error)
+3330: _dataframe_col_advance(col)
__pyx_f_7questdb_7_client__dataframe_col_advance(__pyx_v_col);
}
+3331: was_serializing_cell = False
__pyx_v_was_serializing_cell = 0;
3332:
3333: # Fixed "at" value (not from a column).
+3334: if plan.at_value == _AT_IS_SERVER_NOW:
__pyx_t_6 = (__pyx_v_plan.at_value == __pyx_v_7questdb_7_client__AT_IS_SERVER_NOW);
if (__pyx_t_6) {
/* … */
goto __pyx_L33;
}
+3335: if not line_sender_buffer_at_now(ls_buf, &err):
__pyx_t_6 = (!line_sender_buffer_at_now(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_6)) {
/* … */
}
+3336: _ensure_has_gil(&gs)
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3336, __pyx_L17_error)
+3337: raise c_err_to_py(err)
__pyx_t_4 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3337, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 3337, __pyx_L17_error)
+3338: elif plan.at_value >= 0:
__pyx_t_6 = (__pyx_v_plan.at_value >= 0);
if (__pyx_t_6) {
/* … */
}
__pyx_L33:;
+3339: if not line_sender_buffer_at_nanos(ls_buf, plan.at_value, &err):
__pyx_t_6 = (!line_sender_buffer_at_nanos(__pyx_v_ls_buf, __pyx_v_plan.at_value, (&__pyx_v_err)));
if (unlikely(__pyx_t_6)) {
/* … */
}
+3340: _ensure_has_gil(&gs)
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3340, __pyx_L17_error)
+3341: raise c_err_to_py(err)
__pyx_t_4 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3341, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 3341, __pyx_L17_error)
3342:
+3343: was_auto_flush = True
__pyx_v_was_auto_flush = 1;
+3344: _dataframe_handle_auto_flush(&af, ls_buf, &gs)
__pyx_t_5 = __pyx_f_7questdb_7_client__dataframe_handle_auto_flush((&__pyx_v_af), __pyx_v_ls_buf, (&__pyx_v_gs)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(1, 3344, __pyx_L17_error)
+3345: was_auto_flush = False
__pyx_v_was_auto_flush = 0;
}
+3346: except Exception as e:
__pyx_t_17 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_17) { __Pyx_AddTraceback("questdb._client._dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_18, &__pyx_t_19) < 0) __PYX_ERR(1, 3346, __pyx_L19_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_INCREF(__pyx_t_18); __pyx_v_e = __pyx_t_18; /*try:*/ { /* … */ /*finally:*/ { __pyx_L41_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_33 = 0; __pyx_t_34 = 0; __pyx_t_35 = 0; __pyx_t_36 = 0; __pyx_t_37 = 0; __pyx_t_38 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_ExceptionSwap(&__pyx_t_36, &__pyx_t_37, &__pyx_t_38); if ( unlikely(__Pyx_GetException(&__pyx_t_33, &__pyx_t_34, &__pyx_t_35) < 0)) __Pyx_ErrFetch(&__pyx_t_33, &__pyx_t_34, &__pyx_t_35); __Pyx_XGOTREF(__pyx_t_33); __Pyx_XGOTREF(__pyx_t_34); __Pyx_XGOTREF(__pyx_t_35); __Pyx_XGOTREF(__pyx_t_36); __Pyx_XGOTREF(__pyx_t_37); __Pyx_XGOTREF(__pyx_t_38); __pyx_t_17 = __pyx_lineno; __pyx_t_31 = __pyx_clineno; __pyx_t_32 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } __Pyx_XGIVEREF(__pyx_t_36); __Pyx_XGIVEREF(__pyx_t_37); __Pyx_XGIVEREF(__pyx_t_38); __Pyx_ExceptionReset(__pyx_t_36, __pyx_t_37, __pyx_t_38); __Pyx_XGIVEREF(__pyx_t_33); __Pyx_XGIVEREF(__pyx_t_34); __Pyx_XGIVEREF(__pyx_t_35); __Pyx_ErrRestore(__pyx_t_33, __pyx_t_34, __pyx_t_35); __pyx_t_33 = 0; __pyx_t_34 = 0; __pyx_t_35 = 0; __pyx_t_36 = 0; __pyx_t_37 = 0; __pyx_t_38 = 0; __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_31; __pyx_filename = __pyx_t_32; goto __pyx_L19_except_error; } } } goto __pyx_L19_except_error;
3347: # It would be an internal bug for this to raise.
+3348: if not line_sender_buffer_rewind_to_marker(ls_buf, &err):
__pyx_t_6 = (!line_sender_buffer_rewind_to_marker(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_6)) {
/* … */
}
+3349: raise c_err_to_py(err)
__pyx_t_20 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 3349, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_Raise(__pyx_t_20, 0, 0, 0); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __PYX_ERR(1, 3349, __pyx_L41_error)
3350:
+3351: if (isinstance(e, QuestDBError) and
__Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 3351, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_7 = PyObject_IsInstance(__pyx_v_e, __pyx_t_20); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 3351, __pyx_L41_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; if (__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L45_bool_binop_done; } /* … */ if (unlikely(__pyx_t_6)) { /* … */ }
+3352: (e.code == QuestDBErrorCode.InvalidApiCall) and not was_auto_flush):
__pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_mstate_global->__pyx_n_u_code); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 3352, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 3352, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_InvalidApiCall); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 3352, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __pyx_t_21 = PyObject_RichCompare(__pyx_t_20, __pyx_t_22, Py_EQ); __Pyx_XGOTREF(__pyx_t_21); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 3352, __pyx_L41_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_21); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 3352, __pyx_L41_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L45_bool_binop_done; } __pyx_t_7 = (!__pyx_v_was_auto_flush); __pyx_t_6 = __pyx_t_7; __pyx_L45_bool_binop_done:;
3353: # TODO: This should be allowed by the database.
3354: # It currently isn't so we have to raise an error.
+3355: raise QuestDBError(
__pyx_t_22 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 3355, __pyx_L41_error)
__Pyx_GOTREF(__pyx_t_20);
+3356: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 3356, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 3356, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
+3357: f'Bad dataframe row at index {row_index}: ' +
__pyx_t_23 = __Pyx_PyUnicode_From_size_t(__pyx_v_row_index, 0, ' ', 'd'); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 3357, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_25[0] = __pyx_mstate_global->__pyx_kp_u_Bad_dataframe_row_at_index; __pyx_t_25[1] = __pyx_t_23; __pyx_t_25[2] = __pyx_mstate_global->__pyx_kp_u_All_values_are_nulls_Ensure_at; __pyx_t_26 = __Pyx_PyUnicode_Join(__pyx_t_25, 3, 27 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_23) + 63, 127); if (unlikely(!__pyx_t_26)) __PYX_ERR(1, 3357, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_20))) { __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_20); assert(__pyx_t_22); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_20); __Pyx_INCREF(__pyx_t_22); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_20, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_22, __pyx_t_24, __pyx_t_26}; __pyx_t_21 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_20, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 3355, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_21); }
3358: 'All values are nulls. '+
+3359: 'Ensure at least one column is not null.') from e
__Pyx_Raise(__pyx_t_21, 0, 0, __pyx_v_e); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __PYX_ERR(1, 3355, __pyx_L41_error)
+3360: elif was_serializing_cell:
if (unlikely(__pyx_v_was_serializing_cell)) {
/* … */
}
+3361: raise QuestDBError(
__pyx_t_20 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_26, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_26)) __PYX_ERR(1, 3361, __pyx_L41_error)
__Pyx_GOTREF(__pyx_t_26);
+3362: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 3362, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 3362, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
+3363: 'Failed to serialize value of column ' +
__pyx_t_23 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Failed_to_serialize_value_of_col, __pyx_t_24); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 3363, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
+3364: repr(df.columns[col.setup.orig_index]) +
__pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 3364, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_23 = __Pyx_GetItemInt(__pyx_t_24, __pyx_v_col->setup->orig_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 3364, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __pyx_t_24 = PyObject_Repr(__pyx_t_23); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 3364, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; /* … */ __pyx_t_24 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_23, __pyx_t_27); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 3364, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
+3365: f' at row index {row_index} (' +
__pyx_t_24 = __Pyx_PyUnicode_From_size_t(__pyx_v_row_index, 0, ' ', 'd'); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 3365, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_25[0] = __pyx_mstate_global->__pyx_kp_u_at_row_index; __pyx_t_25[1] = __pyx_t_24; __pyx_t_25[2] = __pyx_mstate_global->__pyx_kp_u__14; __pyx_t_27 = __Pyx_PyUnicode_Join(__pyx_t_25, 3, 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_24) + 2, 127); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 3365, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; /* … */ __pyx_t_28 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_24, __pyx_t_29); if (unlikely(!__pyx_t_28)) __PYX_ERR(1, 3365, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
+3366: repr(df.iloc[row_index, col.setup.orig_index]) +
__pyx_t_27 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_iloc); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 3366, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_27); __pyx_t_23 = __Pyx_PyLong_FromSize_t(__pyx_v_row_index); if (unlikely(!__pyx_t_23)) __PYX_ERR(1, 3366, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_28 = __Pyx_PyLong_FromSize_t(__pyx_v_col->setup->orig_index); if (unlikely(!__pyx_t_28)) __PYX_ERR(1, 3366, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_28); __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(1, 3366, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_29); __Pyx_GIVEREF(__pyx_t_23); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_23) != (0)) __PYX_ERR(1, 3366, __pyx_L41_error); __Pyx_GIVEREF(__pyx_t_28); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_28) != (0)) __PYX_ERR(1, 3366, __pyx_L41_error); __pyx_t_23 = 0; __pyx_t_28 = 0; __pyx_t_28 = __Pyx_PyObject_GetItem(__pyx_t_27, __pyx_t_29); if (unlikely(!__pyx_t_28)) __PYX_ERR(1, 3366, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; __pyx_t_29 = PyObject_Repr(__pyx_t_28); if (unlikely(!__pyx_t_29)) __PYX_ERR(1, 3366, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_29); __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; /* … */ __pyx_t_24 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_28, __pyx_t_27); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 3366, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_26))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_26); assert(__pyx_t_20); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_26); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_26, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_t_22, __pyx_t_24}; __pyx_t_21 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_26, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 3361, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_21); }
+3367: f'): {e} [dc={<int>col.dispatch_code}]') from e
__pyx_t_29 = __Pyx_PyObject_FormatSimple(__pyx_v_e, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_29)) __PYX_ERR(1, 3367, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_29); __pyx_t_24 = __Pyx_PyUnicode_From_int(((int)__pyx_v_col->dispatch_code), 0, ' ', 'd'); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 3367, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_30[0] = __pyx_mstate_global->__pyx_kp_u__16; __pyx_t_30[1] = __pyx_t_29; __pyx_t_30[2] = __pyx_mstate_global->__pyx_kp_u_dc; __pyx_t_30[3] = __pyx_t_24; __pyx_t_30[4] = __pyx_mstate_global->__pyx_kp_u__17; __pyx_t_27 = __Pyx_PyUnicode_Join(__pyx_t_30, 5, 3 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_29) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_24) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_29)); if (unlikely(!__pyx_t_27)) __PYX_ERR(1, 3367, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; /* … */ __Pyx_Raise(__pyx_t_21, 0, 0, __pyx_v_e); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __PYX_ERR(1, 3361, __pyx_L41_error)
3368: else:
+3369: raise
/*else*/ {
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_18);
__Pyx_XGIVEREF(__pyx_t_19);
__Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_18, __pyx_t_19);
__pyx_t_4 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
__PYX_ERR(1, 3369, __pyx_L41_error)
}
}
+3370: except Exception as e:
__pyx_t_31 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_31) { __Pyx_AddTraceback("questdb._client._dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_19, &__pyx_t_18, &__pyx_t_4) < 0) __PYX_ERR(1, 3370, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_18); __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_18); /*try:*/ { /* … */ /*finally:*/ { __pyx_L57_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_38 = 0; __pyx_t_37 = 0; __pyx_t_36 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_ExceptionSwap(&__pyx_t_38, &__pyx_t_37, &__pyx_t_36); if ( unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_38); __Pyx_XGOTREF(__pyx_t_37); __Pyx_XGOTREF(__pyx_t_36); __pyx_t_31 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_39 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } __Pyx_XGIVEREF(__pyx_t_38); __Pyx_XGIVEREF(__pyx_t_37); __Pyx_XGIVEREF(__pyx_t_36); __Pyx_ExceptionReset(__pyx_t_38, __pyx_t_37, __pyx_t_36); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_9, __pyx_t_8); __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_38 = 0; __pyx_t_37 = 0; __pyx_t_36 = 0; __pyx_lineno = __pyx_t_31; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_39; goto __pyx_L8_except_error; } } } goto __pyx_L8_except_error;
+3371: if not isinstance(e, QuestDBError):
__Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 3371, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_6 = PyObject_IsInstance(__pyx_v_e, __pyx_t_21); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 3371, __pyx_L57_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __pyx_t_7 = (!__pyx_t_6); if (unlikely(__pyx_t_7)) { /* … */ }
+3372: raise QuestDBError(
__pyx_t_26 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_24)) __PYX_ERR(1, 3372, __pyx_L57_error)
__Pyx_GOTREF(__pyx_t_24);
+3373: QuestDBErrorCode.InvalidApiCall,
__Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 3373, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_mstate_global->__pyx_n_u_InvalidApiCall); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 3373, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
+3374: str(e)) from e
__pyx_t_22 = __Pyx_PyObject_Unicode(__pyx_v_e); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 3374, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_24))) { __pyx_t_26 = PyMethod_GET_SELF(__pyx_t_24); assert(__pyx_t_26); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_24); __Pyx_INCREF(__pyx_t_26); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_24, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_26, __pyx_t_20, __pyx_t_22}; __pyx_t_21 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_24, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 3372, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_21); } __Pyx_Raise(__pyx_t_21, 0, 0, __pyx_v_e); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __PYX_ERR(1, 3372, __pyx_L57_error)
3375: else:
+3376: raise
/*else*/ {
__Pyx_GIVEREF(__pyx_t_19);
__Pyx_GIVEREF(__pyx_t_18);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_ErrRestoreWithState(__pyx_t_19, __pyx_t_18, __pyx_t_4);
__pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_4 = 0;
__PYX_ERR(1, 3376, __pyx_L57_error)
}
}
3377: finally:
+3378: _ensure_has_gil(&gs) # Note: We need the GIL for cleanup.
/*finally:*/ {
/*normal exit:*/{
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3378, __pyx_L1_error)
/* … */
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3378, __pyx_L69_error)
/* … */
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3378, __pyx_L1_error)
+3379: plan_has_content = (plan.col_count != 0) and (plan.row_count != 0)
__pyx_t_6 = (__pyx_v_plan.col_count != 0);
if (__pyx_t_6) {
} else {
__pyx_t_7 = __pyx_t_6;
goto __pyx_L64_bool_binop_done;
}
__pyx_t_6 = (__pyx_v_plan.row_count != 0);
__pyx_t_7 = __pyx_t_6;
__pyx_L64_bool_binop_done:;
__pyx_v_plan_has_content = __pyx_t_7;
/* … */
__pyx_t_6 = (__pyx_v_plan.col_count != 0);
if (__pyx_t_6) {
} else {
__pyx_t_7 = __pyx_t_6;
goto __pyx_L70_bool_binop_done;
}
__pyx_t_6 = (__pyx_v_plan.row_count != 0);
__pyx_t_7 = __pyx_t_6;
__pyx_L70_bool_binop_done:;
__pyx_v_plan_has_content = __pyx_t_7;
/* … */
__pyx_t_6 = (__pyx_v_plan.col_count != 0);
if (__pyx_t_6) {
} else {
__pyx_t_7 = __pyx_t_6;
goto __pyx_L74_bool_binop_done;
}
__pyx_t_6 = (__pyx_v_plan.row_count != 0);
__pyx_t_7 = __pyx_t_6;
__pyx_L74_bool_binop_done:;
__pyx_v_plan_has_content = __pyx_t_7;
+3380: if plan_has_content:
if (__pyx_v_plan_has_content) {
/* … */
}
/* … */
if (__pyx_v_plan_has_content) {
/* … */
}
/* … */
if (__pyx_v_plan_has_content) {
/* … */
}
+3381: line_sender_buffer_clear_marker(ls_buf)
line_sender_buffer_clear_marker(__pyx_v_ls_buf);
/* … */
line_sender_buffer_clear_marker(__pyx_v_ls_buf);
/* … */
line_sender_buffer_clear_marker(__pyx_v_ls_buf);
+3382: dataframe_plan_release(&plan)
__pyx_f_7questdb_7_client_dataframe_plan_release((&__pyx_v_plan));
/* … */
__pyx_f_7questdb_7_client_dataframe_plan_release((&__pyx_v_plan));
/* … */
__pyx_f_7questdb_7_client_dataframe_plan_release((&__pyx_v_plan));
+3383: if plan_has_content:
if (__pyx_v_plan_has_content) {
/* … */
}
goto __pyx_L5;
}
__pyx_L4_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_36 = 0; __pyx_t_37 = 0; __pyx_t_38 = 0;
__Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
__Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
__Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
__Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
__Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
__Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
__Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
__Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
__Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_ExceptionSwap(&__pyx_t_36, &__pyx_t_37, &__pyx_t_38);
if ( unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_36);
__Pyx_XGOTREF(__pyx_t_37);
__Pyx_XGOTREF(__pyx_t_38);
__pyx_t_17 = __pyx_lineno; __pyx_t_31 = __pyx_clineno; __pyx_t_40 = __pyx_filename;
{
/* … */
if (__pyx_v_plan_has_content) {
/* … */
}
}
__Pyx_XGIVEREF(__pyx_t_36);
__Pyx_XGIVEREF(__pyx_t_37);
__Pyx_XGIVEREF(__pyx_t_38);
__Pyx_ExceptionReset(__pyx_t_36, __pyx_t_37, __pyx_t_38);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
__pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_36 = 0; __pyx_t_37 = 0; __pyx_t_38 = 0;
__pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_31; __pyx_filename = __pyx_t_40;
goto __pyx_L1_error;
__pyx_L69_error:;
__Pyx_XGIVEREF(__pyx_t_36);
__Pyx_XGIVEREF(__pyx_t_37);
__Pyx_XGIVEREF(__pyx_t_38);
__Pyx_ExceptionReset(__pyx_t_36, __pyx_t_37, __pyx_t_38);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_36 = 0; __pyx_t_37 = 0; __pyx_t_38 = 0;
goto __pyx_L1_error;
}
__pyx_L3_return: {
__pyx_t_5 = __pyx_r;
/* … */
if (__pyx_v_plan_has_content) {
/* … */
}
__pyx_r = __pyx_t_5;
goto __pyx_L0;
}
__pyx_L5:;
}
+3384: qdb_pystr_buf_clear(b)
qdb_pystr_buf_clear(__pyx_v_b);
/* … */
qdb_pystr_buf_clear(__pyx_v_b);
/* … */
qdb_pystr_buf_clear(__pyx_v_b);