Skip to content

Conversation

@HemangChothani
Copy link
Collaborator

@HemangChothani HemangChothani commented Jan 29, 2020

IPR [10184]

Copy link
Collaborator

@IlyaFaer IlyaFaer left a comment

Choose a reason for hiding this comment

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

Duplicate line should be deleted, other comments are not much of a major

self._preserve_order = False
self._project = client.project
self._schema = schema
self._schema = schema
Copy link
Collaborator

Choose a reason for hiding this comment

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

Duplication

params = self._get_query_params()
if self._page_size is not None:
if self.page_number != 0 and "startIndex" in params:
del params["startIndex"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think, we could write if self.page_number instead of if self.page_number != 0. Page number is not gonna be negative, so this if-statement will be giving True in all cases except self.page_number == 0. And it's little bit shorter.

Copy link
Collaborator Author

@HemangChothani HemangChothani Jan 31, 2020

Choose a reason for hiding this comment

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

Here I need to delete startIndex from query parameter after first request so when first request hit at that time page_num is 0 and after it increments so except page 0 need to delete for every request.

{"f": [{"v": "Wylma Phlyntstone"}]},
{"f": [{"v": "Bhettye Rhubble"}]},
],
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

page_1 and page_2 are constants, I believe

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes this is the response with pages.

self.assertEqual(rows[1], Row(("Bharney Rhubble",), f2i))

second_page = six.next(pages)
rows = list(second_page)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would write in this way:

rows = list(six.next(pages))

As second_page var looks excess

Copy link
Collaborator

@mf2199 mf2199 left a comment

Choose a reason for hiding this comment

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

LGTM aside of @IlyaFaer remarks.

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.

4 participants