You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Jeremy Lewi (JIRA)" <ji...@apache.org> on 2011/07/06 23:47:16 UTC

[jira] [Created] (AVRO-854) python DataFileWriter and DataFileReader should implement __enter__ and __exit__

python DataFileWriter and DataFileReader should implement __enter__ and __exit__
--------------------------------------------------------------------------------

                 Key: AVRO-854
                 URL: https://issues.apache.org/jira/browse/AVRO-854
             Project: Avro
          Issue Type: New Feature
          Components: python
    Affects Versions: 1.5.1
            Reporter: Jeremy Lewi
            Priority: Minor


I think The python classes 
{noformat}
avio.datafile.DataFileWriter
avio.datafile.DataFileReader
{noformat}
should implement the methods
{noformat}
__enter__
__exit__
{noformat}
So that they can be used in with statements as context managers

see http://docs.python.org/release/2.5.2/lib/typecontextmanager.html



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AVRO-854) python DataFileWriter and DataFileReader should implement __enter__ and __exit__

Posted by "Jeremy Lewi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188929#comment-13188929 ] 

Jeremy Lewi commented on AVRO-854:
----------------------------------

Looks good to me. Thanks for implementing this.
                
> python DataFileWriter and DataFileReader should implement __enter__ and __exit__
> --------------------------------------------------------------------------------
>
>                 Key: AVRO-854
>                 URL: https://issues.apache.org/jira/browse/AVRO-854
>             Project: Avro
>          Issue Type: New Feature
>          Components: python
>    Affects Versions: 1.5.1
>            Reporter: Jeremy Lewi
>            Assignee: Harsh J
>            Priority: Minor
>         Attachments: AVRO-854.patch
>
>
> I think The python classes 
> {noformat}
> avio.datafile.DataFileWriter
> avio.datafile.DataFileReader
> {noformat}
> should implement the methods
> {noformat}
> __enter__
> __exit__
> {noformat}
> So that they can be used in with statements as context managers
> see http://docs.python.org/release/2.5.2/lib/typecontextmanager.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AVRO-854) python DataFileWriter and DataFileReader should implement __enter__ and __exit__

Posted by "Doug Cutting (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-854:
------------------------------

       Resolution: Fixed
    Fix Version/s: 1.6.2
           Status: Resolved  (was: Patch Available)

I committed this.  Thanks, Harsh!
                
> python DataFileWriter and DataFileReader should implement __enter__ and __exit__
> --------------------------------------------------------------------------------
>
>                 Key: AVRO-854
>                 URL: https://issues.apache.org/jira/browse/AVRO-854
>             Project: Avro
>          Issue Type: New Feature
>          Components: python
>    Affects Versions: 1.5.1
>            Reporter: Jeremy Lewi
>            Assignee: Harsh J
>            Priority: Minor
>             Fix For: 1.6.2
>
>         Attachments: AVRO-854.patch
>
>
> I think The python classes 
> {noformat}
> avio.datafile.DataFileWriter
> avio.datafile.DataFileReader
> {noformat}
> should implement the methods
> {noformat}
> __enter__
> __exit__
> {noformat}
> So that they can be used in with statements as context managers
> see http://docs.python.org/release/2.5.2/lib/typecontextmanager.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (AVRO-854) python DataFileWriter and DataFileReader should implement __enter__ and __exit__

Posted by "Harsh J (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J reassigned AVRO-854:
----------------------------

    Assignee: Harsh J
    
> python DataFileWriter and DataFileReader should implement __enter__ and __exit__
> --------------------------------------------------------------------------------
>
>                 Key: AVRO-854
>                 URL: https://issues.apache.org/jira/browse/AVRO-854
>             Project: Avro
>          Issue Type: New Feature
>          Components: python
>    Affects Versions: 1.5.1
>            Reporter: Jeremy Lewi
>            Assignee: Harsh J
>            Priority: Minor
>
> I think The python classes 
> {noformat}
> avio.datafile.DataFileWriter
> avio.datafile.DataFileReader
> {noformat}
> should implement the methods
> {noformat}
> __enter__
> __exit__
> {noformat}
> So that they can be used in with statements as context managers
> see http://docs.python.org/release/2.5.2/lib/typecontextmanager.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AVRO-854) python DataFileWriter and DataFileReader should implement __enter__ and __exit__

Posted by "Harsh J (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13179316#comment-13179316 ] 

