Giter Club home page Giter Club logo

pyadomd's Introduction

pyadomd

A pythonic approach to query SSAS data models.

Documentation Status

Installation

pip install pyadomd

Query SSAS Tabular model

from sys import path
path.append('\\Program Files\\Microsoft.NET\\ADOMD.NET\\150')

from pyadomd import Pyadomd

conn_str = 'Provider=MSOLAP;Data Source=localhost;Catalog=AdventureWorks;'
query = """EVALUATE Product"""

with Pyadomd(conn_str) as conn:
    with conn.cursor().execute(query) as cur:
        print(cur.fetchall())

Integrates easily with pandas

from pandas import DataFrame

with Pyadomd(conn_str) as conn:
    with conn.cursor().execute(query) as cur:
        df = DataFrame(cur.fetchone(), columns=[i.name for i in cur.description])

FAQ

Q: I get the following exception?

System.IO.FileNotFoundException: Unable to find assembly 'Microsoft.AnalysisServices.AdomdClient'.
   at Python.Runtime.CLRModule.AddReference(String name)

A: This exception is most likely raised because you have'ent added the folder with the Microsoft.AnalysisServices.AdomdClient.dll to your path, before you import the pyadomd package.

Example:

from sys import path
#added to the path _before_ importing the pyadomd package
path.append('\\Program Files\\Microsoft.NET\\ADOMD.NET\\150')

from pyadomd import Pyadomd

Q: When I try to connect to an Azure Analysis Service instance I get:

Authentication faild: User ID and Password are required when user interface is not available?

A: This exception is most likely raised due to your "app" is not registered. Please follow the microsoft app registration documentation microsoft docs. The script: connect_to_ass.py (link to script) is a simple example on how to create a connection to a Azure Analysis Service. Please note that this is only an example, and not necessarily suitable for all apps.

pyadomd's People

Contributors

addlockwood avatar s-c-o-u-t avatar zsombor-egyed-trax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pyadomd's Issues

Numeric 0's are read-in to Python from SSAS as None/NaN

In _type_code.py, the function _option_type evaluates to None for, say, _option_type(datatype=float, data=0). This is generally incorrect--even though bool(0) evaluates to False for numeric 0s--as 0 is a valid value for float, and numeric fields in general. The same applies to how adomd_type_map is mapping System.Decimal as that is also a numeric field.

My proposed changes in _type_code.py are as follows:

to _option_type:

def _option_type(datatype, data):
    if data:
        return datatype(data)
    # Add in this clause to make sure numeric 0s are not mistakenly mapped
    elif datatype in [float, int] and (data==0):
        return datatype(0)
    else:
        return None

to adomd_type_map:

adomd_type_map:Dict[str, Type_code] = {
    'System.Boolean': Type_code(partial(_option_type, bool), bool.__name__),
    # Modify how decimals/doubles are handled to account for this as well
    'System.Decimal': Type_code(lambda x: Decimal.ToDouble(x) if x else (Decimal.ToDouble(0) if x==0 else None), float.__name__),
    'System.DateTime': Type_code(lambda x: datetime(x.Year, x.Month, x.Day, x.Hour, x.Minute, x.Second) if x else None, datetime.__name__),
    'System.Double': Type_code(partial(_option_type, float), float.__name__),
    'System.Int64': Type_code(partial(_option_type, int), int.__name__),
    'System.UInt64': Type_code(partial(_option_type, int), int.__name__),
    'System.String': Type_code(partial(_option_type, str), str.__name__),
    'System.Object': Type_code(lambda x: x, 'System.Object')
}

but I'm not sure this is the canonical "developer way" of doing it, so I will just leave this here.

type mapping issue for 'System.Guid', 'System.UInt32', 'System.Int16 etc

I got key_error for 'System.Guid', 'System.UInt32', 'System.Int16 etc

