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/great_expectations/render/renderer/v3/suite_profile_notebook_renderer.py b/great_expectations/render/renderer/v3/suite_profile_notebook_renderer.py
--- a/great_expectations/render/renderer/v3/suite_profile_notebook_renderer.py
+++ b/great_expectations/render/renderer/v3/suite_profile_notebook_renderer.py
@@ -50,12 +50,9 @@ def render(self, **kwargs) -> nbformat.NotebookNode:
 
         # TODO: <Alex>Update when RBP replaces UCP permanently.</Alex>
         if self._profiler_name:
-            if self._profiler_name == "onboarding-data-assistant":
-                self._add_onboarding_data_assistant_cells()
-            else:
-                self._add_rule_based_profiler_cells()
+            self._add_rule_based_profiler_cells()
         else:
-            self._add_user_configurable_profiler_cells()
+            self._add_onboarding_data_assistant_cells()
 
         self.add_footer()
 
diff --git a/great_expectations/rule_based_profiler/data_assistant/onboarding_data_assistant.py b/great_expectations/rule_based_profiler/data_assistant/onboarding_data_assistant.py
--- a/great_expectations/rule_based_profiler/data_assistant/onboarding_data_assistant.py
+++ b/great_expectations/rule_based_profiler/data_assistant/onboarding_data_assistant.py
@@ -288,6 +288,7 @@ def _build_numeric_columns_rule() -> Rule:
             include_column_name_suffixes=None,
             exclude_column_name_suffixes=[
                 "_id",
+                "_ID",
             ],
             semantic_type_filter_module_name=None,
             semantic_type_filter_class_name=None,