Harsh J commented on AVRO-854:
------------------------------

Implemented a simple context manager (enter provides the instance itself, no frills, and exit closes the file if there was no exception waiting to be rethrown after) and added a test that runs for python > 2.5 (2.5 has with statement as a future import).

Ran tests with python 2.5 and python 2.6, and both pass (former skips it).
                
> python DataFileWriter and DataFileReader should implement __enter__ and __exit__
> --------------------------------------------------------------------------------
>
>                 Key: AVRO-854
>                 URL: https://issues.apache.org/jira/browse/AVRO-854
>             Project: Avro
>          Issue Type: New Feature
>          Components: python
>    Affects Versions: 1.5.1
>            Reporter: Jeremy Lewi
>            Assignee: Harsh J
>            Priority: Minor
>         Attachments: AVRO-854.patch
>
>
> I think The python classes 
> {noformat}
> avio.datafile.DataFileWriter
> avio.datafile.DataFileReader
> {noformat}
> should implement the methods
> {noformat}
> __enter__
> __exit__
> {noformat}
> So that they can be used in with statements as context managers
> see http://docs.python.org/release/2.5.2/lib/typecontextmanager.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AVRO-854) python DataFileWriter and DataFileReader should implement __enter__ and __exit__

Posted by "Harsh J (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J updated AVRO-854:
-------------------------

    Attachment: AVRO-854.patch
    
> python DataFileWriter and DataFileReader should implement __enter__ and __exit__
> --------------------------------------------------------------------------------
>
>                 Key: AVRO-854
>                 URL: https://issues.apache.org/jira/browse/AVRO-854
>             Project: Avro
>          Issue Type: New Feature
>          Components: python
>    Affects Versions: 1.5.1
>            Reporter: Jeremy Lewi
>            Assignee: Harsh J
>            Priority: Minor
>         Attachments: AVRO-854.patch
>
>
> I think The python classes 
> {noformat}
> avio.datafile.DataFileWriter
> avio.datafile.DataFileReader
> {noformat}
> should implement the methods
> {noformat}
> __enter__
> __exit__
> {noformat}
> So that they can be used in with statements as context managers
> see http://docs.python.org/release/2.5.2/lib/typecontextmanager.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AVRO-854) python DataFileWriter and DataFileReader should implement __enter__ and __exit__

Posted by "Harsh J (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J updated AVRO-854:
-------------------------

    Status: Patch Available  (was: Open)
    
> python DataFileWriter and DataFileReader should implement __enter__ and __exit__
> --------------------------------------------------------------------------------
>
>                 Key: AVRO-854
>                 URL: https://issues.apache.org/jira/browse/AVRO-854
>             Project: Avro
>          Issue Type: New Feature
>          Components: python
>    Affects Versions: 1.5.1
>            Reporter: Jeremy Lewi
>            Assignee: Harsh J
>            Priority: Minor
>         Attachments: AVRO-854.patch
>
>
> I think The python classes 
> {noformat}
> avio.datafile.DataFileWriter
> avio.datafile.DataFileReader
> {noformat}
> should implement the methods
> {noformat}
> __enter__
> __exit__
> {noformat}
> So that they can be used in with statements as context managers
> see http://docs.python.org/release/2.5.2/lib/typecontextmanager.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AVRO-854) python DataFileWriter and DataFileReader should implement __enter__ and __exit__

Posted by "Harsh J (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188916#comment-13188916 ] 

Harsh J commented on AVRO-854:
------------------------------

Hi, do let me know if there are any comments on the patch you'd like me to address.
                
> python DataFileWriter and DataFileReader should implement __enter__ and __exit__
> --------------------------------------------------------------------------------
>
>                 Key: AVRO-854
>                 URL: https://issues.apache.org/jira/browse/AVRO-854
>             Project: Avro
>          Issue Type: New Feature
>          Components: python
>    Affects Versions: 1.5.1
>            Reporter: Jeremy Lewi
>            Assignee: Harsh J
>            Priority: Minor
>         Attachments: AVRO-854.patch
>
>
> I think The python classes 
> {noformat}
> avio.datafile.DataFileWriter
> avio.datafile.DataFileReader
> {noformat}
> should implement the methods
> {noformat}
> __enter__
> __exit__
> {noformat}
> So that they can be used in with statements as context managers
> see http://docs.python.org/release/2.5.2/lib/typecontextmanager.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira