EnxDev commented on code in PR #44465:
URL: https://github.com/apache/superset/pull/44465#discussion_r4060938523


##########
superset/utils/webdriver.py:
##########
@@ -361,6 +372,11 @@ def _get_validated_screenshot(
                 context_suffix,
             )
             if not is_blank:
+                if blankness.is_blank:
+                    report_execution_context.approve_artifact(

Review Comment:
   Could this call `validate_report_screenshot(image, report_execution_context, 
content_validated=True)` before recording approval, as the tiled path does? A 
terminal empty/error capture reaches this branch without running 
`Image.verify()`, and the cached hash then makes every later validator return 
early.
   
   I reproduced this by flipping one byte of the IDAT checksum in an otherwise 
valid blank PNG. The pixel metrics still classify it as blank, but 
`Image.verify()` raises `SyntaxError: broken PNG file (bad header checksum in 
b'IDAT')`. The shared validator and tiled path reject those bytes; 
`_get_validated_screenshot()` followed by final validation accepts them. Using 
the shared validator here would preserve the empty/error exception while still 
checking the file's integrity.



-- 
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]

Reply via email to