# Support and document support for dates/times in query expressions

XMLWordPrintable

## Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
• Story Points:
4
• Sprint:
DB_F19_10, DB_S20_12, DB_S20_01, DB_S20_02
• Team:
Data Access and Database

## Description

I don't actually know how to pass a datetime into a query expression, or if that's possible.  Andy Salnikov, could you add support if it's missing, or document it if it's present?

We may want to make support for this explicit (via built-in datetime or astropy time calls), to insulate us from changes to the database type used for datetimes (e.g. DM-15890).

## Activity

Hide
Andy Salnikov added a comment -

Jim Bosch, I am a bit confused what QueryDimensionRecordStorage.join() should return. Is it self._query? But that only has self.element.graph.required columns in it, which I understand not a full set of columns, so I can't use that subquery to select "other" columns?

Show
Andy Salnikov added a comment - Jim Bosch , I am a bit confused what QueryDimensionRecordStorage.join() should return. Is it self._query ? But that only has self.element.graph.required columns in it, which I understand not a full set of columns, so I can't use that subquery to select "other" columns?
Hide
Jim Bosch added a comment -

self._query is fine. There are restrictions elsewhere that enforce that QueryDimensionRecordStorage is only used in the case where those are the only columns in that dimension at all.

Show
Jim Bosch added a comment - self._query is fine. There are restrictions elsewhere that enforce that QueryDimensionRecordStorage is only used in the case where those are the only columns in that dimension at all.
Hide
Andy Salnikov added a comment -

Should be ready for review. I'm assigning it to Tim Jenness, Jim Bosch could you check that my fix for QueryBuilder looks reasonable.

Kian-Tat Lim, there is on potential issue for you to review too, RFC says that ISO with time zone is supposed to be used but astropy does not support time zones. I mention that explicitly in the docs, but if we need timezone support we'll need another ticket.

Show
Andy Salnikov added a comment - Should be ready for review. I'm assigning it to Tim Jenness , Jim Bosch could you check that my fix for QueryBuilder looks reasonable. Kian-Tat Lim , there is on potential issue for you to review too, RFC says that ISO with time zone is supposed to be used but astropy does not support time zones. I mention that explicitly in the docs, but if we need timezone support we'll need another ticket.
Hide
Tim Jenness added a comment -

Looks great. I think I can get on board with the Tformat/value/scale approach.

Show
Tim Jenness added a comment - Looks great. I think I can get on board with the Tformat/value/scale approach.
Hide
Andy Salnikov added a comment -

Thanks for review, merged.

Show
Andy Salnikov added a comment - Thanks for review, merged.

## People

• Assignee:
Andy Salnikov
Reporter:
Jim Bosch
Reviewers:
Tim Jenness
Watchers:
Andy Salnikov, Fritz Mueller, Gregory Dubois-Felsmann, Jim Bosch, Robert Lupton, Tim Jenness