Opened 10 years ago

Closed 2 years ago

#2268 closed enhancement (fixed)

t.list.rast where sensitivity

Reported by: martinl Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Temporal Version: svn-trunk
Keywords: t.list.rast Cc:
CPU: Unspecified Platform: Unspecified


t.rast.list modis_m where="start_time < 2002-03-01"

gives no output, no warning - note missing quotes around date, ie.

t.rast.list modis_m where="start_time < '2002-03-01'"

Change History (9)

in reply to:  description comment:1 by lucadelu, 8 years ago

Replying to martinl:

t.rast.list modis_m where="start_time < 2002-03-01"

gives no output, no warning - note missing quotes around date, ie.

I think it is correct, the query is wrong. It need the quotes

t.rast.list modis_m where="start_time < '2002-03-01'"

This is working for me

comment:2 by martinl, 8 years ago


comment:3 by neteler, 7 years ago


comment:4 by neteler, 6 years ago


comment:5 by lucadelu, 5 years ago

In 73440:

temporal lib: add error message if the are no maps in the request, see #2268

comment:6 by lucadelu, 5 years ago

Is r73440 enough to close this ticket?

Parsing the where condition it is not so simple and Python sqlite3 library has no function to check if a query is valid.

comment:7 by martinl, 5 years ago

Type: defectenhancement

I tested recently two commands in 7.6.1:

 t.rast.list cr2017 where="start_time < '2017-03-01'"
MOD11A2.A2017001_mosaic_LST_Day_1km|PERMANENT|2017-01-01 00:00:00|2017-01-09 00:00:00

t.rast.list cr2017 where="start_time < 2017-03-01"
[no output, no warning/error message]

r73440 seems to have no effect

comment:8 by wenzeslaus, 2 years ago

The current behavior after PR:2258 (for v8.2) is:

  • r73440 continues to work and has the intended behavior, i.e., there is an error message with the default plain text format.
  • The other formats (JSON, YAML, CSV) return a result without an error because there is a perfectly fine way of representing an empty result in all three formats.
  • There is generally no error message to be issued in the above case, the provided SQL is valid 2002-03-01 is 1998 (try SELECT 2002-03-01;), so there is nothing to complain about from SQL syntax perspective. No results generally mean that nothing was matched, not that the user mistyped the query, so the JSON, YAML, and CSV formats give an empty result without any error message.
> t.rast.list viewshed_walk where="start_time < 2002-03-01"
ERROR: Nothing found in the database for space time dataset
       <viewshed_walk@viewsheds> (type: strds): Dataset is empty or where
       clause is too constrained or incorrect
> t.rast.list viewshed_walk where="start_time < 2002-03-01" format=json
{"data": [], "metadata": {"column_names": ["name", "mapset", "start_time", "end_time"]}}
> t.rast.list viewshed_walk where="start_time < 2002-03-01" format=yaml
data: []
    - name
    - mapset
    - start_time
    - end_time
> t.rast.list viewshed_walk where="start_time < 2002-03-01" format=csv

comment:9 by wenzeslaus, 2 years ago

Resolution: fixed
Status: newclosed

Given the new behavior with new formats from ​PR:2258, that r73440 seem to work, and that there is no SQL error to be reported, I'm closing this as fixed. If needed, please open a new issue or PR on GitHub to follow up on this.

Note: See TracTickets for help on using tickets.