You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@cloudera.org> on 2016/11/09 18:26:07 UTC

[kudu-CR] python: allow passing single strings instead of lists in more places

Hello Jordan Birdsell,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/5019

to review the following change.

Change subject: python: allow passing single strings instead of lists in more places
......................................................................

python: allow passing single strings instead of lists in more places

Several of our APIs take lists of column names, but it's easy to
accidentally just pass a string. If we naively iterate over the string,
we end up interpreting "foo" as ["f", "o", "o"] which is obviously
incorrect.

This patch takes the approach of detecting the string argument and
converting to a singleton list.

An alternative would have been to raise TypeError, but it seems like we
do this conversion in other places, so I decided to be consistent.

Change-Id: I1a81dea5356b66b8860d22f9ee2935072fd4cd6c
---
M python/kudu/client.pyx
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/19/5019/1
-- 
To view, visit http://gerrit.cloudera.org:8080/5019
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a81dea5356b66b8860d22f9ee2935072fd4cd6c
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Jordan Birdsell <jt...@apache.org>

[kudu-CR] python: allow passing single strings instead of lists in more places

Posted by "Jordan Birdsell (Code Review)" <ge...@cloudera.org>.
Jordan Birdsell has submitted this change and it was merged.

Change subject: python: allow passing single strings instead of lists in more places
......................................................................


python: allow passing single strings instead of lists in more places

Several of our APIs take lists of column names, but it's easy to
accidentally just pass a string. If we naively iterate over the string,
we end up interpreting "foo" as ["f", "o", "o"] which is obviously
incorrect.

This patch takes the approach of detecting the string argument and
converting to a singleton list.

An alternative would have been to raise TypeError, but it seems like we
do this conversion in other places, so I decided to be consistent.

Change-Id: I1a81dea5356b66b8860d22f9ee2935072fd4cd6c
Reviewed-on: http://gerrit.cloudera.org:8080/5019
Tested-by: Kudu Jenkins
Reviewed-by: Jordan Birdsell <jt...@apache.org>
---
M python/kudu/client.pyx
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Jordan Birdsell: Looks good to me, approved
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/5019
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a81dea5356b66b8860d22f9ee2935072fd4cd6c
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Jordan Birdsell <jt...@apache.org>
Gerrit-Reviewer: Kudu Jenkins

[kudu-CR] python: allow passing single strings instead of lists in more places

Posted by "Jordan Birdsell (Code Review)" <ge...@cloudera.org>.
Jordan Birdsell has posted comments on this change.

Change subject: python: allow passing single strings instead of lists in more places
......................................................................


Patch Set 1: Code-Review+2

-- 
To view, visit http://gerrit.cloudera.org:8080/5019
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1a81dea5356b66b8860d22f9ee2935072fd4cd6c
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Jordan Birdsell <jt...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-HasComments: No