

rocuinneagain
Forum Replies Created
-
3.11 support has just been added – we’ll get those docs updated. Thanks!
https://code.kx.com/pykx/1.6/changelog.html#pykx-160
- Added support for Python
3.11
.- Support for pyarrow in this python version is currently in Beta.
- Added support for Python
-
rocuinneagain
MemberJune 19, 2023 at 12:00 am in reply to: kx.q.sql(‘select * from trades’) command error- What version of PyKX as you using?
- Can you run this example?
>>> import pykx as kx >>> kx.__version__ '1.6.0' >>> kx.q('trades: ([]sym:`ibm`msft`apple`samsung;mcap:2000 4000 9000 6000;ex:`nasdaq`nasdaq`DAX`Dow)') pykx.Identity(pykx.q('::')) >>> kx.q.sql('select * from trades') pykx.Table(pykx.q(' sym mcap ex ------------------- ibm 2000 nasdaq msft 4000 nasdaq apple 9000 DAX samsung 6000 Dow '))
- Creating q code block with syntax highlighting in a message
- Adding inline code to your questions & messages
-
rocuinneagain
MemberJune 9, 2023 at 12:00 am in reply to: Decimal type or representing very big numbers -
-
rocuinneagain
MemberJune 7, 2023 at 12:00 am in reply to: Apply a list of parameters to a list of inputq)b@'(0;2;1)
1 76 12
-
Link to your original post for reference:
You can test yourself and compare time and memory usage:
- https://code.kx.com/q/basics/syscmds/#ts-time-and-space
- https://code.kx.com/q/wp/columnar-database/
- https://code.kx.com/q/ref/set-attribute/
//Try and time the queries to compare \ts select last price by hour:60 xbar time.minute, sym from trade \ts select last price by sym,hour:60 xbar time.minute from trade //If they run very fast you can run them N number of times to get more accurate result //Running 100 times here \ts:100 select last price by hour:60 xbar time.minute, sym from trade \ts:100 select last price by sym,hour:60 xbar time.minute from trade //Attributes are useful in kdb+ //Apply grouped on sym and test update `g#sym from `trade \ts:100 select last price by hour:60 xbar time.minute, sym from trade \ts:100 select last price by sym,hour:60 xbar time.minute from trade //Removed grouped and test again update `#sym from `trade \ts:100 select last price by hour:60 xbar time.minute, sym from trade \ts:100 select last price by sym,hour:60 xbar time.minute from trade
-
rocuinneagain
MemberJune 1, 2023 at 12:00 am in reply to: pip install kxi – ERROR: No matching distribution found for kxiOnly PyKX has been released on open PyPi in that way.
The correction to the documentation for kxi will be online soon.
-
The issue you are having is unrelated to peach/multithreading on the kdb+ side. The issue is the reuse of the same connection among@taskblocks. The different @tasks are attempting to read data from the same connection concurrently leading to junk data being passed through. kdb+ processes incoming queries sequentially. This means even through you see the log messages from the tasks as if they run in parallel in fact once these arrive to kdb+ they will be processed one after the other always. For this reason switching to @flow will not be slower and will result is safe consistent results.
-
rocuinneagain
MemberJune 1, 2023 at 12:00 am in reply to: pip install kxi – ERROR: No matching distribution found for kxiPass your credentials and the URL to the KX repository:
pip install --extra-index-url=https://$KX_PYPI_USER:$KX_PYPI_PASS@nexus.dl.kx.com/repository/kxi/simple/ kxi
The documentation will be updated to correct this.
-
The issue you are having is unrelated to peach/multithreading on the kdb+ side.
The issue is the reuse of the same connection among
@task
blocks.The different
@tasks
are attempting to read data from the same connection concurrently leading to junk data being passed through.kdb+ processes incoming queries sequentially. This means even through you see the log messages from the tasks as if they run in parallel in fact once these arrive to kdb+ they will be processed one after the other always. For this reason switching to
@flow
will not be slower and will result is safe consistent results. -
Hi,
- Are you running PyKX under Prefect? http://www.prefect.io
- Are you connecting and querying using PyKX in
@task
or@flow
? - If using
@task
does switching to@flow
(.i.e subflows) stop the issue happening? - Do you see the same issue if you query in a standalone python process outside of Prefect?
- Are you making a single query when the issue happens or are multiple queries being run?
- What version of PyKX are you running?
pykx.__version__
- Are you running in licensed or unlicensed mode?
pykx.licensed
- How did you create the connection
conn
?
-
1. There is no need for
raze
to be included.q)select type close by sym from daily
sym | close ----| ------ AAPL| 9h AIG | 9h AMD | 9h ..
Float vectors are being passed to your function (type
9h
).raze
has no effect on these.2.
select size by sym from daily
only does grouping as no aggregate function is included.It is the same as
select {x} size by sym from daily
Including a real aggregate would be
select last5 size by sym from daily
-
rocuinneagain
MemberMay 30, 2023 at 12:00 am in reply to: registry.dl.kx.com credentials – how to obtain?To gain access please contact KX at licadmin@kx.com