diff --git a/great_expectations/rule_based_profiler/domain_builder/categorical_column_domain_builder.py b/great_expectations/rule_based_profiler/domain_builder/categorical_column_domain_builder.py
--- a/great_expectations/rule_based_profiler/domain_builder/categorical_column_domain_builder.py
+++ b/great_expectations/rule_based_profiler/domain_builder/categorical_column_domain_builder.py
@@ -92,11 +92,14 @@ def __init__(
         if exclude_column_names is None:
             exclude_column_names = [
                 "id",
+                "ID",
+                "Id",
             ]
 
         if exclude_column_name_suffixes is None:
             exclude_column_name_suffixes = [
                 "_id",
+                "_ID",
             ]
 
         if exclude_semantic_types is None:


Test patch:
diff --git a/tests/cli/test_suite.py b/tests/cli/test_suite.py
--- a/tests/cli/test_suite.py
+++ b/tests/cli/test_suite.py
@@ -25,7 +25,7 @@
 from great_expectations.util import deep_filter_properties_iterable, lint_code
 from tests.cli.utils import assert_no_logging_messages_or_tracebacks
 from tests.render.renderer.v3.test_suite_profile_notebook_renderer import (
-    EXPECTED_EXPECTATION_CONFIGURATIONS_USER_CONFIGURABLE_PROFILER,
+    EXPECTED_EXPECTATION_CONFIGURATIONS_ONBOARDING_DATA_ASSISTANT,
 )
 from tests.render.test_util import (
     find_code_in_notebook,
@@ -48,11 +48,13 @@
 validator.expectation_suite = suite
 """
 PROFILER_CODE_CELL_ONBOARDING_DATA_ASSISTANT: str = """\
-data_assistant_result: DataAssistantResult = context.assistants.onboarding.run(
+result = context.assistants.onboarding.run(
     batch_request=batch_request,
     exclude_column_names=exclude_column_names,
 )
-validator.expectation_suite = data_assistant_result.get_expectation_suite(expectation_suite_name=expectation_suite_name)
+validator.expectation_suite = result.get_expectation_suite(
+    expectation_suite_name=expectation_suite_name
+)
 """
 
 
@@ -3147,7 +3149,7 @@ def test_suite_new_profile_runs_notebook_no_jupyter(
     assert len(cells_of_interest_dict) == 1
 
     profiler_code_cell: str = lint_code(
-        code=PROFILER_CODE_CELL_USER_CONFIGURABLE_PROFILER
+        code=PROFILER_CODE_CELL_ONBOARDING_DATA_ASSISTANT
     ).rstrip("\n")
 
     cells_of_interest_dict: Dict[int, dict] = find_code_in_notebook(
@@ -3166,10 +3168,9 @@ def test_suite_new_profile_runs_notebook_no_jupyter(
     context = DataContext(context_root_dir=project_dir)
     assert expectation_suite_name in context.list_expectation_suite_names()
 
-    # TODO: <Alex>Update when RBP replaces UCP permanently.</Alex>
     expected_expectation_configurations: List[
         ExpectationConfiguration
-    ] = EXPECTED_EXPECTATION_CONFIGURATIONS_USER_CONFIGURABLE_PROFILER
+    ] = EXPECTED_EXPECTATION_CONFIGURATIONS_ONBOARDING_DATA_ASSISTANT
 
     suite: ExpectationSuite = context.get_expectation_suite(
         expectation_suite_name=expectation_suite_name
@@ -3373,7 +3374,7 @@ def test_suite_new_profile_runs_notebook_opens_jupyter(
     assert len(cells_of_interest_dict) == 1
 
     profiler_code_cell: str = lint_code(
-        code=PROFILER_CODE_CELL_USER_CONFIGURABLE_PROFILER
+        code=PROFILER_CODE_CELL_ONBOARDING_DATA_ASSISTANT
     ).rstrip("\n")
 
     cells_of_interest_dict: Dict[int, dict] = find_code_in_notebook(
@@ -3392,10 +3393,9 @@ def test_suite_new_profile_runs_notebook_opens_jupyter(
     context = DataContext(context_root_dir=project_dir)
     assert expectation_suite_name in context.list_expectation_suite_names()
 
-    # TODO: <Alex>Update when RBP replaces UCP permanently.</Alex>
     expected_expectation_configurations: List[
         ExpectationConfiguration
-    ] = EXPECTED_EXPECTATION_CONFIGURATIONS_USER_CONFIGURABLE_PROFILER
+    ] = EXPECTED_EXPECTATION_CONFIGURATIONS_ONBOARDING_DATA_ASSISTANT
 
     suite: ExpectationSuite = context.get_expectation_suite(
         expectation_suite_name=expectation_suite_name
diff --git a/tests/conftest.py b/tests/conftest.py
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -2978,7 +2978,7 @@ def alice_columnar_table_single_batch(empty_data_context):
             "my_rule_for_user_ids": {
                 "variables": {},
                 "domain_builder": {
-                    "column_name_suffixes": ["_id"],
+                    "column_name_suffixes": ["_id", "_ID"],
                     "class_name": "MyCustomSemanticTypeColumnDomainBuilder",
                     "module_name": "tests.test_fixtures.rule_based_profiler.plugins.my_custom_semantic_type_column_domain_builder",
                     "semantic_types": ["user_id"],
diff --git a/tests/render/renderer/v3/test_suite_profile_notebook_renderer.py b/tests/render/renderer/v3/test_suite_profile_notebook_renderer.py
--- a/tests/render/renderer/v3/test_suite_profile_notebook_renderer.py
+++ b/tests/render/renderer/v3/test_suite_profile_notebook_renderer.py
@@ -77,11 +77,12 @@
 from great_expectations.checkpoint import SimpleCheckpoint
 from great_expectations.exceptions import DataContextError""",
     # Batch request
-    """batch_request = {
-        "datasource_name": "my_datasource",
-        "data_connector_name": "my_basic_data_connector",
-        "data_asset_name": "Titanic_1912",
-    }
+    """
+batch_request = {
+    "datasource_name": "my_datasource",
+    "data_connector_name": "my_basic_data_connector",
+    "data_asset_name": "Titanic_1912",
+}
 """,
     # OnboardingDataAssistant instantiation/usage
     """\
@@ -219,7 +220,7 @@ def test_suite_notebook_renderer_render_onboarding_data_assistant_configuration(
     )
     notebook = renderer.render()
 
-    snippets = SNIPPETS_USER_CONFIGURABLE_PROFILER
+    snippets = SNIPPETS_ONBOARDING_DATA_ASSISTANT
 
     for snippet in snippets:
         assert find_code_in_notebook(
@@ -380,10 +381,9 @@ def test_notebook_execution_onboarding_data_assistant_pandas_backend(
         "success_percent": 100.0,
     }
 
-    # TODO: <Alex>Update when RBP replaces UCP permanently.</Alex>
     expected_expectation_configurations: List[
         ExpectationConfiguration
-    ] = EXPECTED_EXPECTATION_CONFIGURATIONS_USER_CONFIGURABLE_PROFILER
+    ] = EXPECTED_EXPECTATION_CONFIGURATIONS_ONBOARDING_DATA_ASSISTANT
 
     suite: ExpectationSuite = context.get_expectation_suite(
         expectation_suite_name=expectation_suite_name
@@ -411,8 +411,7 @@ def test_notebook_execution_onboarding_data_assistant_pandas_backend(
         expectations_from_suite,
     ) = get_set_of_columns_and_expectations_from_suite(suite=suite)
 
-    # TODO: <Alex>Update when RBP replaces UCP permanently.</Alex>
-    expected_expectations: Set[str] = EXPECTED_EXPECTATIONS_USER_CONFIGURABLE_PROFILER
+    expected_expectations: Set[str] = EXPECTED_EXPECTATIONS_ONBOARDING_DATA_ASSISTANT
 
     assert columns_with_expectations == set()
     assert expectations_from_suite == expected_expectations
diff --git a/tests/rule_based_profiler/data_assistant/test_volume_data_assistant.py b/tests/rule_based_profiler/data_assistant/test_volume_data_assistant.py
--- a/tests/rule_based_profiler/data_assistant/test_volume_data_assistant.py
+++ b/tests/rule_based_profiler/data_assistant/test_volume_data_assistant.py
@@ -1051,17 +1051,19 @@ def _profiler_config(
                         "round_decimals": 15,
                     },
                     "domain_builder": {
-                        "allowed_semantic_types_passthrough": ["logic"],
-                        "class_name": "CategoricalColumnDomainBuilder",
-                        "cardinality_limit_mode": "$variables.cardinality_limit_mode",
+                        "exclude_column_name_suffixes": ["_id", "_ID"],
                         "module_name": "great_expectations.rule_based_profiler.domain_builder.categorical_column_domain_builder",
+                        "allowed_semantic_types_passthrough": ["logic"],
                         "exclude_column_names": sorted(
                             [
                                 "id",
+                                "ID",
+                                "Id",
                             ]
                             + exclude_column_names
                         ),
-                        "exclude_column_name_suffixes": ["_id"],
+                        "class_name": "CategoricalColumnDomainBuilder",
+                        "cardinality_limit_mode": "$variables.cardinality_limit_mode",
                         "exclude_semantic_types": ["binary", "currency", "identifier"],
                     },
                     "parameter_builders": [
@@ -1753,14 +1755,20 @@ def test_volume_data_assistant_get_metrics_and_expectations_using_explicit_insta
         == expected_expectation_suite.expectations
     )
 
-    assert deep_filter_properties_iterable(
-        properties=data_assistant_result.profiler_config.to_json_dict(),
-        delete_fields={"random_seed"},
-    ) == deep_filter_properties_iterable(
-        properties=quentin_expected_rule_based_profiler_configuration(
-            name=data_assistant_name,
-        ).to_json_dict(),
-        delete_fields={"random_seed"},
+    assert sorted(
+        deep_filter_properties_iterable(
+            properties=data_assistant_result.profiler_config.to_json_dict(),
+            delete_fields={"random_seed"},
+        ),
+        key=lambda element: element[0],
+    ) == sorted(
+        deep_filter_properties_iterable(
+            properties=quentin_expected_rule_based_profiler_configuration(
+                name=data_assistant_name,
+            ).to_json_dict(),
+            delete_fields={"random_seed"},
+        ),
+        key=lambda element: element[0],
     )
 
     data_assistant_result.citation.pop("profiler_config", None)
@@ -1837,9 +1845,12 @@ def test_volume_data_assistant_get_metrics_and_expectations_using_implicit_invoc
             delete_fields={"random_seed"},
         )
     )
-    assert (
-        data_assistant_result_profiler_config_as_json_dict
-        == quentin_expected_rule_based_profiler_configuration_as_json_dict
+    assert sorted(
+        data_assistant_result_profiler_config_as_json_dict,
+        key=lambda element: element[0],
+    ) == sorted(
+        quentin_expected_rule_based_profiler_configuration_as_json_dict,
+        key=lambda element: element[0],
     )
 
     data_assistant_result.citation.pop("profiler_config", None)
@@ -1982,9 +1993,12 @@ def test_volume_data_assistant_get_metrics_and_expectations_using_implicit_invoc
             "categorical_columns_rule"
         ]["domain_builder"]["exclude_semantic_types"]
     )
-    assert (
-        data_assistant_result_profiler_config_as_json_dict
-        == quentin_expected_rule_based_profiler_configuration_as_json_dict
+    assert sorted(
+        data_assistant_result_profiler_config_as_json_dict,
+        key=lambda element: element[0],
+    ) == sorted(
+        quentin_expected_rule_based_profiler_configuration_as_json_dict,
+        key=lambda element: element[0],
     )
 
     data_assistant_result.citation.pop("profiler_config", None)