[
https://issues.apache.org/jira/browse/IGNITE-10358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16695695#comment-16695695
]
Dmitry Melnichuk commented on IGNITE-10358:
-------------------------------------------
Since pythonic {{int}} type is of arbitrary size, or unbounded, I chose Ignite
{{Long}} type, as a type with the widest bounds, for its default representation.
Default behavior can always be overridden with a type hint. To quote the
current {{pyignite}} documents:
{quote}Nearly any structure element (inside dict or list) can be replaced with
a two-tuple of (said element, type hint).
{quote}
Unfortunately, there was a bug that prevented the use of type hints inside
{{CollectionObject}} specifically. The related pull request fix it.
Now the snipped can be modified to work with other clients:
{code}
from pyignite import Client
from pyignite.datatypes import *
client = Client()
client.connect('127.0.0.1', 10800)
cache = client.get_or_create_cache("ARRAY_LIST_INTEGER_PY")
cache.put(1, (0, [
(-2147483647, IntObject),
(0, IntObject),
(2147483647, IntObject),
]), key_hint=IntObject, value_hint=CollectionObject)
{code}
> thin python: put collections have no data type specification
> ------------------------------------------------------------
>
> Key: IGNITE-10358
> URL: https://issues.apache.org/jira/browse/IGNITE-10358
> Project: Ignite
> Issue Type: Bug
> Components: thin client
> Affects Versions: 2.7
> Reporter: Stepan Pilschikov
> Assignee: Dmitry Melnichuk
> Priority: Major
> Labels: python
> Fix For: 2.7
>
>
> Trying to put collection with Integers through python thin client and get
> through others clients
> Value type in others clients specified as "collection with Integers"
>
> During GET operation clients throwing exceptions that "type wrong, expected
> Integer type but getting Long type" (because python collection data types are
> not specified)
> Python put and php and js get code/output:
> https://gist.github.com/pilshchikov/7ba7a7a2568c758b7b8680ba9a4215f5
> Also same behavior right for Map data type
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)