You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/01/25 21:42:49 UTC

[GitHub] [ignite-python-thin-client] isapego opened a new pull request #4: IGNITE-14058: Bool arrays now return as bool array, not int array

isapego opened a new pull request #4:
URL: https://github.com/apache/ignite-python-thin-client/pull/4


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite-python-thin-client] ivandasch commented on a change in pull request #4: IGNITE-14058: Bool arrays now return as bool array, not int array

Posted by GitBox <gi...@apache.org>.
ivandasch commented on a change in pull request #4:
URL: https://github.com/apache/ignite-python-thin-client/pull/4#discussion_r564363037



##########
File path: pyignite/datatypes/primitive_arrays.py
##########
@@ -297,3 +297,10 @@ class BoolArrayObject(PrimitiveArrayObject):
     _type_id = TYPE_BOOLEAN_ARR
     primitive_type = Bool
     type_code = TC_BOOL_ARRAY
+
+    @classmethod
+    def to_python(cls, ctype_object, *args, **kwargs):
+        result = []

Review comment:
       Sorry for mistake
   
   ```
   if not ctype_object:
        return None
   result = [False] * ctype_object.length
   for i in range(ctype_objet.length):
        result[i] = ctype_object.data[i] != 0
   ```
   
   >>> timeit("[False] * 100", number=10000)
   0.014093294998019701
   >>> timeit(lambda: append_creation(100), number=10000)
   0.07997436200093944
   >>>
   
   




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite-python-thin-client] ivandasch commented on a change in pull request #4: IGNITE-14058: Bool arrays now return as bool array, not int array

Posted by GitBox <gi...@apache.org>.
ivandasch commented on a change in pull request #4:
URL: https://github.com/apache/ignite-python-thin-client/pull/4#discussion_r564363037



##########
File path: pyignite/datatypes/primitive_arrays.py
##########
@@ -297,3 +297,10 @@ class BoolArrayObject(PrimitiveArrayObject):
     _type_id = TYPE_BOOLEAN_ARR
     primitive_type = Bool
     type_code = TC_BOOL_ARRAY
+
+    @classmethod
+    def to_python(cls, ctype_object, *args, **kwargs):
+        result = []

Review comment:
       Sorry for mistake
   
   ```
   if not ctype_object:
        return None
   result = [False] * ctype_object.length
   for i in range(ctype_objet.length):
        result[i] = ctype_object.data[i] != 0
   ```
   ```
   >>> timeit("[False] * 100", number=10000)
   0.014093294998019701
   >>> timeit(lambda: append_creation(100), number=10000)
   0.07997436200093944
   >>>
   ```
   
   




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite-python-thin-client] ivandasch commented on a change in pull request #4: IGNITE-14058: Bool arrays now return as bool array, not int array

Posted by GitBox <gi...@apache.org>.
ivandasch commented on a change in pull request #4:
URL: https://github.com/apache/ignite-python-thin-client/pull/4#discussion_r564339514



##########
File path: pyignite/datatypes/primitive_arrays.py
##########
@@ -297,3 +297,10 @@ class BoolArrayObject(PrimitiveArrayObject):
     _type_id = TYPE_BOOLEAN_ARR
     primitive_type = Bool
     type_code = TC_BOOL_ARRAY
+
+    @classmethod
+    def to_python(cls, ctype_object, *args, **kwargs):
+        result = []

Review comment:
       ```
   >>> def append_creation(n):
   ...     res = []
   ...     for _ in range(n):
   ...         res.append(False)
   ...     return res
   ... 
   >>> timeit("False * 100", number=10000)
   0.0005339730014384259
   >>> timeit(lambda: append_creation(100), number=10000)
   0.07856238499880419
   >>> 
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite-python-thin-client] isapego commented on a change in pull request #4: IGNITE-14058: Bool arrays now return as bool array, not int array

Posted by GitBox <gi...@apache.org>.
isapego commented on a change in pull request #4:
URL: https://github.com/apache/ignite-python-thin-client/pull/4#discussion_r564344971



##########
File path: pyignite/datatypes/primitive_arrays.py
##########
@@ -297,3 +297,10 @@ class BoolArrayObject(PrimitiveArrayObject):
     _type_id = TYPE_BOOLEAN_ARR
     primitive_type = Bool
     type_code = TC_BOOL_ARRAY
+
+    @classmethod
+    def to_python(cls, ctype_object, *args, **kwargs):
+        result = []

Review comment:
       So that's how you do `.reserve()` in python :)




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite-python-thin-client] asfgit closed pull request #4: IGNITE-14058: Bool arrays now return as bool array, not int array

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #4:
URL: https://github.com/apache/ignite-python-thin-client/pull/4


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite-python-thin-client] ivandasch commented on a change in pull request #4: IGNITE-14058: Bool arrays now return as bool array, not int array

Posted by GitBox <gi...@apache.org>.
ivandasch commented on a change in pull request #4:
URL: https://github.com/apache/ignite-python-thin-client/pull/4#discussion_r564363037



##########
File path: pyignite/datatypes/primitive_arrays.py
##########
@@ -297,3 +297,10 @@ class BoolArrayObject(PrimitiveArrayObject):
     _type_id = TYPE_BOOLEAN_ARR
     primitive_type = Bool
     type_code = TC_BOOL_ARRAY
+
+    @classmethod
+    def to_python(cls, ctype_object, *args, **kwargs):
+        result = []

Review comment:
       Sorry for mistake :( 
   
   ```
   if not ctype_object:
        return None
   result = [False] * ctype_object.length
   for i in range(ctype_objet.length):
        result[i] = ctype_object.data[i] != 0
   ```
   ```
   >>> timeit("[False] * 100", number=10000)
   0.014093294998019701
   >>> timeit(lambda: append_creation(100), number=10000)
   0.07997436200093944
   >>>
   ```
   
   




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite-python-thin-client] ivandasch commented on a change in pull request #4: IGNITE-14058: Bool arrays now return as bool array, not int array

Posted by GitBox <gi...@apache.org>.
ivandasch commented on a change in pull request #4:
URL: https://github.com/apache/ignite-python-thin-client/pull/4#discussion_r564338563



##########
File path: pyignite/datatypes/primitive_arrays.py
##########
@@ -297,3 +297,10 @@ class BoolArrayObject(PrimitiveArrayObject):
     _type_id = TYPE_BOOLEAN_ARR
     primitive_type = Bool
     type_code = TC_BOOL_ARRAY
+
+    @classmethod
+    def to_python(cls, ctype_object, *args, **kwargs):
+        result = []

Review comment:
       ```
   if not ctype_object:
        return None
   result = False * ctype_object.length
   for i in range(ctype_objet.length):
        result[i] = ctype_object.data[i] != 0
   ```




----------------------------------------------------------------
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:
users@infra.apache.org