Closed Jai-Prakash-HU closed 1 week ago
What happens when you run the 'run_model_bpa' function against the CHC_PIPE semantic model?
labs.run_model_bpa(dataset = 'CHC_PIPE', workspace = 'PBI_DMRD_DEV_CHC_PPIPE')
results are as belwo:
AttributeError Traceback (most recent call last) Cell In[13], line 1 ----> 1 labs.run_model_bpa(dataset = 'CHC_PIPE', workspace = 'PBI_DMRD_DEV_CHC_PPIPE')
File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy/_utils/_log.py:310, in mds_log.
File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy_labs/_model_bpa.py:293, in run_model_bpa(dataset, rules, workspace, export, return_dataframe, extended, language, **kwargs) 291 x = [nm(obj) for obj in tom.all_hierarchies() if expr(obj, tom)] 292 elif scope == "Table": --> 293 x = [nm(obj) for obj in tom.model.Tables if expr(obj, tom)] 294 elif scope == "Relationship": 295 x = [nm(obj) for obj in tom.model.Relationships if expr(obj, tom)]
File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy_labs/_model_bpa.py:293, in
File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy_labs/_model_bpa_rules.py:244, in model_bpa_rules.
"Formatting",
809 ["Table", "Column", "Measure", "Partition", "Hierarchy"],
810 "Info",
811 "First letter of objects must be capitalized",
812 lambda obj, tom: obj.Name[0] != obj.Name[0].upper(),
813 "The first letter of object names should be capitalized to maintain professional quality.",
814 ),
815 (
816 "Naming Conventions",
817 ["Table", "Column", "Measure", "Partition", "Hierarchy"],
818 "Warning",
819 "Object names must not contain special characters",
820 lambda obj, tom: re.search(r"[\t\r\n]", obj.Name),
821 "Object names should not include tabs, line breaks, etc.",
822 ),
823 ],
824 columns=[
825 "Category",
826 "Scope",
827 "Severity",
828 "Rule Name",
829 "Expression",
830 "Description",
831 "URL",
832 ],
833 )
835 return rules
File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy_labs/tom/_model.py:2280, in TOMWrapper.is_field_parameter(self, table_name) 2270 import Microsoft.AnalysisServices.Tabular as TOM 2272 t = self.model.Tables[table_name] 2274 return ( 2275 any( 2276 p.SourceType == TOM.PartitionSourceType.Calculated 2277 and "NAMEOF(" in p.Source.Expression 2278 for p in t.Partitions 2279 ) -> 2280 and all( 2281 "[Value" in c.SourceColumn 2282 for c in t.Columns 2283 if c.Type != TOM.ColumnType.RowNumber 2284 ) 2285 and t.Columns.Count == 4 2286 )
File ~/cluster-env/clonedenv/lib/python3.11/site-packages/sempy_labs/tom/_model.py:2281, in
AttributeError: 'CalculatedColumn' object has no attribute 'SourceColumn'
I believe the issue is with the is_field_paramter in the TOMWrapper. Do you have a calculated table which uses the NAMEOF function? And this table also has a calculated column? Can you share more on this so I can make the appropriate fix?
yes, I have a calculated table using NAMEOF function and it also has a calculated column.
Thanks. I've put a fix in place for the next release.
Fixed in 0.8.5.
run_model_bpa_bulk gives error CalculatedColumn' object has no attribute 'SourceColumn
We checked it, we do not have any calculated column in dataset which has error. Above problem I am facing is with many datasets. Example out of 50 dataset I found this problem in 10 datasets. It does not collect any data after throwing this error
Collecting Model BPA stats for the 'CHC_PIPE' semantic model within the 'PBI_DMRDXXXXXXXXXXX' workspace. 🔴 Model BPA failed for the 'CHC_PIPE' semantic model within the 'PBI_DMRDXXXXXXXXXXX' workspace. 'CalculatedColumn' object has no attribute 'SourceColumn' ⌛ Saving the Model BPA results of the 'PBI_DMRDXXXXXXXXXXXX' workspace to the 'modelbparesults' within the 'data_powerbi_platform' lakehouse within the 'XXXXXXXXXXXXXX' workspace...