# Buggy code
def _parse_column(self, target, column, package_name, root_dir, path, refs):
    # this should yield ParsedNodes where resource_type == NodeType.Test
    column_name = column["name"]
    description = column.get("description", "")

    refs.add(column_name, description)
    context = {"doc": dbt.context.parser.docs(target, refs.docrefs, column_name)}
    get_rendered(description, context)

    for test in column.get("tests", []):
        try:
            yield self.build_test_node(
                target, package_name, test, root_dir, path, column_name
            )
        except dbt.exceptions.CompilationException as exc:
            dbt.exceptions.warn_or_error("in {}: {}".format(path, exc.msg), None)
            continue


# Traceback (TypeError)
2019-02-27 12:11:45,010 (MainThread): Parsing test.dbt_utils.at_least_one_eng_active_subs_next_fy_earliest_subscription_engagement_date
2019-02-27 12:11:45,014 (MainThread): Flushing usage events
2019-02-27 12:11:45,014 (MainThread): Encountered an error:
2019-02-27 12:11:45,014 (MainThread): list indices must be integers or slices, not dict
2019-02-27 12:11:45,019 (MainThread): Traceback (most recent call last):
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/main.py", line 77, in main
results, succeeded = handle_and_check(args)
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/main.py", line 151, in handle_and_check
task, res = run_from_args(parsed)
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/main.py", line 207, in run_from_args
results = run_from_task(task, cfg, parsed)
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/main.py", line 215, in run_from_task
result = task.run()
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/task/test.py", line 43, in run
results = RunManager(self.config, query, TestRunner).run()
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/runner.py", line 37, in __init__
manifest, linker = self.compile(self.config)
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/runner.py", line 216, in compile
return compiler.compile()
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/compilation.py", line 246, in compile
manifest = dbt.loader.GraphLoader.load_all(self.config, all_projects)
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/loader.py", line 140, in load_all
return cls(project_config, all_projects).load()
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/loader.py", line 122, in load
self._load_schema_tests()
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/loader.py", line 101, in _load_schema_tests
relative_dirs=project.source_paths
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/parser/schemas.py", line 459, in load_and_parse
for result_type, node in v2_results:
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/parser/schemas.py", line 381, in parse_v2_yml
for node_type, node in iterator:
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/parser/schemas.py", line 421, in parse_model
test_args, root_dir, path)
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/parser/schemas.py", line 226, in build_node
original_file_path)
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/parser/schemas.py", line 159, in build_unparsed_node
test_args)
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/parser/schemas.py", line 75, in build_test_raw_sql
kwargs = [as_kwarg(key, test_args[key]) for key in sorted(test_args)]
File "/usr/local/Cellar/dbt/0.12.2/libexec/lib/python3.7/site-packages/dbt/parser/schemas.py", line 75, in <listcomp>
kwargs = [as_kwarg(key, test_args[key]) for key in sorted(test_args)]
TypeError: list indices must be integers or slices, not dict

# Fixed code
def _parse_column(self, target, column, package_name, root_dir, path, refs):
    # this should yield ParsedNodes where resource_type == NodeType.Test
    column_name = column["name"]
    description = column.get("description", "")

    refs.add(column_name, description)
    context = {"doc": dbt.context.parser.docs(target, refs.docrefs, column_name)}
    get_rendered(description, context)

    for test in column.get("tests", []):
        try:
            yield self.build_test_node(
                target, package_name, test, root_dir, path, column_name
            )
        except dbt.exceptions.CompilationException as exc:
            dbt.exceptions.warn_or_error(
                "Compilation warning: Invalid test config given in {}:\n\t{}".format(
                    path, exc.msg
                ),
                None,
            )
            continue