Encontrar

Question
· Oct 13, 2023

Python Integration Issues on Remote IRIS Server

Hi everyone, 

I'm attempting to compile a basic Python code on a remote server, but it appears that the compiler doesn't recognize the language.

The remote server is running a virtual machine with Oracle Linux Server 7.9 (64-bit), and it has IRIS for UNIX (Red Hat Enterprise Linux for x86-64) 2021.1 (Build 215U) [HealthConnect:3.3.0] installed.

When I try to compile a script that includes a Python ClassMethod, such as this "testpy.cls":

ClassMethod python() As %Status [ Language = python ]
{
    # prova python
    print("hello world")
}

This error returns (Error #5486: Invalid method language / Error #5030 An error occurred while compiling class '<className>'): 

Compilation started on 10/13/2023 17:01:41 with qualifiers 'cuk'
Compiling class <className>
ERROR #5486: Invalid method language: <className>:MethodName:python
  > ERROR #5030: An error occurred while compiling class '<className>'
Detected 1 errors during compilation in 0.090s.

I've attempted to follow the instructions provided on this page: Python Prerequisites, but I couldn't resolve this problem. The problem persisted, even after executing "sudo su -" command to obtain root privileges before trying to install python3 or a python package, like numpy, through the command "yum install python3".

I also attempted to write some ObjectScript code, recalling ##class(%SYS.Python).Builtins() or ##calls(%SYS.Python).Shell(), such as: 

ClassMethod HelloWorld() As %Status
{
    set pythonBuiltins = ##class(%SYS.Python).Builtins()
    do pythonBuiltins.print("hello world")
}

However, I encountered an error indicating that these methods do not exist.

The same Python codes work fine on my local instance of IRIS and I can't figure out why they doesn't work on the remote server instance.

I've identified the path of the Python packages folder on my computer (C:\InterSystems\IRISHealth\mgr\python) and noticed the only big difference between the local and remote instances. While the local folder includes several subfolders (such as numpy, pandas, etc.), the corresponding folder on the remote server (u01/<instanceName>/mgr/python) is empty, despite multiple attempts to install python3 and packages like numpy or pandas, even if executed directly from the mgr/python folder. 

It is like Python and its packages are installed but invisible. In fact, if I try to run the command yum install python3 again, it returns this message, even if the folder is still empty:

Loaded plugins: langpacks, ulninfo
Package python3-3.6.8-19.0.1.el7_9.x86_64 already installed and latest version
Nothing to do

I've tried to clean some space on the remote server and re-tried the installation with 2.5 Gb of free space available, but nothing changed. 

Does anybody know how to handle this?

4 Comments
Discussion (4)1
Log in or sign up to continue
Question
· Oct 10, 2023

ERREUR <Ens>ErrCanNotAcquireJobRootLock avec sqlalchemy et embedded python

Avec l'approche Python, je rencontre l'erreur suivante :

ERREUR <Ens>ErrCanNotAcquireJobRootLock: Impossible d'obtenir un verrouillage pour l'enregistrement de la globale


Ci-dessous le code implémenté :

import pandas as pd
from sqlalchemy import create_engine, types


class FileOperationEmbedded(BusinessOperation):
    tablename = None
    engine = None

    def on_init(self):
        if not hasattr(self, "dsnIris"):
            self.dnsIris = 'iris+emb:///'
        if not hasattr(self, "schema"):
            self.schema = 'Toto'

        self.engine = create_engine(self.dnsIris)
        return None

    def on_message(self, request:DFrameRequest):
        df = pd.DataFrame(request.dframe.col)

        for row in request.dframe.col:
            df = pd.DataFrame.from_dict(row, orient='index').T.reset_index(drop=True)
            try:
                df.to_sql(name=self.tablename, con=self.engine, if_exists='append', index=False, schema=self.schema,
                          dtype={'id': types.INTEGER, 'col_type': types.VARCHAR(50), 'col_center': types.VARCHAR(50),
                                 'col_name': types.VARCHAR(50), 'col_issue_name': types.VARCHAR(50),
                                 'col_model': types.VARCHAR(50), 'col_treatment': types.VARCHAR(50),
                                 'source': types.VARCHAR(50), 'filename': types.VARCHAR(100), 'created_at': types.TIMESTAMP})
            except Exception as e:
                self.log_info(f"Une erreur s'est produite : {e}")

        return None


Avez-vous une idée d'où pourrait provenir l'erreur et quel la marche suivre pour résoudre le problème ?

1 Comment
Discussion (1)1
Log in or sign up to continue
Question
· Oct 9, 2023

Create a cube sourcing a MS-SQL linked class/table

Hello all,

I'm trying to build a cube based on a linked table but seems that IRIS is not able to do it :O

Long story short, I have a linked table in IRIS that sources a Microsoft SQL table (using standard linked feature from the portal). It works fine, I can access it using SQL as many other times. On top of that, I've created in DeepSee (ok, Analytics) a cube that uses this class as source. It compiles correctly, no errors given. When I build it with 100 records, all goes well and using Analyzer I can see results.

Existing cube deleted.
Fact table built:             1,000 fact(s) (Max number of worker(s) used at a time: 1)
Fact indices built:           1,000 fact(s) (1 worker(s) used)

Complete
Elapsed time:                  1.788246s
Source expression time:        0.000856s

 

The problem comes when I try to build with more than 1000 records, I get this weird error:

ERREUR #5540: SQLCODE : Message 400 : Process 11156 failed to compile Cached Query Class %sqlcq.USER.cls151 with these errors:
ERREUR #5002: Erreur ObjectScript: <MAXSTRING>CompileRtns+282^%occRoutine
  > ERREUR #5030: Une erreur s'est produite lors de la compilation de la classe %sqlcq.USER.cls151
ERREUR #5002: Erreur ObjectScript: <NOROUTINE>DescribePhase2+9^%occSysDescriptor *%sqlcq.USER.cls151.1
SQLTEXT: SELECT %ID,BLNumber "DxBLNumber",BookingNumber "DxBookingNumber",CargoCycleId "MxCargoCycleIdN",EMECargoCycleNumber "DxEMECargoCycleNumber",EmptyFull ...

For what I can see,  somehow the system is trying to build a select that is throwing MAXSTRING error. Weird.

So, I tried to other way round: I've imported all the records into a class in IRIS with the exact same properties and records. And it works! :-O Building the cube with millions of records goes smoothly.

At this point, I guess something is preventing the cube to write on temporary globals when using the cube sourcing the linked database. Or that maybe this is simply not possible. Anyone has gone into same situation and has a trick or solution for this? 

Thanks for reading me :)

