File tree Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 1010from kafka .admin import NewTopic
1111from kafka .errors import TopicAlreadyExistsError , NoBrokersAvailable
1212from requests import request
13+ from request .exceptions import JSONDecodeError
1314
1415logger = logging .getLogger (__name__ )
1516
@@ -86,9 +87,14 @@ def publish_schemas(
8687 'Content-Type' : 'application/json'
8788 }
8889 )
89- if 'id' not in value_resp .json ():
90+ try :
91+ obj = value_resp .json ()
92+ except json .JSONDecodeError :
93+ logger .error (f'Error decoding response: { value_resp .text } ' )
94+ raise
95+ if 'id' not in obj :
9096 logger .error (f'No id in response: { value_resp .json ()} ' )
91- value_schema_id = value_resp . json () ['id' ]
97+ value_schema_id = obj ['id' ]
9298
9399 key_schema_id = None
94100 if key_schema is not None :
Original file line number Diff line number Diff line change 1- pytest == 6.2.5
2- pytest-cov == 3 .0.0
3- flake8 == 4.0 .1
4- responses == 0.17.0
5- twine == 3.7 .1
6- wheel == 0.37 .1
1+ pytest == 8.3.4
2+ pytest-cov == 6 .0.0
3+ flake8 == 7.1 .1
4+ responses == 0.25.3
5+ twine == 6.0 .1
6+ wheel == 0.45 .1
77
Original file line number Diff line number Diff line change 1- fastavro == 1.4.9
1+ fastavro == 1.9.7
22kafka-python == 2.0.2
3- requests == 2.27.1
3+ requests == 2.32.3
You can’t perform that action at this time.
0 commit comments