Skip to content

Commit 6ecee2f

Browse files
authored
Merge pull request #52 from rianoc-kx/3.1.4
3.1.4
2 parents 8806edd + 0855137 commit 6ecee2f

File tree

18 files changed

+104
-35
lines changed

18 files changed

+104
-35
lines changed

docs/release-notes/changelog.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44

55
The changelog presented here outlines changes to PyKX when operating within a Python environment specifically, if you require changelogs associated with PyKX operating under a q environment see [here](./underq-changelog.md).
66

7+
## PyKX 3.1.4
8+
9+
#### Release Date
10+
11+
2025-07-17
12+
13+
### Fixes and Improvements
14+
15+
- Resolved error on import when `PYKX_THREADING` was set.
16+
- Fixed an issue where data could be corrupted in keyed columns of PyArrow backed Pandas dataframes.
17+
718
## PyKX 3.1.3
819

920
#### Release Date

docs/release-notes/underq-changelog.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,37 @@ This changelog provides updates from PyKX 2.0.0 and above, for information relat
66

77
The changelog presented here outlines changes to PyKX when operating within a q environment specifically, if you require changelogs associated with PyKX operating within a Python environment see [here](./changelog.md).
88

9+
## PyKX 3.1.4
10+
11+
#### Release Date
12+
13+
2025-07-17
14+
15+
### Fixes and Improvements
16+
17+
- Resolved `object has no attribute 't'` error for certain conversions
18+
19+
=== "Behaviour prior to change"
20+
21+
```python
22+
q).pykx.setdefault (),"k";
23+
q).pykx.import[`numpy.random][`:choice][01b; 10]
24+
'AttributeError("'numpy.int64' object has no attribute 't'")
25+
[2] /home/user/q/pykx.q:241: .pykx.util.pykx:
26+
];
27+
wrap pyfunc[f] . x];
28+
^
29+
":"~first a0:string x0;
30+
```
31+
32+
=== "Behaviour post change"
33+
34+
```python
35+
q).pykx.setdefault (),"k";
36+
q).pykx.import[`numpy.random][`:choice][01b; 10]
37+
1011111110b
38+
```
39+
940
## PyKX 3.1.3
1041

1142
#### Release Date

docs/user-guide/advanced/ipc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ In the below examples you can connect to a process on port 5050 and run a query.
9292

9393
```python
9494
>>> conn = await kx.AsyncQConnection('localhost', 5050)
95-
>>> print(await conn('til 10').py())
95+
>>> print((await conn('til 10')).py())
9696
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
9797
>>> conn.close()
9898
```

docs/user-guide/advanced/numpy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ _This page explains how to integrate PyKX with NumPy._
1111

1212
PyKX is designed for advanced integration with NumPy. This integration is built on three pillars:
1313

14-
- [NEP-49](https://numpy.org/neps/nep-0049.html)
14+
- [NEP-49](https://numpy.org/neps/nep-0049-data-allocation-strategies.html)
1515
- the NumPy [array interface](https://numpy.org/doc/stable/reference/arrays.interface.html)
1616
- [universal functions](https://numpy.org/doc/stable/reference/ufuncs.html)
1717

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ test = [
126126
"pytest-randomly==3.11.0",
127127
"pytest-xdist==2.5.0",
128128
"pytest-order==1.1.0",
129+
"pytest-rerunfailures==10.3",
129130
"psutil>=5.0.0",
130131
"pytest-timeout>=2.0.0",
131132
"IPython",

src/pykx/core.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def _link_qhome():
241241
warn('Unable to connect user QHOME to PyKX QHOME via symlinks.\n' # nocov
242242
'To permanently disable attempts to create symlinks you can\n' # nocov
243243
'\t1. Set the environment variable "PYKX_IGNORE_QHOME" = True.\n' # nocov
244-
'\t2. Update the file ".pykx.config" using kx.util.add_to_config({\'PYKX_IGNORE_QHOME\': \'True\'})\n' # nocov
244+
'\t2. Update the file ".pykx-config" using kx.util.add_to_config({\'PYKX_IGNORE_QHOME\': \'True\'})\n' # nocov
245245
f'Error: {ex}\n', # nocov
246246
PyKXWarning) # nocov
247247
return # nocov

src/pykx/embedded_q.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def __call__(self,
214214
query: The code to run in the q instance.
215215
*args: Arguments to the q query. Each argument is converted into a
216216
`#!python pykx.K` object. This parameter supports up to 8 args (the maximum amount
217-
supported by q functions), providing more causesw an error.
217+
supported by q functions), providing more causes an error.
218218
wait: A keyword to allow users to call any `#!python pykx.EmbeddedQ` or
219219
`#!python pykx.QConnection` instance the same way. All queries executed by this
220220
function are synchronous on the embedded q instance. Using a `#!python False`

src/pykx/nbextension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def write_to_q_file(_q, locked, path, code):
188188
if locked:
189189
output_file = Path(path[:-1])
190190
_q('0:', output_file, [kx.CharVector(code)])
191-
_q('\_ ' + path[:-1])
191+
_q('\\_ ' + path[:-1])
192192
_q('hdel', output_file)
193193
else:
194194
output_file = Path(path)

src/pykx/pykx.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static PyObject* k_to_py_list(K x) {
217217
EXPORT K k_to_py_foreign(K x, K typenum, K israw) {
218218
K k;
219219
if (pykx_threading)
220-
return raise_k_error("pykx.q is not supported when using PYKX_THREADING");
220+
return raise_k_error("pyForeign is not supported when using PYKX_THREADING");
221221
PyGILState_STATE gstate;
222222
gstate = PyGILState_Ensure();
223223
PyObject* p = k_to_py_cast(x, typenum, israw);
@@ -291,7 +291,7 @@ void construct_args_kwargs(PyObject* params, PyObject** args, PyObject** kwargs,
291291
EXPORT K k_pyrun(K k_ret, K k_eval_or_exec, K as_foreign, K k_code_string) {
292292

293293
if (pykx_threading)
294-
return raise_k_error("pykx.q is not supported when using PYKX_THREADING");
294+
return raise_k_error("pyrun is not supported when using PYKX_THREADING");
295295
PyGILState_STATE gstate;
296296
gstate = PyGILState_Ensure();
297297
K k;
@@ -435,7 +435,7 @@ EXPORT K k_modpow(K k_base, K k_exp, K k_mod_arg) {
435435

436436
EXPORT K foreign_to_q(K f, K b) {
437437
if (pykx_threading)
438-
return raise_k_error("pykx.q is not supported when using PYKX_THREADING");
438+
return raise_k_error("foreignToq is not supported when using PYKX_THREADING");
439439
if (f->t != 112)
440440
return raise_k_error("Expected foreign object for call to .pykx.toq");
441441
if (!check_py_foreign(f))
@@ -483,7 +483,7 @@ EXPORT K foreign_to_q(K f, K b) {
483483

484484
EXPORT K repr(K as_repr, K f) {
485485
if (pykx_threading)
486-
return raise_k_error("pykx.q is not supported when using PYKX_THREADING");
486+
return raise_k_error("repr is not supported when using PYKX_THREADING");
487487
K k;
488488
if (f->t != 112) {
489489
if (as_repr->g){
@@ -526,7 +526,7 @@ EXPORT K repr(K as_repr, K f) {
526526

527527
EXPORT K get_attr(K f, K attr) {
528528
if (pykx_threading)
529-
return raise_k_error("pykx.q is not supported when using PYKX_THREADING");
529+
return raise_k_error("getattr is not supported when using PYKX_THREADING");
530530
K k;
531531
if (f->t != 112) {
532532
if (f->t == 105) {
@@ -555,7 +555,7 @@ EXPORT K get_attr(K f, K attr) {
555555

556556
EXPORT K get_global(K attr) {
557557
if (pykx_threading)
558-
return raise_k_error("pykx.q is not supported when using PYKX_THREADING");
558+
return raise_k_error("getGlobal is not supported when using PYKX_THREADING");
559559
K k;
560560
if (attr->t != -11) {
561561
return raise_k_error("Expected a SymbolAtom for the attribute to get in .pykx.get");
@@ -582,7 +582,7 @@ EXPORT K get_global(K attr) {
582582

583583
EXPORT K set_global(K attr, K val) {
584584
if (pykx_threading)
585-
return raise_k_error("pykx.q is not supported when using PYKX_THREADING");
585+
return raise_k_error("setGlobal is not supported when using PYKX_THREADING");
586586
K k;
587587
int gstate = PyGILState_Ensure();
588588

@@ -608,7 +608,7 @@ EXPORT K set_global(K attr, K val) {
608608

609609
EXPORT K set_attr(K f, K attr, K val) {
610610
if (pykx_threading)
611-
return raise_k_error("pykx.q is not supported when using PYKX_THREADING");
611+
return raise_k_error("setattr is not supported when using PYKX_THREADING");
612612
if (f->t != 112) {
613613
if (f->t == 105) {
614614
return raise_k_error("Expected foreign object for call to .pykx.setattr, try unwrapping the foreign object with `.");
@@ -638,7 +638,7 @@ EXPORT K set_attr(K f, K attr, K val) {
638638

639639
EXPORT K import(K module) {
640640
if (pykx_threading)
641-
return raise_k_error("pykx.q is not supported when using PYKX_THREADING");
641+
return raise_k_error("import is not supported when using PYKX_THREADING");
642642
K k;
643643
K res;
644644
if (module->t != -11)
@@ -660,7 +660,7 @@ EXPORT K import(K module) {
660660
EXPORT K call_func(K f, K has_no_args, K args, K kwargs) {
661661

662662
if (pykx_threading)
663-
return raise_k_error("pykx.q is not supported when using PYKX_THREADING");
663+
return raise_k_error("import is not supported when using PYKX_THREADING");
664664
K k;
665665
PyObject* pyf = NULL;
666666

src/pykx/pykx_init.q_

-4.88 KB
Binary file not shown.

0 commit comments

Comments
 (0)