codeant-ai-for-open-source[bot] commented on code in PR #45532:
URL: https://github.com/apache/superset/pull/45532#discussion_r4331150910
##########
superset/semantic_layers/api.py:
##########
@@ -379,13 +415,32 @@ def post(self) -> Response:
body = request.json or {}
views_data = body.get("views", [])
- if not views_data:
- return self.response_400(message="No views provided")
+ if refusal := _bulk_create_refusal(views_data):
+ return self.response_400(message=refusal)
schema = SemanticViewPostSchema()
created = []
errors = []
+ # Checked between lookups only: an in-flight provider call is bounded
by
+ # the semantic layer's own timeouts.
+ deadline = (
+ time.monotonic() +
current_app.config["SEMANTIC_VIEW_BULK_CREATE_TIMEOUT"]
+ )
+ timed_out = 0
for view_data in views_data:
+ if time.monotonic() >= deadline:
Review Comment:
**Suggestion:** Because `get_semantic_view()` has no enforced timeout in the
provider contract, a blocking provider can keep the worker past this deadline
indefinitely; remaining `TIMEOUT` results cannot be returned until it finishes.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Rarely` ยท ๐ท๏ธ `Api mismatch`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=3979f5dd6a344fd096e835e13cc08b1a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=3979f5dd6a344fd096e835e13cc08b1a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/semantic_layers/api.py
**Line:** 431:431
**Comment:**
*Api Mismatch: Because `get_semantic_view()` has no enforced timeout in
the provider contract, a blocking provider can keep the worker past this
deadline indefinitely; remaining `TIMEOUT` results cannot be returned until it
finishes.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45532&comment_hash=9d333f7cc554c9b32020aae2a10a4867ad360e565fa4ea46c680d565145c4fa5&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45532&comment_hash=9d333f7cc554c9b32020aae2a10a4867ad360e565fa4ea46c680d565145c4fa5&reaction=dislike'>๐</a>
--
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]