Repository: great-expectations/great_expectations

Issue:
Use cleaner solution for non-truncating division in python 2
Prefer `from __future__ import division` to `1.*x/y`


Discussion:
Done inline during improve_partitions push.

Resolving patch:
diff --git a/docs/example_code/custom_renderer.py b/docs/example_code/custom_renderer.py
--- a/docs/example_code/custom_renderer.py
+++ b/docs/example_code/custom_renderer.py
@@ -190,7 +190,6 @@ def render(cls, ge_dict=None):
         if ge_dict is None:
             ge_dict = {}
 
-<<<<<<< HEAD
         return RenderedDocumentContent(**{
             "renderer_type": "CustomValidationResultsPageRenderer",
             "data_asset_name": "my_data_asset_name",
@@ -258,125 +257,4 @@ def render(cls, ge_dict=None):
                 }),
             ]
         })
-=======
-        return RenderedDocumentContent(
-            **{
-                "renderer_type": "CustomValidationResultsPageRenderer",
-                "data_asset_name": "my_data_asset_name",
-                "full_data_asset_identifier": "my_datasource/my_generator/my_generator_asset",
-                "page_title": "My Page Title",
-                "sections": [
-                    RenderedSectionContent(
-                        **{
-                            "section_name": "Header Content Block",
-                            "content_blocks": [
-                                cls._get_header_content_block(
-                                    header="Header Content Block", subheader="subheader"
-                                )
-                            ],
-                        }
-                    ),
-                    RenderedSectionContent(
-                        **{
-                            "section_name": "Bullet List Content Block",
-                            "content_blocks": [
-                                cls._get_header_content_block(
-                                    header="Bullet List Content Block"
-                                ),
-                                cls._get_bullet_list_content_block(
-                                    header="My Important List",
-                                    subheader="Unremarkable Subheader",
-                                ),
-                            ],
-                        }
-                    ),
-                    RenderedSectionContent(
-                        **{
-                            "section_name": "Table Content Block",
-                            "content_blocks": [
-                                cls._get_header_content_block(
-                                    header="Table Content Block"
-                                ),
-                                cls._get_table_content_block(
-                                    header="My Big Data Table"
-                                ),
-                            ],
-                        }
-                    ),
-                    RenderedSectionContent(
-                        **{
-                            "section_name": "Value List Content Block",
-                            "content_blocks": [
-                                cls._get_header_content_block(
-                                    header="Value List Content Block"
-                                ),
-                                cls._get_value_list_content_block(
-                                    header="My Name Value List"
-                                ),
-                            ],
-                        }
-                    ),
-                    RenderedSectionContent(
-                        **{
-                            "section_name": "Graph Content Block",
-                            "content_blocks": [
-                                cls._get_header_content_block(
-                                    header="Graph Content Block"
-                                ),
-                                cls._get_graph_content_block(
-                                    header="My Big Data Graph"
-                                ),
-                            ],
-                        }
-                    ),
-                    RenderedSectionContent(
-                        **{
-                            "section_name": "String Template Content Block With Icon",
-                            "content_blocks": [
-                                cls._get_header_content_block(
-                                    header="String Template Content Block With Icon"
-                                ),
-                                cls._get_string_template_content_block(),
-                            ],
-                        }
-                    ),
-                    RenderedSectionContent(
-                        **{
-                            "section_name": "String Template Content Block With Tooltip",
-                            "content_blocks": [
-                                cls._get_header_content_block(
-                                    header="String Template Content Block With Tooltip"
-                                ),
-                                cls._get_tooltip_string_template_content_block(),
-                            ],
-                        }
-                    ),
-                    RenderedSectionContent(
-                        **{
-                            "section_name": "Multiple Content Block Section",
-                            "content_blocks": [
-                                cls._get_header_content_block(
-                                    header="Multiple Content Block Section"
-                                ),
-                                cls._get_graph_content_block(
-                                    header="My col-4 Graph", col=4
-                                ),
-                                cls._get_graph_content_block(
-                                    header="My col-4 Graph", col=4
-                                ),
-                                cls._get_graph_content_block(
-                                    header="My col-4 Graph", col=4
-                                ),
-                                cls._get_table_content_block(
-                                    header="My col-6 Table", col=6
-                                ),
-                                cls._get_bullet_list_content_block(
-                                    header="My col-6 List", subheader="subheader", col=6
-                                ),
-                            ],
-                        }
-                    ),
-                ],
-            }
-        )
->>>>>>> develop
+
diff --git a/great_expectations/dataset/dataset.py b/great_expectations/dataset/dataset.py
--- a/great_expectations/dataset/dataset.py
+++ b/great_expectations/dataset/dataset.py
@@ -2709,7 +2709,10 @@ def expect_column_quantile_values_to_be_between(
         )
         # We explicitly allow "None" to be interpreted as +/- infinity
         comparison_quantile_ranges = [
-            [-np.inf if lower_bound is None else lower_bound, np.inf if upper_bound is None else upper_bound]
+            [
+                -np.inf if lower_bound is None else lower_bound,
+                np.inf if upper_bound is None else upper_bound,
+            ]
             for (lower_bound, upper_bound) in quantile_value_ranges
         ]
         success_details = [
diff --git a/great_expectations/dataset/util.py b/great_expectations/dataset/util.py
--- a/great_expectations/dataset/util.py
+++ b/great_expectations/dataset/util.py
@@ -2,7 +2,7 @@
 
 import logging
 import warnings
-from typing import List, Any
+from typing import Any, List
 
 import numpy as np
 import pandas as pd
@@ -574,9 +574,7 @@ def create_multiple_expectations(df, columns, expectation_type, *args, **kwargs)
     return results
 
 
-def get_approximate_percentile_disc_sql(
-    selects: List, sql_engine_dialect: Any
-) -> str:
+def get_approximate_percentile_disc_sql(selects: List, sql_engine_dialect: Any) -> str:
     return ", ".join(
         [
             "approximate "
@@ -591,8 +589,7 @@ def get_approximate_percentile_disc_sql(
 
 
 def check_sql_engine_dialect(
-    actual_sql_engine_dialect: Any,
-    candidate_sql_engine_dialect: Any,
+    actual_sql_engine_dialect: Any, candidate_sql_engine_dialect: Any,
 ) -> bool:
     try:
         return isinstance(actual_sql_engine_dialect, candidate_sql_engine_dialect)


Test patch:
diff --git a/tests/dataset/test_pandas_dataset.py b/tests/dataset/test_pandas_dataset.py
--- a/tests/dataset/test_pandas_dataset.py
+++ b/tests/dataset/test_pandas_dataset.py
@@ -755,15 +755,14 @@ def test_expect_values_quantiles_to_be_between():
     used to be interpreted as None (and thus +-inf) and we'd get false negatives.
     """
     T = [
-        ([1, 2, 3, 4, 5], [.5], [[0, 0]], False),
-        ([0, 0, 0, 0, 0], [.5], [[0, 0]], True),
+        ([1, 2, 3, 4, 5], [0.5], [[0, 0]], False),
+        ([0, 0, 0, 0, 0], [0.5], [[0, 0]], True),
     ]
 
     for data, quantiles, value_ranges, success in T:
         df = ge.dataset.PandasDataset({"A": data})
 
-        validation = df.expect_column_quantile_values_to_be_between("A", {
-            "quantiles": quantiles,
-            "value_ranges": value_ranges,
-        })
+        validation = df.expect_column_quantile_values_to_be_between(
+            "A", {"quantiles": quantiles, "value_ranges": value_ranges,}
+        )
         assert validation.success is success