please add these lines to here: https://github.com/S-C-O-U-T/Pyadomd/blob/master/pyadomd/_type_code.py#L43

'System.Guid': Type_code(partial(_option_type, str), str.__name__),
'System.UInt32': Type_code(partial(_option_type, int), int.__name__),
'System.Int16': Type_code(partial(_option_type, int), int.__name__),
'System.Int32':  Type_code(partial(_option_type, int), int.__name__),

AdomdConnection() is not defined

I am trying to using the pyadomd package to connect to Azure AS cube servers. I have installed the package and the relevant drivers on databricks cluster. However, when I try to establish the connection, it throws the following error:
Screenshot 2023-04-21 at 10 07 32 AM

I understand that this is due to the Adomd client not added to path properly. But the current documentation mentions only about adding the path to a Windows system. What is the workaround when working on a macOS system or a databricks cluster?
Also, the Adomd client error also appeared while I tried to import the package. I defined a path variable to where the package is unpacked and then I was able to import it successfully. But while establishing the connection, this error is coming up!

AdomdConnection

When I try to instantiate the Pyadomd object on init, I get the error below:

"File 'C:\my_path\pyadomd.py', line 125, in init
"self.conn = AdomdConnection()"
"Name error: name 'AdomdConnection' is not defined".

I add the DLL to my path as specified in the README.md

I am able to successfully run the code below successfully in my interpreter with the AdomdConnection object:

from pyadomd import *
clr.AddReference('Microsoft.AnalysisServices.AdomdClient')
from Microsoft.AnalysisServices.AdomdClient import AdomdConnection, AdomdCommand
adoObj = AdomdConnection()
adoObj.ConnectionString = 'my_connection_string'
adoObj.Open()
print(adoObj.State)
1

DllNotFoundException: security.dll

Hi,

When I tried to access Analysis Services on Centos, I encountered DllNotFoundException: security.dll exception.

And copying this dll from Windows also doesn't work.

from sys import path
path.append('/usr/local/bin/') # which is dll files path

import pandas as pd
from pyadomd import Pyadomd

conn_str = "Provider=MSOLAP;DataSource=xxx.xxx;Catalog=xx;Integrated Security=SSPI;Persist Security Info=True;User ID=xxx;Password=***;"
query = '''

MDX Scripts...

'''

with Pyadomd(conn_str) as conn:
    with conn.cursor().execute(query) as cur:
        df = pd.DataFrame(cur.fetchone(),
                          columns=[i.name for i in cur.description])

Do you have any ideas?

Authentication Error

Hello Team,
Greetings of the Day!!!
Thank You in Advance for any Solution or Suggestion.

We are getting Authentication Error of Azure AD when PowerBI User is verified.

Code :
conn_str = 'Provider=MSOLAP;Data Source=localhost;Catalog=AdventureWorks;'
query = """EVALUATE Product"""

Error :

PS C:\Users\ND\Documents\Data Analytics\Assignmentsa\Python> python .\art.py
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Identity.Client.WsTrust.CommonNonInteractiveHandler.d__6.MoveNext()

The above exception was the direct cause of the following exception:

