kacpermuda commented on code in PR #38408:
URL: https://github.com/apache/airflow/pull/38408#discussion_r1571133881


##########
airflow/providers/google/cloud/operators/bigquery.py:
##########
@@ -322,8 +322,26 @@ def execute(self, context: Context):
                     ),
                     method_name="execute_complete",
                 )
+            self._handle_job_error(job)
+            # job.result() returns a RowIterator. Mypy expects an instance of 
SupportsNext[Any] for
+            # the next() call which the RowIterator does not resemble to. 
Hence, ignore the arg-type error.
+            records = next(job.result())  # type: ignore[arg-type]

Review Comment:
   Okay, i had a moment to look into it today. I don't think mypy is right 
here. Everything was almost fine. I was wrong when describing the Trigger - 
there is no problem there, it returns a single row with values only (co column 
names), so the code check what it's supposed to check.
   
   When in deferrable mode but not deferred, it's okay too that we are passing 
a single row to the check_value() / _validate_records() function, and this row 
only contains actual values without column names, f.e. `[Row((1, 'test'), 
{'f0_': 0, 'f1_': 1})]`. This means, that the `all()` check works just fine.
   
   The code was just not prepared for an empty result, so i had to adjust it 
and add some tests. I really don't know how to satisfy mypy here. I wasted some 
time there already but it keeps throwing errors so i just left the ignore as it 
is.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to