Hi,

If i remember correctly, the default behavior of the to_sql method is to use a transaction to insert the data.

What i do is using with statement to ensure that the transaction is commited and closed after the insert:

with engine.connect() as conn:
    train_df.to_sql(name='table1', con=conn, if_exists='replace', index=False)

Otherwise, you can commit the transaction manually:

conn = engine.connect()
train_df.to_sql(name='table1', con=conn, if_exists='replace', index=False)
conn.commit()
conn.close()

That's what i do, hope it helps.

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.

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}")

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.

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

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-...

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