# Buggy code
def execute_macro(
    self,
    macro_name: str,
    manifest: Optional[Manifest] = None,
    project: Optional[str] = None,
    context_override: Optional[Dict[str, Any]] = None,
    kwargs: Dict[str, Any] = None,
    release: bool = False,
) -> agate.Table:
    """Look macro_name up in the manifest and execute its results.

    :param macro_name: The name of the macro to execute.
    :param manifest: The manifest to use for generating the base macro
        execution context. If none is provided, use the internal manifest.
    :param project: The name of the project to search in, or None for the
        first match.
    :param context_override: An optional dict to update() the macro
        execution context.
    :param kwargs: An optional dict of keyword args used to pass to the
        macro.
    :param release: If True, release the connection after executing.
    """
    if kwargs is None:
        kwargs = {}
    if context_override is None:
        context_override = {}

    if manifest is None:
        manifest = self._internal_manifest

    macro = manifest.find_macro_by_name(macro_name, self.config.project_name, project)
    if macro is None:
        if project is None:
            package_name = "any package"
        else:
            package_name = 'the "{}" package'.format(project)

        raise RuntimeException(
            'dbt could not find a macro with the name "{}" in {}'.format(
                macro_name, package_name
            )
        )
    # This causes a reference cycle, as generate_runtime_macro()
    # ends up calling get_adapter, so the import has to be here.
    from dbt.context.providers import generate_runtime_macro

    macro_context = generate_runtime_macro(
        macro=macro, config=self.config, manifest=manifest, package_name=project
    )
    macro_context.update(context_override)

    macro_function = MacroGenerator(macro, macro_context)

    with self.connections.exception_handler(f"macro {macro_name}"):
        try:
            result = macro_function(**kwargs)
        finally:
            if release:
                self.release_connection()
    return result


# Traceback (AttributeError)
2020-03-02 09:10:33,888249 (MainThread): 'decimal.Decimal' object has no attribute 'lower'
2020-03-02 09:10:33,892358 (MainThread): Traceback (most recent call last):
File "/usr/local/Cellar/dbt/0.15.2_1/libexec/lib/python3.7/site-packages/dbt/main.py", line 80, in main
results, succeeded = handle_and_check(args)
File "/usr/local/Cellar/dbt/0.15.2_1/libexec/lib/python3.7/site-packages/dbt/main.py", line 158, in handle_and_check
task, res = run_from_args(parsed)
File "/usr/local/Cellar/dbt/0.15.2_1/libexec/lib/python3.7/site-packages/dbt/main.py", line 210, in run_from_args
results = task.run()
File "/usr/local/Cellar/dbt/0.15.2_1/libexec/lib/python3.7/site-packages/dbt/task/generate.py", line 201, in run
catalog_table = adapter.get_catalog(self.manifest)
File "/usr/local/Cellar/dbt/0.15.2_1/libexec/lib/python3.7/site-packages/dbt/adapters/base/impl.py", line 1016, in get_catalog
results = self._catalog_filter_table(table, manifest)
File "/usr/local/Cellar/dbt/0.15.2_1/libexec/lib/python3.7/site-packages/dbt/adapters/bigquery/impl.py", line 493, in _catalog_filter_table
return super()._catalog_filter_table(table, manifest)
File "/usr/local/Cellar/dbt/0.15.2_1/libexec/lib/python3.7/site-packages/dbt/adapters/base/impl.py", line 998, in _catalog_filter_table
return table.where(_catalog_filter_schemas(manifest))
File "/usr/local/Cellar/dbt/0.15.2_1/libexec/lib/python3.7/site-packages/agate/table/where.py", line 25, in where
if test(row):
File "/usr/local/Cellar/dbt/0.15.2_1/libexec/lib/python3.7/site-packages/dbt/adapters/base/impl.py", line 82, in test
return (table_database.lower(), table_schema.lower()) in schemas
AttributeError: 'decimal.Decimal' object has no attribute 'lower'

# Fixed code
def execute_macro(
    self,
    macro_name: str,
    manifest: Optional[Manifest] = None,
    project: Optional[str] = None,
    context_override: Optional[Dict[str, Any]] = None,
    kwargs: Dict[str, Any] = None,
    release: bool = False,
    text_only_columns: Optional[Iterable[str]] = None,
) -> agate.Table:
    """Look macro_name up in the manifest and execute its results.

    :param macro_name: The name of the macro to execute.
    :param manifest: The manifest to use for generating the base macro
        execution context. If none is provided, use the internal manifest.
    :param project: The name of the project to search in, or None for the
        first match.
    :param context_override: An optional dict to update() the macro
        execution context.
    :param kwargs: An optional dict of keyword args used to pass to the
        macro.
    :param release: If True, release the connection after executing.
    """
    if kwargs is None:
        kwargs = {}
    if context_override is None:
        context_override = {}

    if manifest is None:
        manifest = self._internal_manifest

    macro = manifest.find_macro_by_name(macro_name, self.config.project_name, project)
    if macro is None:
        if project is None:
            package_name = "any package"
        else:
            package_name = 'the "{}" package'.format(project)

        raise RuntimeException(
            'dbt could not find a macro with the name "{}" in {}'.format(
                macro_name, package_name
            )
        )
    # This causes a reference cycle, as generate_runtime_macro()
    # ends up calling get_adapter, so the import has to be here.
    from dbt.context.providers import generate_runtime_macro

    macro_context = generate_runtime_macro(
        macro=macro, config=self.config, manifest=manifest, package_name=project
    )
    macro_context.update(context_override)

    macro_function = MacroGenerator(macro, macro_context)

    with self.connections.exception_handler(f"macro {macro_name}"):
        try:
            result = macro_function(**kwargs)
        finally:
            if release:
                self.release_connection()
    return result