dan-gustafsson2-schibsted-com opened a new issue, #43514:
URL: https://github.com/apache/superset/issues/43514

   ### Bug description
   
   The bug is clear in the SQL code.
   ```
   SELECT
     TO_TIMESTAMP_NTZ('{{ from_dttm }}') AS tz_from, -->> FAILS
     TO_TIMESTAMP_NTZ('{{ from_dttm }}', 'YYYY-MM-DD"T"HH24:MI:SS') AS 
parsed_from_dttm_explic, -->> FAILS
     TRY_TO_TIMESTAMP_NTZ('{{ from_dttm }}') AS parsed_from_dttm_tryto, --WORKS 
!
     '{{ from_dttm }}' AS debug_raw,
     LENGTH('{{ from_dttm }}') AS debug_length,
     '{{ from_dttm }}' = '2026-05-25T00:00:00' AS debug_matches_expected,
     *
   FROM mydb.myschema.mytable
   LIMIT 1
   ```
   When I click "Save" in the dialog, the error comes and prevents me from 
saving this virtual SQL.
   
   
   The 2 first FAILS gives this error : 
   ```
   DB engine Error
   100035 (22007): 01c6a003-020b-d96a-0003-8904362f8ee7: Timestamp '{{ 
from_dttm }}' is not recognized
   This may be triggered by:
   Issue 1002 - The database returned an unexpected error.
   
   ```
   
   ### Screenshots/recordings
   
   <img width="531" height="610" alt="Image" 
src="https://github.com/user-attachments/assets/3736c888-a851-4c15-96da-e95a332b99d5";
 />
   
   ### Superset version
   
   6.1.0
   
   ### Python version
   
   I don't know
   
   ### Node version
   
   I don't know
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   The workaround is the TRY_TO_TIMESTAMP_NTZ() function. 
   This functions returns a correct timestamp.
   
   ### Checklist
   
   - [ ] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [ ] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


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