Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with scalar/non-scalar lists #753

Merged
merged 1 commit into from
Apr 17, 2014

Conversation

jamesls
Copy link
Member

@jamesls jamesls commented Apr 16, 2014

Fixes #751, originally reported from:
https://forums.aws.amazon.com/thread.jspa?messageID=534743&#534743

The basic issue was that we were looking at the first element in the
list to determine whether or not we should handle something as a list
or not. With --query you can have a heterogenous list so we need
to check all elements, otherwise you'd get lists such as:

foo [{'Value': 'baz', 'Key': 'bar'}]
foo [{'Value': 'baz', 'Key': 'bar'}]

cc @danielgtaylor

Fixes aws#751, originally reported from:
https://forums.aws.amazon.com/thread.jspa?messageID=534743&#534743

The basic issue was that we were looking at the first element in the
list to determine whether or not we should handle something as a list
or not.  With `--query` you can have a heterogenous list so we need
to check all elements, otherwise you'd get lists such as:

```
foo	[{'Value': 'baz', 'Key': 'bar'}]
foo	[{'Value': 'baz', 'Key': 'bar'}]
```
@@ -37,6 +37,7 @@ def format_text(self, data, stream=None):

def assert_text_renders_to(self, data, expected_rendering):
rendered = self.format_text(data)
print(rendered)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this left in on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope I'll remove it.

@danielgtaylor
Copy link
Contributor

LGTM 🚢-it!

@jamesls jamesls merged commit 882ecb9 into aws:develop Apr 17, 2014
@jamesls jamesls deleted the text-heterogeneous-list branch June 23, 2014 18:29
thoward-godaddy pushed a commit to thoward-godaddy/aws-cli that referenced this pull request Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Text output is inconsistent based on order
2 participants