Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Ulmo to 0.8.5 #3143

Merged
merged 1 commit into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions src/mmw/apps/bigcz/clients/cuahsi/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from __future__ import division

from datetime import date, timedelta
from timeout_decorator import timeout
from socket import timeout

from rest_framework.exceptions import ValidationError

Expand All @@ -31,16 +31,6 @@ def details(wsdl, site):
return wof.get_site_info(wsdl, site, None)


@timeout(settings.BIGCZ_CLIENT_TIMEOUT, timeout_exception=ValuesTimedOutError)
# NOTE: This @timeout decorator will have to be modified for a multi-threaded
# environment, with the use_signals=false attribute. Unfortunately, that does
# not support functions that return values that cannot be pickled, such as this
# very function, since suds responses are dynamic objects and not pickleable.
# In this case, we may have to deserialize the values herein. Read more here:
# https://github.com/pnpnpn/timeout-decorator#multithreading
# Alternatively, if https://github.com/ulmo-dev/ulmo/issues/155 is addressed,
# we can use the native timeout capabilities surfaced in Ulmo instead of this
# wrapper decorator.
def values(wsdl, site, variable, from_date=None, to_date=None):
if not wsdl:
raise ValidationError({
Expand All @@ -67,4 +57,8 @@ def values(wsdl, site, variable, from_date=None, to_date=None):
wsdl += '?WSDL'

from ulmo.cuahsi import wof
return wof.get_values(wsdl, site, variable, from_date, to_date, None)
try:
return wof.get_values(wsdl, site, variable, from_date, to_date, None,
timeout=settings.BIGCZ_CLIENT_TIMEOUT)
except timeout:
raise ValuesTimedOutError()
3 changes: 1 addition & 2 deletions src/mmw/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ python-dateutil==2.6.0
https://bitbucket.org/jurko/suds/get/94664ddd46a6.tar.gz#egg=suds-jurko
django_celery_results==1.0.1
pandas==0.22.0
git+git://github.com/emiliom/ulmo@wml_values_md#egg=ulmo
ulmo==0.8.5
hs_restclient==1.3.4
six==1.11.0
fiona==1.7.11
timeout-decorator==0.4.0
redis==2.10.6