Closed abliss closed 9 years ago
Thanks! I'll pull it down and test it now.
Thanks @aaronlifshin for inviting me to the trusted-tester site. I see from the logs there that the new endpoint is throwing 500 error due to
Property end_date must be a datetime, but was u'-'
Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call__
rv = self.handle_exception(request, response, e)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
rv = self.router.dispatch(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
return route.handler_adapter(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1077, in __call__
return handler.dispatch()
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 547, in dispatch
return self.handle_exception(e, self.app.debug)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 545, in dispatch
return method(*args, **kwargs)
File "/base/data/home/apps/s~lessig-trust-test/1.386876754693484313/handlers.py", line 750, in get
for pledge in model.Pledge.all():
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 2330, in next
return self.__model_class.from_entity(self.__iterator.next())
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 1445, in from_entity
return cls(None, _from_entity=entity, **entity_values)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 973, in __init__
prop.__set__(self, value)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 617, in __set__
value = self.validate(value)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 3018, in validate
(self.name, self.data_type.__name__, value))
BadValueError: Property end_date must be a datetime, but was u'-'
@abliss when i tried to run on GAE test instance, i hit two errors.
i resolved the first by using setdefault to initialize each state's total (https://github.com/Lessig2016/pledgeservice/compare/feature/state-by-state-totals?expand=1#diff-0d706bf2916b6f7a76178963618a8fdfR752).
the next is above my python pay grade. do you think you'll be able to take a look? we've added you to the GAE instance.
i see your comment above came in as i was typing. thoughts?
Yep... that is a strange error to get on a field that's empty across the DB.
On Wed, Sep 2, 2015 at 2:26 PM, Adam Bliss notifications@github.com wrote:
Thanks @aaronlifshin https://github.com/aaronlifshin for inviting me to the trusted-tester site. I see from the logs there that the new endpoint is throwing 500 error due to
Property end_date must be a datetime, but was u'-' Traceback (most recent call last): File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in call rv = self.handle_exception(request, response, e) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in call rv = self.router.dispatch(request, response) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher return route.handler_adapter(request, response) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1077, in call return handler.dispatch() File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 547, in dispatch return self.handle_exception(e, self.app.debug) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 545, in dispatch return method(_args, *_kwargs) File "/base/data/home/apps/s~lessig-trust-test/1.386876754693484313/handlers.py", line 750, in get for pledge in model.Pledge.all(): File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/init.py", line 2330, in next return self.model_class.from_entity(self.__iterator.next()) File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init.py", line 1445, in from_entity return cls(None, _from_entity=entity, entity_values) File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/init.py", line 973, in init prop.set(self, value) File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/init.py", line 617, in set value = self.validate(value) File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/init.py", line 3018, in validate (self.name, self.data_type.name**, value)) BadValueError: Property end_date must be a datetime, but was u'-'
— Reply to this email directly or view it on GitHub https://github.com/Lessig2016/pledgeservice/pull/8#issuecomment-137249261 .
all of the records returned by the Pledge.all query are missing the end_date value. possible to omit it from the specific query?
i think there is one record in the datastore which is messing up the query. I suggest deleting it or at least fixing its fields. id=5157979233976320
Oh, I see that it is a pledge by @aaronlifshin :)
Did you maybe enter that record manually (or while developing the end_date schema change)? It has '-' instead of a date field.
You can make the edit here :
Probably just nulling out the "end_date" field will fix this error. (I shall abstain from monkeying with your datastore however :)
Edited that data.
On Wed, Sep 2, 2015 at 2:40 PM, Adam Bliss notifications@github.com wrote:
You can make the edit here :
Probably just nulling out the "end_date" field will fix this error. (I shall abstain from monkeying with your datastore however :)
— Reply to this email directly or view it on GitHub https://github.com/Lessig2016/pledgeservice/pull/8#issuecomment-137252283 .
Similar issue with url_nonce on that record. (I don't know what an appropriate value would be, but the new 500 error is because it's empty.)
DELORTED
On Wed, Sep 2, 2015 at 2:49 PM, Adam Bliss notifications@github.com wrote:
Similar issue with url_nonce on that record.
— Reply to this email directly or view it on GitHub https://github.com/Lessig2016/pledgeservice/pull/8#issuecomment-137254240 .
Awesome, seems to work now!
So, any chance of seeing this pushed to production?
I am really concerned about the performance impact of this the way it is written.
Can we get it to run every 10 minutes or so through a queue, push the results to the datastore and have the endpoint just read that small datastore table?
A
On Thu, Sep 3, 2015 at 4:59 PM, Adam Bliss notifications@github.com wrote:
So, any chance of seeing this pushed to production?
— Reply to this email directly or view it on GitHub https://github.com/Lessig2016/pledgeservice/pull/8#issuecomment-137604635 .
Reading a large(ish) table like that in GAE is really not recommended, it's not the way the replication datastore is meant to be used.
On Thu, Sep 3, 2015 at 5:06 PM, Aaron Lifshin aaronlifshin@gmail.com wrote:
I am really concerned about the performance impact of this the way it is written.
Can we get it to run every 10 minutes or so through a queue, push the results to the datastore and have the endpoint just read that small datastore table?
A
On Thu, Sep 3, 2015 at 4:59 PM, Adam Bliss notifications@github.com wrote:
So, any chance of seeing this pushed to production?
— Reply to this email directly or view it on GitHub https://github.com/Lessig2016/pledgeservice/pull/8#issuecomment-137604635 .
How about https://github.com/Lessig2016/pledgeservice/pull/11 instead? (I don't have time to go learn the GAE queue api right now.)
Thanks for your time.
Moved from #4