Skip to content

Commit

Permalink
Fix bug in param prep hint application
Browse files Browse the repository at this point in the history
  • Loading branch information
kislyuk authored and Ubuntu committed Oct 2, 2020
1 parent c825c6c commit 562a617
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions aurora_data_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,19 @@ def prepare_param(self, param_name, param_value):
if param_value is None:
return dict(name=param_name, value=dict(isNull=True))
param_data_api_type = self._data_api_type_map.get(type(param_value), "stringValue")
param = dict(name=param_name, value={param_data_api_type: param_value})
if param_data_api_type == "stringValue" and not isinstance(param_value, str):
param_value = str(param_value)
param["value"][param_data_api_type] = str(param_value)
if type(param_value) in self._data_api_type_hint_map:
param["typeHint"] = self._data_api_type_hint_map[type(param_value)]
return param

# if param_data_api_type == "arrayValue" and len(param_value) > 0:
# return {
# param_data_api_type: {
# self._data_api_type_map.get(type(param_value[0]), "stringValue") + "s": param_value
# }
# }
param = dict(name=param_name, value={param_data_api_type: param_value})
if type(param_value) in self._data_api_type_hint_map:
param["typeHint"] = self._data_api_type_hint_map[type(param_value)]
return param

def _set_description(self, column_metadata):
# see https://www.postgresql.org/docs/9.5/datatype.html
Expand Down

0 comments on commit 562a617

Please sign in to comment.