Yelp/mrjob — Issue #285: MRJob.DEFAULT_PROTOCOL shouldn't be None
Author: davidmarin
Created: 2011-11-21 22:06:34+00:00
State: open
Labels: Bug

In hand-testing at Yelp, we ran into some very old code that read `DEFAULT_PROTOCOL` directly from an `MRJob` instance. In v0.2.8, the job's `DEFAULT_PROTOCOL` attribute is set to `'json'`, but in v0.3.0, it's `None`.

Same goes for `DEFAULT_INPUT_PROTOCOL`; for backwards compatibility, it should still be `'raw_value'`, not `None`.

(`DEFAULT_OUTPUT_PROTOCOL` was `None` in v0.2.8 anyways.)

I think fixing this is as simple as setting `DEFAULT_PROTOCOL = 'json'` and `DEFAULT_INPUT_PROTOCOL = 'raw_value'`, and ignoring it (i.e. not issuing a warning or calling `MRJob.protocols()`) if it's set to the default value.

(We should of course also get rid of this crufty old code at Yelp, but we figured other people might be doing the same thing, and they at least deserved the courtesy of a deprecation warning.)