| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| row_iterator = self._make_one( | ||
| _mock_client(), api_request, path, schema, page_size=1, max_results=5 | ||
| ) | ||
| df = row_iterator.to_dataframe_iterable() |
There was a problem hiding this comment.
Since this is a generator, use a plural for the variable name dfs or dataframes.
Sorry, something went wrong.
|
|
||
| self.assertIsInstance(df, types.GeneratorType) | ||
|
|
||
| a = next(df) |
There was a problem hiding this comment.
a is a Pandas DataFrame, so df or dataframe would be a more appropriate name.
Sorry, something went wrong.
| {"f": [{"v": "Bhettye Rhubble"}, {"v": "27"}]}, | ||
| ] | ||
| path = "/foo" | ||
| api_request = mock.Mock(return_value={"rows": rows}) |
There was a problem hiding this comment.
I'd like to see side_effect used to test with multiple pages.
Sorry, something went wrong.
| api_request = mock.Mock(return_value={"rows": rows}) | ||
| row_iterator = self._make_one(_mock_client(), api_request, path, schema) | ||
|
|
||
| with self.assertRaises(ValueError): |
There was a problem hiding this comment.
Let's use pytest.raises and match="pandas" to make sure that the ValueError occurs because of the missing pandas dependency.
Sorry, something went wrong.
| self.assertEqual(df_1.age.dtype.name, "int64") | ||
| self.assertEqual(len(df_1), 1) # verify the number of rows | ||
| self.assertEqual( | ||
| df_1.name._get_value(0), "Bengt" |
There was a problem hiding this comment.
Why use _get_value(0) instead of df_1["name"][0]?
Sorry, something went wrong.
Concerned about use of private _get_value in unit tests.
|
@tswast PTAL. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #7339