quillsql 2.1.4__tar.gz → 2.1.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: quillsql
3
- Version: 2.1.4
3
+ Version: 2.1.6
4
4
  Summary: Quill SDK for Python.
5
5
  Home-page: https://github.com/quill-sql/quill-python
6
6
  Author: Quill
@@ -112,7 +112,9 @@ class Quill:
112
112
  if not queries:
113
113
  return {"queryResults": []}
114
114
  if databaseType and databaseType.lower() != pkDatabaseType.lower():
115
- return {"dbMismatched": True, "backendDatbaseType": pkDatabaseType}
115
+ return {"dbMismatched": True, "backendDatabaseType": pkDatabaseType}
116
+ if runQueryConfig and runQueryConfig.get("getColumnsForSchema"):
117
+ return {"queryResults": []}
116
118
  if runQueryConfig and runQueryConfig.get("arrayToMap"):
117
119
  array_to_map(
118
120
  queries, runQueryConfig.get("arrayToMap"), metadata, self.target_connection
@@ -141,10 +143,8 @@ class Quill:
141
143
  queries = [query.strip().rstrip(";") + " limit " + runQueryConfig.get("limitBy") for query in queries]
142
144
  query_results = [self.target_connection.query(query) for query in queries]
143
145
  results["queryResults"] = query_results
144
- if runQueryConfig and runQueryConfig.get("removeFields"):
145
- results["queryResults"] = remove_fields(
146
- query_results, runQueryConfig.get("removeFields")
147
- )
146
+ if runQueryConfig and runQueryConfig.get("fieldsToRemove"):
147
+ results["queryResults"] = [ remove_fields(query_result, runQueryConfig.get("fieldsToRemove")) for query_result in results["queryResults"]]
148
148
  if runQueryConfig and runQueryConfig.get("convertDatatypes"):
149
149
  for query_result in results["queryResults"]:
150
150
  query_result["fields"] = [
@@ -1,18 +1,17 @@
1
1
  import json
2
2
 
3
- def remove_fields(query_result, cursor_description, fields_to_remove):
3
+ def remove_fields(query_result, fields_to_remove):
4
4
  fields = [
5
- {"name": desc[0], "dataTypeID": desc[1]}
6
- for desc in cursor_description
7
- if desc[0] in fields_to_remove
5
+ {"name": field['name'], "dataTypeID": field['dataTypeID']}
6
+ for field in query_result['fields']
7
+ if field['name'] not in fields_to_remove
8
8
  ]
9
- rows = [dict(json.loads(json.dumps(row, default=str))) for row in query_result]
10
-
9
+ rows = [row for row in query_result['rows']]
11
10
  for row in rows:
12
11
  for field in fields_to_remove:
13
12
  if field in row:
14
13
  del row[field]
15
- return {fields, rows}
14
+ return {"fields": fields, "rows": rows}
16
15
 
17
16
  def array_to_map(queries, array_to_map, metadata, target_pool):
18
17
  for i in range(len(queries)):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: quillsql
3
- Version: 2.1.4
3
+ Version: 2.1.6
4
4
  Summary: Quill SDK for Python.
5
5
  Home-page: https://github.com/quill-sql/quill-python
6
6
  Author: Quill
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="quillsql",
5
- version="2.1.4",
5
+ version="2.1.6",
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  "psycopg2-binary",
File without changes
File without changes
File without changes
File without changes