You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Bojidar Marinov (Jira)" <ji...@apache.org> on 2021/08/05 18:32:00 UTC

[jira] [Updated] (IGNITE-15266) Python nested object arrays re-serialization failure

     [ https://issues.apache.org/jira/browse/IGNITE-15266?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bojidar Marinov updated IGNITE-15266:
-------------------------------------
    Description: 
When reading an object that contains an object array directly inside another object array from python, and attempting to write it back directly, the following error is raised:
{code:java}
  File ".../ignite-python-thin-client/pyignite/utils.py", line 69, in is_hinted
    return isinstance(value, tuple) and len(value) == 2 and issubclass(value[1], IgniteDataType)
TypeError: issubclass() arg 1 must be a class
{code}
 

Sample reproduction:

 
{code:java}
from pyignite import Client
from pyignite.datatypes import ObjectArrayObject
ignite = Client()
with ignite.connect('localhost', 10800):
    cache = ignite.get_or_create_cache('example')
    example_nested = ((ObjectArrayObject.OBJECT, [1]), ObjectArrayObject)
    example = (ObjectArrayObject.OBJECT, [example_nested])
    print(example) #                             (-1, [((-1, [1]), <class 'pyignite.datatypes.complex.ObjectArrayObject'>)])
    cache.put('example', example)
    print(cache.get('example')) #                (3, [(-1, [1])])
    cache.put('example', cache.get('example')) # TypeError: issubclass() arg 1 must be a class
    print(cache.get('example'))
{code}
 

 

  was:When writing reading an object that contains an object array directly inside another object array from python,


> Python nested object arrays re-serialization failure
> ----------------------------------------------------
>
>                 Key: IGNITE-15266
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15266
>             Project: Ignite
>          Issue Type: Bug
>          Components: python
>    Affects Versions: python-0.5.1
>            Reporter: Bojidar Marinov
>            Priority: Major
>
> When reading an object that contains an object array directly inside another object array from python, and attempting to write it back directly, the following error is raised:
> {code:java}
>   File ".../ignite-python-thin-client/pyignite/utils.py", line 69, in is_hinted
>     return isinstance(value, tuple) and len(value) == 2 and issubclass(value[1], IgniteDataType)
> TypeError: issubclass() arg 1 must be a class
> {code}
>  
> Sample reproduction:
>  
> {code:java}
> from pyignite import Client
> from pyignite.datatypes import ObjectArrayObject
> ignite = Client()
> with ignite.connect('localhost', 10800):
>     cache = ignite.get_or_create_cache('example')
>     example_nested = ((ObjectArrayObject.OBJECT, [1]), ObjectArrayObject)
>     example = (ObjectArrayObject.OBJECT, [example_nested])
>     print(example) #                             (-1, [((-1, [1]), <class 'pyignite.datatypes.complex.ObjectArrayObject'>)])
>     cache.put('example', example)
>     print(cache.get('example')) #                (3, [(-1, [1])])
>     cache.put('example', cache.get('example')) # TypeError: issubclass() arg 1 must be a class
>     print(cache.get('example'))
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)