semantic-link-labs icon indicating copy to clipboard operation
semantic-link-labs copied to clipboard

setting the theme.json

Open Arengard opened this issue 8 months ago • 1 comments

setting the theme does not work A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

rpt.set_theme(theme_file_path='https://raw.githubusercontent.com/PowerBiDevCamp/FabricUserApiDemo/main/FabricUserApiDemo/DefinitionTemplates/Shared/Reports/StaticResources/SharedResources/BaseThemes/CY23SU08.json')

File /nfs4/pyenv-173d0a0c-8419-4280-97d5-5c8c86827a79/lib/python3.11/site-packages/sempy_labs/report/_reportwrapper.py:1485, in ReportWrapper.set_theme(self, theme_file_path) 1482 rptJson["themeCollection"]["customTheme"]["name"] = theme_name_full 1483 rptJson["themeCollection"]["customTheme"]["type"] = resource_type -> 1485 for package in rptJson["resourcePackages"]: 1486 package["items"] = [ 1487 item 1488 for item in package["items"] 1489 if item["type"] != "CustomTheme" 1490 ] 1492 if not any( 1493 package["name"] == resource_type 1494 for package in rptJson["resourcePackages"] 1495 ):

KeyError: 'resourcePackages'

Arengard avatar Mar 26 '25 07:03 Arengard

Thanks for raising this. I'm working on an overhaul of the ReportWrapper which will fix this issue.

m-kovalsky avatar May 26 '25 12:05 m-kovalsky

This is fixed within 0.10.0. Please make sure to use the connect_report context manager as shown here.

m-kovalsky avatar Jun 03 '25 19:06 m-kovalsky