We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wold be nice if SQL Query would return Dict and not unserialized Data. This makes it run:
This is a Function outside of the axl class:
def element_list_to_ordered_dict(elements): return [OrderedDict((element.tag, element.text) for element in row) for row in elements]
This replaces the existing function:
def sql_query(self, query): axl_resp = self.client.executeSQLQuery(sql=query) try: value = element_list_to_ordered_dict(serialize_object(axl_resp)["return"]["rows"]) jsonList = [] for i in range(len(value)): jsonList.append(json.loads(json.dumps(value[i]))) return jsonList except KeyError: # single tuple response value = element_list_to_ordered_dict(serialize_object(axl_resp)["return"]["row"]) jsonList = [] for i in range(len(value)): jsonList.append(json.loads(json.dumps(value[i]))) return jsonList except TypeError: # no SQL tuples return serialize_object(axl_resp)["return"]
Required Libs:
from zeep.helpers import serialize_object from collections import OrderedDict
The text was updated successfully, but these errors were encountered:
Input:
for sql in ucm.run_sql_query('run sql select * from device'): print(sql.name)
Output:
print(sql.name)
AttributeError: 'str' object has no attribute 'name'
How to fix this?
Sorry, something went wrong.
No branches or pull requests
Wold be nice if SQL Query would return Dict and not unserialized Data. This makes it run:
This is a Function outside of the axl class:
This replaces the existing function:
Required Libs:
The text was updated successfully, but these errors were encountered: