We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42652ac commit b77232fCopy full SHA for b77232f
sdks/python/apache_beam/transforms/enrichment_handlers/cloudsql.py
@@ -326,14 +326,12 @@ def _execute_query(
326
try:
327
result = connection.execute(text(query), **params)
328
# Materialize results while transaction is active.
329
+ data: Union[List[Dict[str, Any]], Dict[str, Any]]
330
if is_batch:
- data: List[Dict[str, Any]] = [row._asdict() for row in result]
331
+ data = [row._asdict() for row in result]
332
else:
333
result_row = result.first()
- if result_row:
334
- data: Dict[str, Any] = result_row._asdict()
335
- else:
336
- data = {}
+ data = result_row._asdict() if result_row else {}
337
# Explicitly commit the transaction.
338
transaction.commit()
339
return data
0 commit comments