import logging
logger = logging.getLogger(__name__)

from collections import Iterable
from six import string_types, class_types

from great_expectations.types import (
    RequiredKeysDotDict,
    AllowedKeysDotDict,
)

from .base_resource_identifiers import (
OrderedKeysDotDict,
DataContextResourceIdentifier,
)

from great_expectations.datasource.types.batch_kwargs import BatchFingerprint


class DataAssetIdentifier(DataContextResourceIdentifier):
    _key_order = [
        "datasource",
        "generator",
        "generator_asset"
    ]
    _key_types = {
        "datasource" : string_types,
        "generator" : string_types,
        "generator_asset" : string_types,
    }
    # NOTE: This pattern is kinda awkward. It would be nice to ONLY specify _key_order
    _required_keys = set(_key_order)
    _allowed_keys = set(_key_order)


class BatchIdentifier(DataContextResourceIdentifier):
    _key_order = [
        "data_asset_identifier",
        "batch_runtime_id",
    ]
    _key_types = {
        "data_asset_identifier" : DataAssetIdentifier,
        "batch_runtime_id" : string_types,
    }
    # NOTE: This pattern is kinda awkward. It would be nice to ONLY specify _key_order
    _required_keys = set(_key_order)
    _allowed_keys = set(_key_order)


# class RunIdentifier(DataContextResourceIdentifier):
#     _key_order = [
#         "execution_context",
#         "start_time_utc",
#     ]
#     _key_types = {
#         "execution_context" : string_types,
#         "start_time_utc" : int,
#     }
#     # NOTE: This pattern is kinda awkward. It would be nice to ONLY specify _key_order
#     _required_keys = set(_key_order)
#     _allowed_keys = set(_key_order)


class ExpectationSuiteIdentifier(DataContextResourceIdentifier):
    _key_order = [
        "data_asset_name",
        "expectation_suite_name",
    ]
    _key_types = {
        "data_asset_name" : DataAssetIdentifier,
        "expectation_suite_name" : string_types,
    }
    # NOTE: This pattern is kinda awkward. It would be nice to ONLY specify _key_order
    _required_keys = set(_key_order)
    _allowed_keys = set(_key_order)


class ValidationResultIdentifier(DataContextResourceIdentifier):
    _key_order = [
        "expectation_suite_identifier",
        "run_id",
        # "purpose"
    ]
    _key_types = {
        "expectation_suite_identifier": ExpectationSuiteIdentifier,
        "run_id": string_types
    }
    # NOTE: This pattern is kinda awkward. It would be nice to ONLY specify _key_order
    _required_keys = set(_key_order)
    _allowed_keys = set(_key_order)

@@ -846,852 +846,8 @@
 )%0A%0A%0A
-class BatchIdentifier(DataContextResourceIdentifier):%0A    _key_order = %5B%0A        %22data_asset_identifier%22,%0A        %22batch_runtime_id%22,%0A    %5D%0A    _key_types = %7B%0A        %22data_asset_identifier%22 : DataAssetIdentifier,%0A        %22batch_runtime_id%22 : string_types,%0A    %7D%0A    # NOTE: This pattern is kinda awkward. It would be nice to ONLY specify _key_order%0A    _required_keys = set(_key_order)%0A    _allowed_keys = set(_key_order)%0A%0A%0A# class RunIdentifier(DataContextResourceIdentifier):%0A#     _key_order = %5B%0A#         %22execution_context%22,%0A#         %22start_time_utc%22,%0A#     %5D%0A#     _key_types = %7B%0A#         %22execution_context%22 : string_types,%0A#         %22start_time_utc%22 : int,%0A#     %7D%0A#     # NOTE: This pattern is kinda awkward. It would be nice to ONLY specify _key_order%0A#     _required_keys = set(_key_order)%0A#     _allowed_keys = set(_key_order)%0A%0A%0A
 clas

Drop BatchIdenfier and RunIdentifier