go to post Guillaume Rongier · Aug 29 Here, those scripts are embedded python script, which are different from python script. For whatever reason, embedded python iris module is called iris and official driver is also called iris from this wheel intersystems_irispython-3.2.0-py3-none-any.whl. This create confusion and package collision, an community edition exist that solve this issue and allow you to use them both, you can install it from here : https://github.com/intersystems-community/intersystems-irispython Another option is to use the iris wrapper : https://pypi.org/project/iris-embedded-python-wrapper/ Works well on macos, and i'm looking for feedback on windows machines.
go to post Guillaume Rongier · Aug 29 Hi, My bet is that you are using web server port 52773 instead of 1972 Try this : import iris # Open a connection to the server args = {'hostname':'127.0.0.1', 'port':1972, 'namespace':'USER', 'username':'_SYSTEM', 'password':'SYS' } try: conn = iris.connect(**args) # Create an iris object irispy = iris.createIRIS(conn) except Exception as e: # Handling the exception and printing the error print(f"An error occurred: {e}")
go to post Guillaume Rongier · Aug 27 You didn't specify the FROM --platform=linux/amd64 $IMAGE on the final part
go to post Guillaume Rongier · Jul 29 Thanks for this feedback, this is very helpful for our implementation of WSGI/ASGI. As you can see it's still a work in progress, but we are working hard to make it better. We will have a look at the cookie issue, we encountered it as well, but we haven't gone deep into it yet as you did. Your feedback will help us, thanks again. For the ASGI Post issue, it's also a known issue, that will be fixed in the next release. We also plan to add more features to the WSGI/ASGI implementation, like the ability to reload the server with a button click/a command line. We will have a look also at the WebSockets support.
go to post Guillaume Rongier · Jul 11 Hi @ala zaalouni, When you encounter this error : The error appears: "An error has occurred: iris.cls: error finding class" This usually mean that the Iop framework is not loaded into iris. pip install iris-pex-embedded-python you must init it to iris (install the associated classes to iris), for that you must do : iop --init or from iop import Utils Utils.setup() please refer to the documentation : https://github.com/grongierisc/interoperability-embedded-python?tab=read... For the more, make sure you are on the right namespace by specifying the var env : $IRISNAMESPACE
go to post Guillaume Rongier · May 15 I would try something like this : ClassMethod "test_dict"() { set pythonObj = ##class(%SYS.Python).Bytes("toto") set dict = ##class(%SYS.Python).Builtins().dict() do dict."__setitem__"("my_bytes", pythonObj) w !, dict."__getitem__"("my_bytes") }
go to post Guillaume Rongier · May 15 Great app, I see that you made an extensive use of IoP (https://github.com/grongierisc/interoperability-embedded-python), how was th user experience ? do you plan to use it again ?
go to post Guillaume Rongier · May 13 Great application, do you know that iris now support wsgi app : https://docs.intersystems.com/iris20241/csp/docbook/Doc.View.cls?KEY=AWSGI For the more, you did a pretty good job with a python only app, can you have a look at this one and tell me if you wish to learn more about Iop (Interoperability on python, the backend framework of this app): https://community.intersystems.com/post/vector-search-and-rag-retrieval-...
go to post Guillaume Rongier · Apr 11 For this given python function : file name demo.py def return_tuple(): return 1, 2, 3 To retrieve the values in ObjectScript, you can use the following code, basically use dunder methods to access the values. set return = ##class(%SYS.Python).Import("demo")."return_tuple"() write return."__len__"() // 3 write return."__getitem__"(0) // 1 write return."__getitem__"(1) // 2 write return."__getitem__"(2) // 3
go to post Guillaume Rongier · Mar 27 Hi Rob, This is indeed very impressive result. I do have a dumb question, why are you using your superserver port called mgsi instead of the default one provided by IRIS?
go to post Guillaume Rongier · Mar 26 it passes the parameter iAge to the sql statement. the sql statement have one parameter ?, so it will take place here.
go to post Guillaume Rongier · Mar 15 Once again, can we wrote a wrapper class for JDBC driver, eg : com.intersystems.dc.jdbc.IRISJDBCDriver, and use it to connect to IRIS? The wrapper can be a public repository, and published to maven central, so that it can be used by anyone. Like that no conflict with the official driver, and we can use it in any project. Downside is that the name is not the same, so we need to change the driver name in the code, but it's a small price to pay.
go to post Guillaume Rongier · Mar 15 Hi, As you are in Aync mode, it's a bit tricky to get the end time. In sync mode, you just have to wait for the answer to be back. In this case I would use the session id from the message that is going out of the business service to the BO. So in the BS, try something like this: Method OnProcessInput( pDocIn As %RegisteredObject, Output pDocOut As %RegisteredObject) As %Status { // here you need to pass the jobid from the %CSP.REST that is invoking the BS set tJobId = pDocIn.JobID // your code here set ^CallApi($CLASSNAME(),tJobId,"sessionid") = ..%SessionId set pDocOut = pDocIn quit $$$OK } Then in the BO, you can use the session id to get the information from the global. Method MyAsyncMethod( pRequest As %RegisteredObject, Output pResponse As %RegisteredObject) As %Status { set tSessionId = ..%SessionId // lookup for the good session id for { set tClassname = $ORDER(^CallApi(tClassname)) quit:tClassname="" for { set tJobId = $ORDER(^CallApi(tClassname,tJobId)) quit:tJobId="" if ^CallApi(tClassname,tJobId,"sessionid") = tSessionId { set ^CallApi(tClassname,tJobId,"End") = $HOROLOG quit } } } // your code here quit $$$OK } I hope this helps.
go to post Guillaume Rongier · Mar 14 Maybe a dumb idea, why not create a community edition of those driver as they are already publish on https://github.com/intersystems-community/iris-driver-distribution. It's already done for docker : https://hub.docker.com/r/intersystemsdc/iris-community Why not for maven ?
go to post Guillaume Rongier · Mar 14 Thanks @Corentin Blondeau and @Amaury Hashemi for sharing code/ideas and tools.
go to post Guillaume Rongier · Feb 29 thanks @Ron Sweeney, I take good note of your tips for debugging, because it can become quickly a mess with too much info in ^ISCLOG