korbit-ai[bot] commented on code in PR #34510:
URL: https://github.com/apache/superset/pull/34510#discussion_r2249048264
##########
superset/views/base.py:
##########
@@ -307,29 +306,25 @@ def menu_data(user: User) -> dict[str, Any]:
def get_theme_bootstrap_data() -> dict[str, Any]:
"""
Returns the theme data to be sent to the client.
+ Resolves UUID references and upserts system themes.
"""
+ from superset.commands.theme.resolve import ResolveAndUpsertThemeCommand
Review Comment:
### Local Import in Function Body <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
Import statement is placed inside function body rather than at module level,
violating Python's style guide and creating unnecessary import overhead on each
function call.
###### Why this matters
Local imports increase function complexity, make code harder to maintain,
and can impact performance if the function is called frequently since the
import is evaluated on every call.
###### Suggested change ∙ *Feature Preview*
Move the import statement to the top of the file with other imports:
```python
from superset.commands.theme.resolve import ResolveAndUpsertThemeCommand
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/aca4d1ae-7b37-4414-bb20-d93a092f5229/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/aca4d1ae-7b37-4414-bb20-d93a092f5229?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/aca4d1ae-7b37-4414-bb20-d93a092f5229?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/aca4d1ae-7b37-4414-bb20-d93a092f5229?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/aca4d1ae-7b37-4414-bb20-d93a092f5229)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:f4f32c4b-d155-44bb-8f16-6f58f1bf9177 -->
[](f4f32c4b-d155-44bb-8f16-6f58f1bf9177)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]