Fokko commented on a change in pull request #814:
URL: https://github.com/apache/avro/pull/814#discussion_r416384243
##########
File path: lang/py/avro/test/test_schema.py
##########
@@ -37,6 +37,11 @@
except NameError:
basestring = (bytes, unicode)
+try:
+ from typing import List
Review comment:
This makes me want to drop 3.5 :-)
##########
File path: lang/py/avro/tether/tether_task.py
##########
@@ -339,18 +341,15 @@ def configure(self,taskType, inSchemaText,
outSchemaText):
estr= traceback.format_exc()
self.fail(estr)
- def set_partitions(self,npartitions):
-
- try:
- self._partitions=npartitions
- except Exception as e:
- estr= traceback.format_exc()
- self.fail(estr)
-
- def get_partitions():
- """ Return the number of map output partitions of this job."""
+ @property
+ def partitions(self):
+ """Return the number of map output partitions of this job."""
return self._partitions
+ @partitions.setter
Review comment:
Never seen this one before, looks nice!
Ref:
https://stackoverflow.com/questions/598077/why-does-foo-setter-in-python-not-work-for-me
##########
File path: lang/py/avro/tether/tether_task.py
##########
@@ -339,18 +341,15 @@ def configure(self,taskType, inSchemaText,
outSchemaText):
estr= traceback.format_exc()
self.fail(estr)
- def set_partitions(self,npartitions):
-
- try:
- self._partitions=npartitions
- except Exception as e:
- estr= traceback.format_exc()
- self.fail(estr)
-
- def get_partitions():
Review comment:
It already pays of :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]