Base SSAS Server#
Base Server Interface containing the methods used outside of instance lifetime management.
Source code in pbi_core/ssas/server/server.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
default_db
instance-attribute
#
The default DB to use when executing DAX
check_ssas_sku #
Checks if the SSAS instance is running the correct SKU version.
Tests this assumption by running a query that should fail if the SKU under 1400 (image save command). Since we could also fail due to the server not being instantiated, we use a backoff decorator to retry the command a few times before giving up.
Raises:
Type | Description |
---|---|
TypeError
|
If the SSAS instance is running an incorrect SKU version. |
ValueError
|
If the SSAS instance is not running or the command fails for another reason. This is used to trigger the backoff retry. |
Source code in pbi_core/ssas/server/server.py
conn #
conn_str #
Formats the connection string for connecting to the background SSAS instance.
Source code in pbi_core/ssas/server/server.py
query_dax #
db_name: when bool and == True, uses the DB last loaded by this server instance.
(almost always the db of the loaded PBI unless you're manually reassigning server instances) when None or False, no db is supplied when a string, just passed to the client
Source code in pbi_core/ssas/server/server.py
query_xml #
Submits an XMLA query to the SSAS instance and returns the result as a BeautifulSoup object.
The query should be a valid XMLA command.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
str
|
The XMLA query to execute. |
required |
db_name
|
str | None
|
The name of the database to execute the query against. |
None
|
Returns:
Name | Type | Description |
---|---|---|
BeautifulSoup |
BeautifulSoup
|
The result of the query parsed as a BeautifulSoup object. |
Source code in pbi_core/ssas/server/server.py
remove_invalid_db_name_chars
staticmethod
#
Utility function to convert a PBIX report name to an equivalent name for the DB in the SSAS instance.
Note
Raises a warning if the db_name is changed to inform user that the db_name does not match their input
Source code in pbi_core/ssas/server/server.py
sanitize_xml
staticmethod
#
Method to XML-encode characters like "&" so that the Adomd connection doesn't mangle the XMLA commands.
tabular_models #
Creates a list of the Tabular models existing in the SSAS server.
Note
Generally tabular models in the local environment correspond 1-1 with a PBIX report open in the Desktop app