Skip to content

Commit

Permalink
Change the field to data (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
feng-tao authored Oct 2, 2019
1 parent 02ccae3 commit 44f00e8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion metadata_service/api/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def put(self,
:return:
"""
try:
description = json.loads(request.json).get('description')
description = json.loads(request.data).get('description')
self.client.put_column_description(table_uri=table_uri,
column_name=column_name,
description=description)
Expand Down
2 changes: 1 addition & 1 deletion metadata_service/api/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def put(self, table_uri: str) -> Iterable[Any]:
:return:
"""
try:
description = json.loads(request.json).get('description')
description = json.loads(request.data).get('description')
self.client.put_table_description(table_uri=table_uri, description=description)
return None, HTTPStatus.OK

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup, find_packages

__version__ = '1.1.1'
__version__ = '1.1.2'


requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements.txt')
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/api/test_redshit_disable_comment_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ def test_table_comment_edit(self) -> None:
with patch('metadata_service.api.table.get_proxy_client'):
table_uri = 'hive://gold.test_schema/test_table'
url = '/table/' + table_uri + '/description'
response = self.app.test_client().put(url, json=json.dumps({'description': 'test table'}))
response = self.app.test_client().put(url, data=json.dumps({'description': 'test table'}))
self.assertEqual(response.status_code, HTTPStatus.OK)

def test_column_comment_edit(self) -> None:
with patch('metadata_service.api.column.get_proxy_client'):
table_uri = 'hive://gold.test_schema/test_table'
column_name = 'foo'
url = '/table/' + table_uri + '/column/' + column_name + '/description'
response = self.app.test_client().put(url, json=json.dumps({'description': 'test column'}))
response = self.app.test_client().put(url, data=json.dumps({'description': 'test column'}))
self.assertEqual(response.status_code, HTTPStatus.OK)


Expand Down

0 comments on commit 44f00e8

Please sign in to comment.