Microsoft.Identity.Client.MsalClientException: MSAL.Desktop.4.43.0.0.MsalClientException:
ErrorCode: parsing_wstrust_response_failed
Microsoft.Identity.Client.MsalClientException: There was an error parsing WS-Trust response from the endpoint. This may occur if there is an issue with your ADFS configuration. See https://aka.ms/msal-net-iwa-troubleshooting for more details. Error Message: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Identity.Client.WsTrust.CommonNonInteractiveHandler.d__6.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.AnalysisServices.AdomdClient.Authentication.MsalAuthenticationHandle.WaitAndGetActualAsyncTaskResult[TResult](Task1 task) at Microsoft.AnalysisServices.AdomdClient.Authentication.MsalAuthenticationHandle.UsernamePasswordAuthenticationHandle.AcquireTokenImpl(IPublicClientApplication app, IEnumerable1 scopes, String userId, SecureString password)
Inner Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Identity.Client.WsTrust.CommonNonInteractiveHandler.d__6.MoveNext()

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\ND\Documents\Data Analytics\Assignmentsa\Python\art.py", line 8, in
with Pyadomd(conn_str) as conn:
File "C:\Users\ND\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyadomd\pyadomd.py", line 158, in enter
self.open()
File "C:\Users\ND\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyadomd\pyadomd.py", line 140, in open
self.conn.Open()
Microsoft.AnalysisServices.AdomdClient.Authentication.AuthenticationException: Unable to obtain authentication token using the credentials provided. ---> Microsoft.Identity.Client.MsalClientException: There was an error parsing WS-Trust response from the endpoint. This may occur if there is an issue with your ADFS configuration. See https://aka.ms/msal-net-iwa-troubleshooting for more details. Error Message: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Identity.Client.WsTrust.CommonNonInteractiveHandler.d__6.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.AnalysisServices.AdomdClient.Authentication.MsalAuthenticationHandle.WaitAndGetActualAsyncTaskResult[TResult](Task1 task) at Microsoft.AnalysisServices.AdomdClient.Authentication.MsalAuthenticationHandle.UsernamePasswordAuthenticationHandle.AcquireTokenImpl(IPublicClientApplication app, IEnumerable1 scopes, String userId, SecureString password)
--- End of inner exception stack trace ---
at Microsoft.AnalysisServices.AdomdClient.Authentication.MsalAuthenticationHandle.UsernamePasswordAuthenticationHandle.AcquireTokenImpl(IPublicClientApplication app, IEnumerable`1 scopes, String userId, SecureString password)
at Microsoft.AnalysisServices.AdomdClient.Authentication.MsalAuthenticationHandle.MsalAuthenticationService.AuthenticateUser(AuthenticationOptions options, AuthenticationInformation authInfo, String userId, SecureString password)
at Microsoft.AnalysisServices.AdomdClient.Authentication.AuthenticationManager.Authenticate(AuthenticationOptions options, String identityProvider, String resource, String tenantId, String userId, String password, Boolean isForAsAzureRedirection)
at Microsoft.AnalysisServices.AdomdClient.ConnectionInfo.AcquireToken(IConnectivityOwner owner, String resource, String tenantId, Boolean isForAsAzureRedirection)
at Microsoft.AnalysisServices.AdomdClient.ConnectionInfo.ResolveHTTPConnectionPropertiesForPaaSInfrastructure(IConnectivityOwner owner, Uri& dataSourceUri, Boolean acquireAADToken, Boolean returnCloudConnectionAuthenticationProperties, String& paasCoreServerName, CloudConnectionAuthenticationProperties& cloudConnectionAuthenticationProperties)
at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenHttpConnection(ConnectionInfo connectionInfo, Boolean& isSessionTokenNeeded)
at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenConnectionAndCheckIfSessionTokenNeeded(ConnectionInfo connectionInfo)
at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenConnection(ConnectionInfo connectionInfo, Boolean& isSessionTokenNeeded)
at Microsoft.AnalysisServices.AdomdClient.XmlaClient.Connect(ConnectionInfo connectionInfo, Boolean beginSession)
at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.XmlaClientProvider.Connect()
at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.ConnectToXMLA(Boolean createSession, Boolean isHTTP)
at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.Open()
PS C:\Users\ND\Documents\Data Analytics\Assignmentsa\Python>

No Credentials Available in the Security Package

Hi,

I'm trying to connect to an open OLAP database. I have already installed the ADOMD client for Windows and haven't been able to connect succesfully.

The code I'm using is:

from sys import path
path.append("C:\\Program Files\Microsoft.NET\\ADOMD.NET\\160")

conn_str = 'Provider=MSOLAP;Password=Temp123!;User ID=DGIS15;Initial Catalog=Cubo solo sinba 2023;Data Source=pwidgis03.salud.gob.mx'

Pyadomd(conn_str).open()

where I get the following error

AdomdConnectionException: Authentication failed. ---> System.ComponentModel.Win32Exception: No credentials are available in the security package
   at Microsoft.AnalysisServices.AdomdClient.Sspi.SspiHelper.InitializeSecurityContext(SecHandle credentialHandle, SecHandle& contextHandle, String targetName, SecurityContextRequirements requirements, SecurityDataRepresentation targetDataRepresentation, SecurityBuffer[] input, SecurityBuffer[] output, SecurityContextRequirements& attributies)
   at Microsoft.AnalysisServices.AdomdClient.Sspi.NTAuthenticationSession.GetNextOutgoingToken(Byte[] incomingToken)
...
   at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenConnection(ConnectionInfo connectionInfo, Boolean& isSessionTokenNeeded)
   at Microsoft.AnalysisServices.AdomdClient.XmlaClient.Connect(ConnectionInfo connectionInfo, Boolean beginSession)
   at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.XmlaClientProvider.Connect()
   at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.ConnectToXMLA(Boolean createSession, Boolean isHTTP)
   at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.Open()

I have been able to succesfully connect to the database via Excel. Any ideas on what I could do?

These are open OLAP cubes supplied by the Mexican government, which is why I've supplied the credentials.

Unable to execute Select statements

Hi there,

Could you please have a look at the below two errors.

Example 1:
mdx_query: SELECT * FROM $system.MDSCHEMA_CUBES
Traceback (most recent call last):
File "C:\git\azure_cube.py", line 38, in
with conn.cursor().execute(mdx_query) as cur:
File "C:\Users\ngutha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pyadomd\pyadomd.py", line 73, in execute
adomd_type_map[self._reader.GetFieldType(i).ToString()].type_name
KeyError: 'System.UInt16'

Example 2:
mdx_query: SELECT * FROM $SYSTEM.DBSCHEMA_CATALOGS
Traceback (most recent call last):
File "C:\git\azure_cube.py", line 38, in
with conn.cursor().execute(mdx_query) as cur:
File "C:\Users\ngutha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pyadomd\pyadomd.py", line 73, in execute
adomd_type_map[self._reader.GetFieldType(i).ToString()].type_name
KeyError: 'System.Single'

The tool is working fine for DAX queries i.e. following code works well.
mdx_query = "SELECT DIMENSION_CAPTION AS [DIMENSION] FROM $system.MDSchema_Dimensions"
with Pyadomd(conn_str) as conn:
with conn.cursor().execute(mdx_query) as cur:
print(cur.fetchall())

Error: the specified workspace is not found

Hi there. We are currently using pyadomd to build out a test script in Windows 10, and are receiving the following traceback upon execution:

  File "c:\Users\yuzhang\Documents\pbi-XMLA\python\pbi-XMLA.py", line 40, in <module>
    with pyadomd.Pyadomd(connection_string) as conn:
  File "C:\Users\yuzhang\AppData\Local\Programs\Python\Python310\lib\site-packages\pyadomd\pyadomd.py", line 158, in __enter__
    self.open()
  File "C:\Users\yuzhang\AppData\Local\Programs\Python\Python310\lib\site-packages\pyadomd\pyadomd.py", line 140, in open
    self.conn.Open()
  Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException: The specified Power BI workspace is not found.

Our code:

from sys import path
path.append(r'C:\Program Files\Microsoft.NET\ADOMD.NET\160')
import pyadomd
 
url = r'powerbi://api.powerbi.com/v1.0/myorg/UAT'
connection_string = f"Provider=MSOLAP;Data Source={url};\
                                    Initial Catalog=Active_Lgl_Decom-Tree;Persist Security Info=True;\
                                    Impersonation Level=Impersonate;\
                                    Encrypt=False;\
                                    User ID=app{APPLICATION_ID}@{TENANT_ID};Password={SECRET_TOKEN};"
query = """select 
               [CATALOG_NAME] as DatabaseName,
               [SIZE] as Size
           from
               $SYSTEM.DBSCHEMA_CATALOGS"""

with pyadomd.Pyadomd(connection_string) as conn:
    with conn.cursor() as cursor:
        cursor.execute(query)
        for row in cursor:
            print(row)

We're sure that our URL is correct as we copied it directly from the workspace's settings in the Power BI interface. While we have reached out to Microsoft, we also wanted to check here as well to see if there are any known issues. Thank you!

@brianzy

namespace cannot appear under Envelope/Body/Execute/Command

Can view full full question on SO: https://stackoverflow.com/q/77646898/12711660

I am using pyadomd to connect into azure analysis services and trying to refresh a data model. The connection is successful but getting the following error "namespace http://schemas.microsoft.com/analysisservices/2003/engine) cannot appear under Envelope/Body/Execute/Command". I am assuming i am doing the XMLA command incorrectly? could be the way i have structured the XMLA command? i think xmlns namespace could has been deprecated or no longer available? any help greatly appreciated since there's not much documentation on this.

Unhandled exception when using Pyadomd as generator

I was trying to improve runtime of application and yield chunks from pyadomd, transform data and write it immediately.
Unfortunately faced unhandled exception:

File "C:\PythonEnv\CustomerProfiles2\lib\site-packages\pyadomd\pyadomd.py", line 94, in fetchmany
    l.append(next(self.fetchone()))
  File "C:\PythonEnv\CustomerProfiles2\lib\site-packages\pyadomd\pyadomd.py", line 81, in fetchone
    while(self._reader.Read()):
Microsoft.AnalysisServices.AdomdClient.AdomdUnknownResponseException: The server sent an unrecognizable response.
   at Microsoft.AnalysisServices.AdomdClient.XmlaClient.ReadEndElementS(XmlReader reader, String name, String ns)
   at Microsoft.AnalysisServices.AdomdClient.XmlaDataReader.InternalRead()

Logic to reproduce:

def get_data():
  chunk_size = 10000
  path.append('\\Program Files\\Microsoft.NET\\ADOMD.NET\\150')
  from pyadomd import Pyadomd
  
  with Pyadomd(source) as conn:
      with conn.cursor().execute(self.resource) as cur:
          while True:
              rows = cur.fetchmany(chunk_size)
              row_count = len(rows)
  
              if not rows:
                  break
  
              yield rows

def write_data(data):
  some_write_method()

def run(self):
  for chunk in get_data():
      write_customers(customers)

All rows are written successfully (unless you catch locking conflict when Tabular model is refreshed), but at the end last iteration throws an exception.

Having spent some time on it, I got that issue comes from line 93-94 lines of pydomd.py when retrieving next item which is not existing. For example if you have 6 rows to extract and you put chunk_size 1 or 2 or 3 then no exception occurs, but if you put 4 or 5, then you got exception, since first chunk passes ok and then second chunk is not complete.

SSAS Authentication issue

Hi

I'm getting the following authentication error when trying to use Pyadomd:

image

Do you know what might be a reason for that?

Not able to use User ID and Password when using connection string of Azure analysis server

When trying to use this library in Python application, the library is ignoring the credentials passed in the connection string. It again prompts with SSO screen for consent.

connection_string = "Provider=MSOLAP;Data Source=asazure://someas_url/someserver;Catalog=gfhfghtr;User ID=####;Password=####"

with Pyadomd(connection_string) as conn:
with conn.cursor().execute(generated_dax_query) as result:
df = pd.DataFrame.from_records(result.fetchone())
df.columns = [i.name for i in result.description]
tableresponse = st.table(df)

When using above connection string the system still prompts me to login, the library is not using the user id and password supplied to it.
sso

Please help to get it resolved, or to identify any additional steps missing

Thanks for your help

Python 3.9 and 3.10 support

As mentioned in this Stackoverflow post it seems that this library currently does not support Python 3.9 (originally released October 2020) or Python 3.10 (original released last month October 2021). When trying to install this library in with a Python 3.9 version using pip, I face the following error:

C:\Python39\libs> pip install pyadomd
Collecting pyadomd
  Using cached pyadomd-0.1.0.tar.gz (5.2 kB)
  Preparing metadata (setup.py) ... done
Collecting pythonnet
  Using cached pythonnet-2.5.2.tar.gz (1.9 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pycparser in c:\python39\lib\site-packages (from pythonnet->pyadomd) (2.20)
Using legacy 'setup.py install' for pyadomd, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pythonnet, since package 'wheel' is not installed.
Installing collected packages: pythonnet, pyadomd
    Running setup.py install for pythonnet ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\some_username\\AppData\\Local\\Temp\\2\\pip-install-xseq24q1\\pythonnet_bf3f0e493d964733872d8df8031a0b0a\\setup.py'"'"'; __file__='"'"'C:\\Users\\some_username\\AppData\\Local\\Temp\\2\\pip-install-xseq24q1\\pythonnet_bf3f0e493d964733872d8df8031a0b0a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\some_username\AppData\Local\Temp\2\pip-record-msa6cxi6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Python39\Include\pythonnet'
         cwd: C:\Users\some_username\AppData\Local\Temp\2\pip-install-xseq24q1\pythonnet_bf3f0e493d964733872d8df8031a0b0a\
    Complete output (6 lines):
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help

    error: option --single-version-externally-managed not recognized
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\some_username\\AppData\\Local\\Temp\\2\\pip-install-xseq24q1\\pythonnet_bf3f0e493d964733872d8df8031a0b0a\\setup.py'"'"'; __file__='"'"'C:\\Users\\some_username\\AppData\\Local\\Temp\\2\\pip-install-xseq24q1\\pythonnet_bf3f0e493d964733872d8df8031a0b0a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\some_username\AppData\Local\Temp\2\pip-record-msa6cxi6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Python39\Include\pythonnet' Check the logs for full command output.

To resolve... I believe the setup.py file needs to be updated to include an explicit callout for Python 3.9?

Error System.UInt64

Hi,

Thanks for developing this module for Python! Working fine so far, except for one thing.

When querying a DMV inside a Power BI report, I got an error pointing to data type problems. Turned out that a mapping was missing in _type_code.py.

Found a solution by adding the following line to _type_code.py
'System.UInt64': Type_code(partial(_option_type, int), int.__name__),

There might - of course - be others data types missing too, but this was the one that I came across.

Br,
Sören

using NetCore version

Hello,

This is not an issue but rather a request: have you tested using the .NET Core ADOMD package? This would allow extending usage to platforms other than Windows.

Cheers

Support for ExecuteNonQuery please

Hello, when I try and execute an xmla command in my case to run a backup of a model I get the error:

The result set returned by the server is not a rowset.

The command worked fine but as it uses ExecuteReader as the only option for execute it expects a rowset returned. Is there support for ExecuteNonQuery (https://learn.microsoft.com/en-us/dotnet/api/microsoft.analysisservices.adomdclient.adomdcommand.executenonquery?view=analysisservices-dotnet#microsoft-analysisservices-adomdclient-adomdcommand-executenonquery) somewhere I haven't found yet or can it be added?

I did a brief hack of adding a method to see if it can work and this seems to work:

def executenonquery(self, query:str) -> Cursor:
    """
    Executes a non query against the data source, output is number of rows affected

    :params [query]: The query to be executed
    """
    self._cmd = AdomdCommand(query, self._conn)
    self._row_count = self._cmd.ExecuteNonQuery()      

    return self

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.