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

Pipelines requires different version of simplejson than mapreduce #9

Closed
ksookocheff-va opened this issue Dec 2, 2014 · 4 comments
Closed

Comments

@ksookocheff-va
Copy link
Contributor

The simplejson lib should be added as a separate dependency (like what was done with the MapReduce library). The versions of these libs should be the same.

@webmaven
Copy link

webmaven commented Dec 2, 2014

👍

@eshlox
Copy link
Contributor

eshlox commented Dec 17, 2014

I agree. I think that we should just remove simplejson from pipeline library (version 2.1.1), it is included in requirement.txt in the correct version (the same as in mapreduce library). At the moment pipeline is broken because of old simplejson, even the tests are broken:

======================================================================
ERROR: testE2e (test.util_test.JsonSerializationTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/eshlox/projects/appengine-pipelines/appengine-pipelines/python/test/util_test.py", line 25, in testE2e
    obj, cls=util.JsonEncoder), cls=util.JsonDecoder)
  File "/home/eshlox/projects/appengine-pipelines/appengine-pipelines/python/src/pipeline/simplejson/__init__.py", line 269, in dumps
    use_decimal=use_decimal, **kw).encode(obj)
  File "/home/eshlox/projects/appengine-pipelines/appengine-pipelines/python/src/pipeline/simplejson/encoder.py", line 216, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/home/eshlox/projects/appengine-pipelines/appengine-pipelines/python/src/pipeline/simplejson/encoder.py", line 277, in iterencode
    self.skipkeys, self.allow_nan, key_memo, self.use_decimal)
TypeError: Required argument 'namedtuple_as_object' (pos 12) not found

After removing simplejson:

----------------------------------------------------------------------
Ran 3 tests in 0.006s

OK

Tests in my application also passed with this.

Here is the pull request: #11

@someone1
Copy link
Contributor

Is there a reason why it isn't:

try:
  import json as simplejson
except:
  import simplejson

?

For those of us that use the python27 runtime, we can benefit from the speedups afforded by the stdlib json import that has compiled c speedups and remove a dependency.

@tkaitchuck
Copy link
Contributor

Someone1: Good Point. Can you send a merge request?
Is there any other reason to keep this open?

tkaitchuck added a commit that referenced this issue Mar 6, 2015
Various environment/import updates. (simple json -> json)
See: #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants