data-factory-utils 3.2.2__tar.gz → 3.3.0__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.
- {data_factory_utils-3.2.2 → data_factory_utils-3.3.0}/PKG-INFO +1 -1
- {data_factory_utils-3.2.2 → data_factory_utils-3.3.0}/pyproject.toml +1 -1
- {data_factory_utils-3.2.2 → data_factory_utils-3.3.0}/pyproject.toml.orig +1 -1
- {data_factory_utils-3.2.2 → data_factory_utils-3.3.0}/src/data_factory_utils/athena.py +13 -14
- {data_factory_utils-3.2.2 → data_factory_utils-3.3.0}/README.md +0 -0
- {data_factory_utils-3.2.2 → data_factory_utils-3.3.0}/src/data_factory_utils/__init__.py +0 -0
- {data_factory_utils-3.2.2 → data_factory_utils-3.3.0}/src/data_factory_utils/environment.py +0 -0
- {data_factory_utils-3.2.2 → data_factory_utils-3.3.0}/src/data_factory_utils/query.py +0 -0
|
@@ -200,24 +200,23 @@ class AthenaQuery:
|
|
|
200
200
|
# Get the raw query results from the API
|
|
201
201
|
responses = self._get_responses()
|
|
202
202
|
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
column_names: list[str | None] | None = None
|
|
204
|
+
columns: list[list[str | None]] = []
|
|
205
|
+
|
|
205
206
|
for response in responses:
|
|
206
207
|
for row in response["ResultSet"]["Rows"]:
|
|
207
208
|
row_data = [column.get("VarCharValue") for column in row["Data"]]
|
|
208
|
-
rows.append(row_data)
|
|
209
|
-
|
|
210
|
-
if len(rows) == 0:
|
|
211
|
-
return pl.DataFrame({})
|
|
212
209
|
|
|
213
|
-
|
|
214
|
-
|
|
210
|
+
# The first row returned by the response is the names of the columns.
|
|
211
|
+
if column_names is None:
|
|
212
|
+
column_names = row_data
|
|
213
|
+
columns = [[] for _ in column_names]
|
|
214
|
+
continue
|
|
215
215
|
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
for column, value in zip(columns, row_data, strict=True):
|
|
217
|
+
column.append(value)
|
|
218
218
|
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
if column_names is None:
|
|
220
|
+
return pl.DataFrame({})
|
|
221
221
|
|
|
222
|
-
|
|
223
|
-
return pl.DataFrame(dict(zip(column_names, values_in_columns, strict=True)))
|
|
222
|
+
return pl.DataFrame(dict(zip(column_names, columns, strict=True)))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|