appengine-mapreduce icon indicating copy to clipboard operation
appengine-mapreduce copied to clipboard

Support equality filter in db.ListProperty

Open eko-wibowo opened this issue 8 years ago • 3 comments

db.ListProperty.validate expects the param to be a value to be assigned to the field (which is a List). However the .filter() method expects the value to be a single element. This issue only occurs for db.ListProperty, ndbProperty with repeated flag works just fine.

Without this changes:

python test/mapreduce/input_readers_test.py 
======================================================================
ERROR: testValidate_Filters (__main__.DatastoreInputReaderTest)
Tests validating filters parameter.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/mapreduce/input_readers_test.py", line 814, in testValidate_Filters
    self.reader_cls.validate(mapper_spec)
  File "/Users/eko/projects/appengine-mapreduce/python/src/mapreduce/input_readers.py", line 640, in validate
    cls._validate_filters(filters, model_class)
  File "/Users/eko/projects/appengine-mapreduce/python/src/mapreduce/input_readers.py", line 683, in _validate_filters
    raise errors.BadReaderParamsError(e)
BadReaderParamsError: Property mvp_str must be a list

With this changes

......................................................................................................WARNING:root:File /testing/file-000 may have been removed. Skipping file.
WARNING:root:File /testing/file-018 may have been removed. Skipping file.
....................................................................
----------------------------------------------------------------------
Ran 170 tests in 26.231s

OK

eko-wibowo avatar May 27 '16 03:05 eko-wibowo

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

googlebot avatar May 27 '16 03:05 googlebot

I signed it!

eko-wibowo avatar May 27 '16 08:05 eko-wibowo

CLAs look good, thanks!

googlebot avatar May 27 '16 08:05 googlebot