You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Esteve Fernandez (JIRA)" <ji...@apache.org> on 2009/02/18 22:44:01 UTC

[jira] Issue Comment Edited: (THRIFT-339) THRIFT-242 is incompatible with arguments with empty key fields

    [ https://issues.apache.org/jira/browse/THRIFT-339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674795#action_12674795 ] 

esteve edited comment on THRIFT-339 at 2/18/09 1:43 PM:
------------------------------------------------------------------

I had to rewrite my latest patch to fix structures with negative field keys, if they end with something lower than -1 For example, the ThriftTest.testException method generated a thrift_spec like this:

{code}
  thrift_spec = (
    (-2, TType.STRUCT, 'err1', (Xception, Xception.thrift_spec, Xception.thrift_limits), None, ), # -2
  )
{code}

which caused some errors (i.e. thrift_spec[-2] didn't exist)

It's not as clean or pretty as the previous patch :( but it works.

      was (Author: esteve):
    I had to rewrite my latest patch to fix structures with negative field keys, if they end with something lower than -1 For example, the ThriftTest.testException method generated a thrift_spec like this:

  thrift_spec = (
    (-2, TType.STRUCT, 'err1', (Xception, Xception.thrift_spec, Xception.thrift_limits), None, ), # -2
  )

which caused some errors (i.e. thrift_spec[-2] didn't exist)

It's not as clean or pretty as the previous patch :( but it works.
  
> THRIFT-242 is incompatible with arguments with empty key fields
> ---------------------------------------------------------------
>
>                 Key: THRIFT-339
>                 URL: https://issues.apache.org/jira/browse/THRIFT-339
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Python)
>            Reporter: Jonathan Ellis
>         Attachments: thrift-339-2.patch, thrift-339-3.patch, thrift-339-4.patch, thrift-339-5.patch, thrift-339-6.patch, thrift-339.patch
>
>
> Esteve's last change to how default values are stored broke stuff.  Here is a quick example:
> {{
> service Test
> {
>   bool  get_slice(i32 start = -1),
> }
> }}
> generates
> {{
> class get_slice_args:
>   thrift_spec = None
>   def __init__(self, start=thrift_spec[-1][4],):
>     self.start = start
> }}
> which is obviously invalid.
> I'm not sure how thrift_spec is supposed to be populated here so I'm unsure how to fix this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.