dsidlo commented on issue #15768: URL: https://github.com/apache/superset/issues/15768#issuecomment-907567429
> As a work-around I convert the date to a string. > So instead of... > > ` select rfq._created_dt, ...` > > use... > > ` select to_char(rfq._created_dt, 'YYY-MM-DD') as _created_dt, ...` > > The actual error does not seem to come from the Postgres server as indicated by the error message. > I did some debugging, and it turns out that in the condition... > `if abs(minutes) >= 1440:` > ... minutes is a datetime.timedelta object which can't be evaluated against and int using the '>=' operator. > But exception shows up as if it were coming from postgres. String solution does not work well, it will cause other problems with some visualizations. The real issue is that dates can be missing the timezone in some way, and forcing a timezone into the output field fixes the date issue properly without making it a string. Making the main temporal date field into a string, will cause other problems. Don't use... `select date_fld, ...` Use... `select date_fld::timestamptz at time zone 'EST', ` -- 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]
