Eduard Lebedyuk · Aug 3, 2020 go to post

Restarting is the easiest way.

If you can't just overwrite global buffer with another global (but check that your target global is really flushed out of global buffer).

Eduard Lebedyuk · Jul 28, 2020 go to post

Python Gateway - invoke Python code snippets for your analytics and machine-learning related tasks

Are there any docs or guides on that feature?

Eduard Lebedyuk · Jul 27, 2020 go to post

If the method is inherited in a Persistent class, it won't compile.  

You can easily modify the method to ignore abstract method if they are system (start with %) or originate from system classes (start with %).

It looks as though it checks for the name of the abstract method but not the number of parameters the method requires.

You can modify checker to check whatever you need.

Also, if I add another parameter in addition to the parameters listed, this also seems to be ok.  

It is, inherited method can accept more arguments than a parent method.

Do you know if there are plans for the compiler to check for the implementation of abstract methods instead of having to inherit code to do this?

Please file a WRC issue.

Eduard Lebedyuk · Jul 27, 2020 go to post

You can easily add your own compile-time check via method generators. Here's an example which checks that all abastract methods are implemented.

Class Test.AbstractChecker
{

ClassMethod Check() As %Status [ CodeMode = objectgenerator, ForceGenerate ]
{
    #Dim sc As %Status = $$$OK
    
    // Get class name from %compiledclass object which is an instance of a currently compiled class
    Set class = %compiledclass.Name

    // Iterate over class methods.
    // You can also use %class object to iterate
    Set method=$$$comMemberNext(class, $$$cCLASSmethod, "")
    While method'="" {
        
        // Get mthod abstract state
        Set abstract = $$$comMemberKeyGet(class, $$$cCLASSmethod, method, $$$cMETHabstract)
        
        // Quit iteration when we find any abstract compiled method
        If abstract {
            set origin = $$$comMemberKeyGet(class, $$$cCLASSmethod, method, $$$cMETHorigin)
            Set sc = $$$ERROR($$$GeneralError, $$$FormatText("Abstract method %1 in class %2 not implemented (origins from %3)", method, class, origin))
            Quit
        }
        
        // Get next method
        Set method=$$$comMemberNext(class, $$$cCLASSmethod, method)        
    }
    Quit sc
}

}

After adding this class to inheritance I get an error on compilation:

Eduard Lebedyuk · Jul 19, 2020 go to post

PythonGateway does not have this limitation with global transfer and sql procedure for SQL access. Recently I've done an ml poc with a data set 6400 columns wide without issues.

Eduard Lebedyuk · Jul 16, 2020 go to post

How do I reference parent from child if parent id is composite?

Here's my global:

^data("idA", "idB") = "Parent"
^data("idA", "idB", 1) = "Child"

And Class is:

Class Parent {
Property IdAProp;
Property IdBProp;
}

SQL Storage for Parent works.

For Child I have tried:

<Subscript name="1">
<Expression>{User.Parent.IdAProp}</Expression>
</Subscript>
<Subscript name="2">
<Expression>{User.Parent.IdBProp}</Expression>
</Subscript>
<Subscript name="3">
<Expression>{Position}</Expression>
</Subscript>

But compilation fails with:

ERROR #5547: Map: Map1 - Subscript Expression - invalid expression '{User.Parent.IdAProp}'.  Must be a valid field reference.    If this is the Master Map, it must be an IDKEY field.
  > ERROR #5030: An error occurred while compiling class 'User.Children'

UPD. SQL schema name should be used, not class.

Eduard Lebedyuk · Jul 15, 2020 go to post
Class SerialA Extends (%SerialObject, %XML.Adaptor) [ ProcedureBlock ]
{
      Property SerialB as SerialB;
     Property SerialC as SerialC(XMLPROJECTION = "NONE");
}
Eduard Lebedyuk · Jul 15, 2020 go to post

Please consider posting your question with sample code to reproduce your issue as a separate question.

Eduard Lebedyuk · Jul 13, 2020 go to post

You can create your own snippets in VSCode.

For example here's snippet code for BS

Class ${1:class} Extends Ens.BusinessService
{

Parameter ADAPTER = "${2:adaptor}";

Property Adapter As ${2:adaptor};


Method OnProcessInput(pInput As %RegisteredObject, Output pOutput As %RegisteredObject, ByRef pHint As %String) As %Status
{
    Quit $$$ERROR($$$NotImplemented)
}
}
Eduard Lebedyuk · Jul 13, 2020 go to post

Well, I'm out of ideas.

Check that this global contains all references to Ensemble namespaces (under restricted user):

zw ^%SYS("Ensemble","InstalledNamespace")

Contact the WRC?

Eduard Lebedyuk · Jul 13, 2020 go to post

Does the two resultsets also output a limited list of namespaces (under limited user):

Do ##class(%SYS.Namespace).ListAll(.NspAllList,0)
Do ##class(%CSP.Portal.Utils).%GetNamespaceList(.NspList)
Zw NspAllList. NspList
Eduard Lebedyuk · Jul 13, 2020 go to post

Have you logged out the user? Old session retains old permissions.

Can the user open Message Viewer by a direct URL in browser?

Eduard Lebedyuk · Jul 13, 2020 go to post

I'm creating a new SQL storage:

However I don't have "Next" button enabled. And if I press "Finish" I exit the WIzard.

How do I get to this screen?

Eduard Lebedyuk · Jul 13, 2020 go to post

I'm also using ODBC3.5 and I was unable to reproduce your issue.

Here's what I tried:

import pyodbc
import pandas as pd
cnxn=pyodbc.connect(('DSN=MYDSN'),autocommit=True)
Data=pd.read_sql('SELECT TOP 10 DOB, RandomTime, TS FROM isc_py_test.Person',cnxn)
Data
Data.info()

And here's the output I got:

          DOB RandomTime                  TS
0  1977-07-18   07:49:03 1993-10-31 17:23:25
1  2001-11-08   07:45:05 2005-12-25 04:11:22
2  2004-02-20   23:17:49 1981-08-31 02:08:10
3  1995-11-22   01:46:31 2010-05-20 11:25:31
4  1974-01-09   15:20:03 1974-12-22 13:49:00
5  1987-10-19   23:14:52 1974-10-02 17:48:37
6  1985-03-29   17:47:12 1978-02-24 06:40:51
7  2015-10-21   23:09:15 2006-08-29 16:30:29
8  1972-12-26   15:53:23 1996-12-06 03:13:26
9  1990-09-25   05:53:25 2000-03-22 05:54:57

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 10 entries, 0 to 9
Data columns (total 3 columns):
DOB           10 non-null object
RandomTime    10 non-null object
TS            10 non-null datetime64[ns]
dtypes: datetime64[ns](1), object(2)
memory usage: 320.0+ bytes

Here's the source data I used (import and run Populate).

I recommend PythonGateway for Python workloads with InterSystems IRIS.

Can you share your dataset?

Eduard Lebedyuk · Jul 13, 2020 go to post

User needs USE permissions on the %Ens_MessageHeader resource to view Message Viewer page.

You can add custom role granting Use on the resource or add %EnsRole_Operator role to the user (note that it does add a lot more).

You can see it in the Management Portal: