# Buggy code
def _set(self, key, value, content_encoding="utf-8", content_type="application/json"):
    gcs_object_key = os.path.join(self.prefix, self._convert_key_to_filepath(key))

    from google.cloud import storage

    gcs = storage.Client(project=self.project)
    bucket = gcs.get_bucket(self.bucket)
    blob = bucket.blob(gcs_object_key)
    if isinstance(value, str):
        blob.upload_from_string(
            value.encode(content_encoding),
            content_encoding=content_encoding,
            content_type=content_type,
        )
    else:
        blob.upload_from_string(value, content_type=content_type)
    return gcs_object_key


# Traceback (TypeError)
$ great_expectations docs build
Building Data Docs...
Traceback (most recent call last):
File "/Users/taylor/repos/great_expectations/.venv/bin/great_expectations", line 11, in <module>
load_entry_point('great-expectations', 'console_scripts', 'great_expectations')()
File "/Users/taylor/repos/great_expectations/great_expectations/cli/cli.py", line 67, in main
cli()
File "/Users/taylor/repos/great_expectations/.venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/taylor/repos/great_expectations/.venv/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/taylor/repos/great_expectations/.venv/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/taylor/repos/great_expectations/.venv/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/taylor/repos/great_expectations/.venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/taylor/repos/great_expectations/.venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/taylor/repos/great_expectations/great_expectations/cli/docs.py", line 40, in docs_build
build_docs(context, site_name=site_name, view=view)
File "/Users/taylor/repos/great_expectations/great_expectations/cli/docs.py", line 132, in build_docs
index_page_locator_infos = context.build_data_docs(site_names=site_names)
File "/Users/taylor/repos/great_expectations/great_expectations/core/usage_statistics/usage_statistics.py", line 217, in usage_statistics_wrapped_method
result = func(*args, **kwargs)
File "/Users/taylor/repos/great_expectations/great_expectations/data_context/data_context.py", line 1255, in build_data_docs
index_page_resource_identifier_tuple = site_builder.build(resource_identifiers)
File "/Users/taylor/repos/great_expectations/great_expectations/render/renderer/site_builder.py", line 237, in build
site_section_builder.build(resource_identifiers=resource_identifiers)
File "/Users/taylor/repos/great_expectations/great_expectations/render/renderer/site_builder.py", line 389, in build
viewable_content
File "/Users/taylor/repos/great_expectations/great_expectations/data_context/store/html_site_store.py", line 144, in set
content_encoding='utf-8', content_type='text/html; charset=utf-8')
File "/Users/taylor/repos/great_expectations/great_expectations/data_context/store/store_backend.py", line 32, in set
return self._set(key, value, **kwargs)
File "/Users/taylor/repos/great_expectations/great_expectations/data_context/store/tuple_store_backend.py", line 473, in _set
content_type=content_type)
TypeError: upload_from_string() got an unexpected keyword argument 'content_encoding'

# Fixed code
def _set(self, key, value, content_encoding="utf-8", content_type="application/json"):
    gcs_object_key = os.path.join(self.prefix, self._convert_key_to_filepath(key))

    from google.cloud import storage

    gcs = storage.Client(project=self.project)
    bucket = gcs.get_bucket(self.bucket)
    blob = bucket.blob(gcs_object_key)
    if isinstance(value, str):
        blob.upload_from_string(
            value.encode(content_encoding), content_type=content_type
        )
    else:
        blob.upload_from_string(value, content_type=content_type)
    return gcs_object_key