S-C-O-U-T / Pyadomd

A pythonic approach to query SSAS data models.
https://pyadomd.readthedocs.io/en/latest/index.html
Apache License 2.0
25 stars 6 forks source link

Unable to execute Select statements #14

Closed ngutha closed 2 years ago

ngutha commented 2 years ago

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())

S-C-O-U-T commented 2 years ago

Bug fix #15 new release on PyPi upgrade with:

pip install pyadomd --upgrade