pacificclimate / pydap-pdp

A forked version of Pydap modified for use with the pcic dataportal
0 stars 0 forks source link

Error in sequence DDS response #3

Open jameshiebert opened 6 years ago

jameshiebert commented 6 years ago

I'm running into and issue where Pydap is erroring out in the middle of generating the DDS (data structure description).

$ curl 'http://docker-prod01.pcic.uvic.ca:30223/pcds/lister/raw/EC_raw/1145M29.rsql.dds'
Dataset {
    Sequence {
        Float64 wind_direction;
        Float64 air_temperature;
        Float64 wind_gust_speed;
        Float64 tendency_amount;
        Float64 wind_speed;
        Float64 mean_sea_level;
        Float64 dew_point;
        Float64 snow_amount;
        Float64 air_temperature_yesterday_high;
        Float64 relative_humidity;
curl: (18) transfer closed with outstanding read data remaining

On the server side we see:

2018-08-10 17:25:26 [20] [ERROR] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/async.py", line 114, in handle_request
    for item in respiter:
  File "/root/pdp/pdp/error.py", line 74, in __call__
    start_response(status, response_headers, sys.exc_info())
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/http/wsgi.py", line 237, in start_response
    reraise(exc_info[0], exc_info[1], exc_info[2])
  File "/root/pdp/pdp/error.py", line 68, in __call__
    for block in response_iter:
  File "/usr/local/lib/python2.7/dist-packages/ga_wsgi_client/__init__.py", line 41, in __call__
    for chunk in app_iter:
  File "/usr/local/lib/python2.7/dist-packages/pydap/responses/dds.py", line 35, in __iter__
    for line in dispatch(self.dataset):
  File "/usr/local/lib/python2.7/dist-packages/pydap/responses/dds.py", line 65, in func
    for line in dispatch(child, level+1, sequence):
  File "/usr/local/lib/python2.7/dist-packages/pydap/responses/dds.py", line 65, in func
    for line in dispatch(child, level+1, sequence):
  File "/usr/local/lib/python2.7/dist-packages/pydap/responses/dds.py", line 98, in base
    type=typemap[var.dtype.char],
KeyError: 'M'
2018-08-10 17:25:26 [20] [ERROR] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/async.py", line 114, in handle_request
    for item in respiter:
  File "/root/pdp/pdp/error.py", line 74, in __call__
    start_response(status, response_headers, sys.exc_info())
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/http/wsgi.py", line 237, in start_response
    reraise(exc_info[0], exc_info[1], exc_info[2])
  File "/root/pdp/pdp/error.py", line 68, in __call__
    for block in response_iter:
  File "/usr/local/lib/python2.7/dist-packages/ga_wsgi_client/__init__.py", line 41, in __call__
    for chunk in app_iter:
  File "/usr/local/lib/python2.7/dist-packages/pydap/responses/dds.py", line 35, in __iter__
    for line in dispatch(self.dataset):
  File "/usr/local/lib/python2.7/dist-packages/pydap/responses/dds.py", line 65, in func
    for line in dispatch(child, level+1, sequence):
  File "/usr/local/lib/python2.7/dist-packages/pydap/responses/dds.py", line 65, in func
    for line in dispatch(child, level+1, sequence):
  File "/usr/local/lib/python2.7/dist-packages/pydap/responses/dds.py", line 98, in base
    type=typemap[var.dtype.char],
KeyError: 'M'

This is preventing any type of usage from client libraries, so it'd be good to get it confirmed and fixed.

jameshiebert commented 6 years ago

Chances are good that the typemap mapping numpy types to OPeNDAP types is incomplete... probably with respect to datetimes.