diff --git a/metadata/metadata_service/api/column.py b/metadata/metadata_service/api/column.py index df602014a6..d83d08adae 100644 --- a/metadata/metadata_service/api/column.py +++ b/metadata/metadata_service/api/column.py @@ -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) diff --git a/metadata/metadata_service/api/table.py b/metadata/metadata_service/api/table.py index 61a19864a3..74c37de229 100644 --- a/metadata/metadata_service/api/table.py +++ b/metadata/metadata_service/api/table.py @@ -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 diff --git a/metadata/setup.py b/metadata/setup.py index 9a71b8ae7c..e8d42c769c 100644 --- a/metadata/setup.py +++ b/metadata/setup.py @@ -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') diff --git a/metadata/tests/unit/api/test_redshit_disable_comment_edit.py b/metadata/tests/unit/api/test_redshit_disable_comment_edit.py index f0208cb202..f5d45439d6 100644 --- a/metadata/tests/unit/api/test_redshit_disable_comment_edit.py +++ b/metadata/tests/unit/api/test_redshit_disable_comment_edit.py @@ -11,7 +11,7 @@ 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: @@ -19,7 +19,7 @@ def test_column_comment_edit(self) -> None: 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)