Skip to content

Commit

Permalink
Fixed PostgresToGCSOperator fail on empty resultset for use_server_si…
Browse files Browse the repository at this point in the history
…de_cursor=True (#21307)

Fixed issue #20007
  • Loading branch information
kazanzhy committed Feb 15, 2022
1 parent 00f0025 commit 2eb1056
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/providers/google/cloud/transfers/postgres_to_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def description(self):
"""Fetch first row to initialize cursor description when using server side cursor."""
if not self.initialized:
element = self.cursor.fetchone()
self.rows.append(element)
if element is not None:
self.rows.append(element)
self.initialized = True
return self.cursor.description

Expand Down

0 comments on commit 2eb1056

Please sign in to comment.