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

[API-898] Make SqlRow support [] operator #478

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

mdumandag
Copy link
Contributor

This is mainly an enhancement for easier access for columns in the row.
Now, the SqlRow implements the __getitem__ magic method.

Implementation of the method simply performs a type check and calls
get_object_with_index if the type of the passed parameter is an
integer type. For any other type, it calls get_object. Hence,
it will throw for any other type than int or str.

Also, put a piece of information about this new way to the documentation
& code samples.

This is mainly an enhancement for easier access for columns in the row.
Now, the `SqlRow` implements the `__getitem__` magic method.

Implementation of the method simply performs a type check and calls
`get_object_with_index` if the type of the passed parameter is an
integer type. For any other type, it calls `get_object`. Hence,
it will throw for any other type than `int` or `str`.

Also, put a piece of information about this new way to the documentation
& code samples.
@mdumandag mdumandag added this to the 5.0 milestone Sep 17, 2021
@mdumandag mdumandag self-assigned this Sep 17, 2021
@srknzl srknzl self-requested a review September 22, 2021 10:23
Copy link
Contributor

@srknzl srknzl left a comment

Choose a reason for hiding this comment

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

My comments are minor so this is an "approve" from me

@mdumandag mdumandag merged commit 61a7eae into hazelcast:master Sep 22, 2021
@mdumandag mdumandag deleted the row-enhancements branch September 22, 2021 12:19
@mdumandag mdumandag changed the title Make SqlRow support [] operator [API-898] Make SqlRow support [] operator Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants