Return-Path: Delivered-To: apmail-hadoop-avro-dev-archive@minotaur.apache.org Received: (qmail 16390 invoked from network); 19 Nov 2009 19:12:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Nov 2009 19:12:13 -0000 Received: (qmail 36875 invoked by uid 500); 19 Nov 2009 19:12:11 -0000 Delivered-To: apmail-hadoop-avro-dev-archive@hadoop.apache.org Received: (qmail 36826 invoked by uid 500); 19 Nov 2009 19:12:11 -0000 Mailing-List: contact avro-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: avro-dev@hadoop.apache.org Delivered-To: mailing list avro-dev@hadoop.apache.org Received: (qmail 36773 invoked by uid 99); 19 Nov 2009 19:12:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Nov 2009 19:12:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Nov 2009 19:12:00 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 92FAC234C045 for ; Thu, 19 Nov 2009 11:11:39 -0800 (PST) Message-ID: <713459939.1258657899587.JavaMail.jira@brutus> Date: Thu, 19 Nov 2009 19:11:39 +0000 (UTC) From: "Doug Cutting (JIRA)" To: avro-dev@hadoop.apache.org Subject: [jira] Updated: (AVRO-199) Clean up schemas in testio.py In-Reply-To: <1479871312.1258349440237.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AVRO-199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Cutting updated AVRO-199: ------------------------------ Resolution: Fixed Fix Version/s: 1.3.0 Status: Resolved (was: Patch Available) I just committed this. Thanks, Jeff. > Clean up schemas in testio.py > ----------------------------- > > Key: AVRO-199 > URL: https://issues.apache.org/jira/browse/AVRO-199 > Project: Avro > Issue Type: Improvement > Components: python > Reporter: Jeff Hammerbacher > Assignee: Jeff Hammerbacher > Fix For: 1.3.0 > > Attachments: AVRO-199.patch, AVRO-199.patch, AVRO-199.patch > > > As discussed on the mailing list, it would be nice to leverage Python's expressive string syntax to not perform lots of escaping of Avro schemas defined in code and make the schemas more readable. > This patch cleans up schemas in testio.py to make them more readable. Note that to get this to pass the tests, I had to implement a new "remove_whitespace()" helper function to replace the current naive approach to replacing whitespace (s.replace(" ", "") is not going to cut it). I also object to the round-trip string conversion test, as noted in the comments to this patch, but I'll save that change for another patch to better separate concerns. > If this code change is deemed useful, I'll convert the rest of the schemas in the Python code to leverage Python's string formatting. I have a ridiculously naive tool that I used for schema conversion that I threw up at http://github.com/hammer/avro-tools/blob/master/pprint_avsc for those interested. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.