go to post Guillaume Rongier · Aug 29, 2024 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, 2024 You didn't specify the FROM --platform=linux/amd64 $IMAGE on the final part
go to post Guillaume Rongier · Jul 29, 2024 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, 2024 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, 2024 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, 2024 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, 2024 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, 2024 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, 2024 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, 2024 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, 2024 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, 2024 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, 2024 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, 2024 Thanks @Corentin Blondeau and @Amaury Hashemi for sharing code/ideas and tools.
go to post Guillaume Rongier · Feb 29, 2024 thanks @sween, I take good note of your tips for debugging, because it can become quickly a mess with too much info in ^ISCLOG
go to post Guillaume Rongier · Feb 13, 2024 Thank you for your kind words, I'm glad you liked the article. I've read your article and it's a great use case of Embedded Python in IRIS. I noticed that you are making an extensive use of the language tags ( [ language = python ])in your article. In this article, I try to explain how I try to move away from the language tags and instead stick with only ObjectScript code and use the ##class(%SYS.Python).Import() method to call Python code from ObjectScript or even have a python first approach. Since you are using the language tags, I'm curious to know if you have tried the ##class(%SYS.Python).Import() method or a python first approach and if so, what are the advantages and disadvantages of using the language tags over the ##class(%SYS.Python).Import() method and the python first approach? Are you agree with me on all the drawbacks of using the language tags ( it's not Pythonic, it's not ObjectScript either, you don't have a debugger, you don't have a linter, you mixing two language in the same file, when you process crashes, you don't have a stack trace, ... ) ?