1 Comment
Discussion (1)0
Log in or sign up to continue
Announcement
· Oct 6, 2023

[Video] Embedded Source Control with Git & Containers

Hi Community,

Watch this video to learn how to leverage embedded (server-side) source control in a build pipeline using the git- source-control package and other additional tools:

⏯ Embedded Source Control with Git & Containers @ Global Summit 2023

🗣 Presenter: @Pravin Barton, Senior Applications Developer, InterSystems

Subscribe to our YouTube channel InterSystems Developers to get the latest updates!

2 Comments
Discussion (2)2
Log in or sign up to continue
Question
· Oct 5, 2023

Routing rule equivalence question

Is there a difference in outcome between the two screengrabs below?

In both cases, when  certain conditions are met, a transformation is called and the output sent on to two targets. In the first case we surmise the transformation is called twice, and the output of the first run sent to the first target, the output of the second run to the second target. In the second case we surmise the transformation is called once, and the output duplicated and sent to the two targets. 

  • Are there any cases where they would not be functionally the same (eg because of side-effects of the transformation?)
  • Could there be performance differences - from only calling the transformation once rather than twice? If so, how significant could those be in a Production handling 40K-50K messages a day (Healthcare, HL7), especially since this pattern of coding is replicated in several places across the production.

2 Comments
Discussion (2)1
Log in or sign up to continue