codeant-ai-for-open-source[bot] commented on code in PR #45851:
URL: https://github.com/apache/superset/pull/45851#discussion_r4415519091
##########
superset/connectors/sqla/partition_mapping.py:
##########
@@ -1851,9 +1851,38 @@ def _evaluate_with_text_forms(
# text of every correct transform too -- `CAST(:value AS DATE)`
# cannot read '2026-01-12 06:30:00' under the default
# ``NLS_DATE_FORMAT`` -- so declining here cost Oracle every time
- # range. The typed values are asked alone, a second round trip only
+ # range. The typed values are asked again, a second round trip only
# on this path, and `_declined_for_reading_by_type` checks what they
# answer against the instants they were asked about instead.
+ #
+ # In that same round trip each instant is asked once more at the top
+ # of an hour, typed and as the shorter text `_as_hour_text` writes,
+ # which a mask too short for the full text still reads. Being near
+ # the instant is not enough on its own: under an ISO date-only
+ # ``NLS_DATE_FORMAT``, ``TO_DATE(:value, 'YYYY-MM-DD HH24')`` answers
+ # midnight for 06:30, which is near it and a whole hourly key out.
+ # Those two answers differ.
+ hours = [_at_probe_hour(values[index]) for index in indexes]
+ with_hours = evaluate_transform(
+ database,
+ catalog,
+ schema,
+ transform,
+ values + hours + [_as_hour_text(hour) for hour in hours],
+ )
+ if with_hours is not None:
+ typed_hours = with_hours[len(values) : len(values) + len(hours)]
+ text_hours = with_hours[len(values) + len(hours) :]
+ text_answers.extend(
+ (index, TextRefused(hour, typed_hour, text_hour))
+ for index, hour, typed_hour, text_hour in zip(
+ indexes, hours, typed_hours, text_hours, strict=False
+ )
+ )
+ return True, with_hours[: len(values)]
+ # The shorter text is refused too -- every ISO spelling is, under
+ # Oracle's default ``NLS_DATE_FORMAT`` -- so the typed values are
+ # asked alone, and only the distance from the instant is checked.
typed = evaluate_transform(database, catalog, schema, transform,
values)
Review Comment:
**Suggestion:** Any failure of the expanded probe is treated as text
refusal; 334 Oracle inputs create 1002 projections, letting a midnight result
pass the distance check and omit hourly rows.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Rarely` ยท ๐ท๏ธ `Incorrect condition
logic`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=6941b2497afa4caba4cb260f7b544e03&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=6941b2497afa4caba4cb260f7b544e03&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/connectors/sqla/partition_mapping.py
**Line:** 1886:1889
**Comment:**
*Incorrect Condition Logic: Any failure of the expanded probe is
treated as text refusal; 334 Oracle inputs create 1002 projections, letting a
midnight result pass the distance check and omit hourly rows.
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%2F45851&comment_hash=51a15a13a03a8e6b21b73bade8f9356c8729bb7cc644b0fdf3342f40531526f4&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45851&comment_hash=51a15a13a03a8e6b21b73bade8f9356c8729bb7cc644b0fdf3342f40531526f4&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]