{
    "expectation_type" : "expect_column_values_to_match_strftime_format",
    "datasets" : [{
      "data" : {
        "a": ["2019-04-01", "2019-04-02", "2019-04-03", "2019-04-13"],
        "b": ["01/01/2010", "01/01/2011", "01/01/2012", null],
        "c": ["01-01-2019", "01-10-2019", "01/20/2019", "01-30-2019"],
        "d": [1, 2, 3, 4],
        "e": ["2019-04-01", "2019-04-02", "2019-04-03", "2019-04-13"],
        "f": ["1977-05-55T00:00:00", "1980-05-21T13:47:59", "2017-06-12T23:57:59", null]
      },
      "schemas": {
        "spark": {
          "a": "StringType",
          "b": "StringType",
          "c": "StringType",
          "d": "IntegerType",
          "e": "TimestampType",
          "f": "StringType"
        }
      },
      "tests": [{
        "title": "Simple positive test",
        "exact_match_out" : false,
        "in":{
          "column": "a",
          "strftime_format": "%Y-%m-%d"
        },
        "out":{
          "success": true,
          "unexpected_list": []
        }
      },
      {
        "title": "Negative test - wrong format",
        "exact_match_out" : false,
        "in":{
          "column": "a",
          "strftime_format": "%Y%m%d"
        },
        "out":{
          "success": false,
          "unexpected_list": ["2019-04-01", "2019-04-02", "2019-04-03", "2019-04-13"]
        }
      },
      {
        "title": "Positive test w/ nulls",
        "exact_match_out" : false,
        "in":{
          "column": "b",
          "strftime_format": "%d/%m/%Y"
        },
        "out":{
          "success": true,
          "unexpected_list": []
        }
      },
      {
        "title": "Positive test w/ mostly",
        "exact_match_out" : false,
        "in":{
          "column": "c",
          "strftime_format": "%m-%d-%Y",
          "mostly": 0.75
        },
        "out":{
          "success": true,
          "unexpected_list": ["01/20/2019"]
        }
      },
      {
        "title": "Simple negative test",
        "exact_match_out" : false,
        "in":{
          "column": "c",
          "strftime_format": "%m-%d-%Y"
        },
        "out":{
          "success": false,
          "unexpected_list": ["01/20/2019"]
        }
      },
      {
        "title": "Negative test - out of bounds value for month",
        "exact_match_out" : false,
        "in":{
          "column": "a",
          "strftime_format": "%Y-%d-%m"
        },
        "out":{
          "success": false,
          "unexpected_list": ["2019-04-13"]
        }
      },
      {
        "title": "Negative test - iso8601",
        "exact_match_out" : false,
        "in":{
          "column": "f",
          "strftime_format": "%Y-%m-%dT%H:%M:%S"
        },
        "out":{
          "success": false,
          "unexpected_list": ["1977-05-55T00:00:00"]
        }
      },
      {
        "title": "Test raising exception for wrong input data type",
        "exact_match_out" : false,
        "in":{
          "column": "d",
          "strftime_format": "%m-%d-%Y",
          "catch_exceptions": true
        },
        "out":{
          "traceback_substring": "Values passed to expect_column_values_to_match_strftime_format must be of type string"
        }
      },
      {
        "title": "Test raising exception for wrong format",
        "exact_match_out" : false,
        "in":{
          "column": "a",
          "strftime_format": "%D",
          "catch_exceptions": true
        },
        "out":{
          "traceback_substring": "Unable to use provided strftime_format."
        }
      },
      {
        "title": "Negative test - input already datetimes",
        "exact_match_out" : false,
        "suppress_test_for": ["pandas"],
        "in":{
          "column": "e",
          "strftime_format": "%Y-%m-%d",
          "catch_exceptions": true
        },
        "out":{
            "traceback_substring": "Values passed to expect_column_values_to_match_strftime_format must be of type string"
        }
      }]
    }]
}
