Skip to content

vertipaq_analyzer fails for Certain Datasets #276

@Jai-Prakash-HU

Description

@Jai-Prakash-HU

It is not working for some dataset.
I couldn't understand the reason.

error log:

AttributeError Traceback (most recent call last)
Cell In[82], line 50
47 for Workspace_Id, Workspace_Name, Dataset_Id, Dataset_Name in zip(Workspace_Id_list, Workspace_Name_list, Dataset_Id_list, Dataset_Name_list):
48 print(f"Running Vertipaq for Workspace: {Workspace_Name} Dataset: {Dataset_Name} DatasetId: {Dataset_Id} ")
---> 50 labs.vertipaq_analyzer(dataset = Dataset_Name , workspace = Workspace_Name , export = 'table')
53 timestamp = datetime.now()
54 result_status = 'Vertipaq scan complete.'

File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy/_utils/_log.py:310, in mds_log..get_wrapper..log_decorator_wrapper(*args, **kwargs)
307 raise
309 try:
--> 310 result = func(*args, **kwargs)
312 # The invocation for get_message_dict moves after the function
313 # so it can access the state after the method call
314 message.update(extractor.get_completion_message_dict(result, arg_dict))

File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy_labs/_vertipaq.py:136, in vertipaq_analyzer(dataset, workspace, export, read_stats_from_data, **kwargs)
70 workspace = fabric.resolve_workspace_name(workspace)
72 vertipaq_map = {
73 "Model": {
74 "Dataset Name": [icons.data_type_string, icons.no_format],
(...)
133 },
134 }
--> 136 dfT = list_tables(dataset=dataset, extended=True, workspace=workspace)
137 dfT.rename(columns={"Name": "Table Name"}, inplace=True)
138 columns_to_keep = list(vertipaq_map["Tables"].keys())

File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy_labs/_list_functions.py:127, in list_tables(dataset, workspace, extended)
123 with connect_semantic_model(
124 dataset=dataset, workspace=workspace, readonly=True
125 ) as tom:
126 if extended:
--> 127 dict_df = fabric.evaluate_dax(
128 dataset=dataset,
129 workspace=workspace,
130 dax_string="""
131 EVALUATE SELECTCOLUMNS(FILTER(INFO.STORAGETABLECOLUMNS(), [COLUMN_TYPE] = "BASIC_DATA"),[DIMENSION_NAME],[DICTIONARY_SIZE])
132 """,
133 )
134 dict_sum = dict_df.groupby("[DIMENSION_NAME]")["[DICTIONARY_SIZE]"].sum()
135 data = fabric.evaluate_dax(
136 dataset=dataset,
137 workspace=workspace,
138 dax_string="""EVALUATE SELECTCOLUMNS(INFO.STORAGETABLECOLUMNSEGMENTS(),[TABLE_ID],[DIMENSION_NAME],[USED_SIZE])""",
139 )

File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy/_utils/_log.py:310, in mds_log..get_wrapper..log_decorator_wrapper(*args, **kwargs)
307 raise
309 try:
--> 310 result = func(*args, **kwargs)
312 # The invocation for get_message_dict moves after the function
313 # so it can access the state after the method call
314 message.update(extractor.get_completion_message_dict(result, arg_dict))

File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy/fabric/flat.py:781, in evaluate_dax(dataset, dax_string, workspace, verbose, num_rows)
755 """
756 Compute DAX <https://learn.microsoft.com/en-us/dax/>
query for a given dataset.
757
(...)
776 :class:~sempy.fabric.FabricDataFrame holding the result of the DAX query.
777 """
779 # creating client directly to avoid any workspace access if not needed
780 # a user can have access via XMLA to a dataset, but may not have access to the workspace
--> 781 return DatasetXmlaClient(workspace, dataset).evaluate_dax(dax_string, verbose, num_rows)

File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy/fabric/_client/_base_dataset_client.py:202, in BaseDatasetClient.evaluate_dax(self, query, verbose, num_rows)
184 """
185 Retrieve results of DAX query as a FabricDataFrame.
186
(...)
199 FabricDataFrame converted from the results of a DAX query.
200 """
201 df = self._evaluate_dax(query, verbose, num_rows)
--> 202 return FabricDataFrame(df, dataset=self.resolver.dataset_name, workspace=self.resolver.workspace_name)

File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy/fabric/_dataframe/_fabric_dataframe.py:184, in FabricDataFrame.init(self, data, column_metadata, dataset, workspace, verbose, *args, **kwargs)
179 from Microsoft.AnalysisServices import OperationException
181 try:
182 self.column_metadata = _get_or_create_workspace_client(workspace)
183 .get_dataset_client(dataset)
--> 184 .resolve_metadata(self.columns, verbose)
185 except (WorkspaceNotFoundException, OperationException, DatasetNotFoundException) as e:
186 if verbose > 0:

File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy/fabric/_client/_base_dataset_client.py:406, in BaseDatasetClient.resolve_metadata(self, columns, verbose)
403 database = self.resolver.workspace_client.get_dataset(self.resolver.dataset_name)
405 column_map = defaultdict(lambda: [])
--> 406 for table in database.Model.Tables:
407 for column in table.Columns:
408 column_data = self._get_column_data(table, column)

AttributeError: 'NoneType' object has no attribute 'Tables'

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions