potix2 commented on a change in pull request #11531:
URL: https://github.com/apache/airflow/pull/11531#discussion_r505815593
##########
File path: airflow/providers/google/cloud/operators/bigquery.py
##########
@@ -947,9 +947,7 @@ def execute(self, context) -> None:
delegate_to=self.delegate_to,
impersonation_chain=self.impersonation_chain,
)
- schema_fields = json.loads(
- gcs_hook.download(gcs_bucket, gcs_object).decode("utf-8") #
type: ignore[attr-defined]
- ) # type: ignore[attr-defined]
+ schema_fields = json.loads(gcs_hook.download(gcs_bucket,
gcs_object))
Review comment:
The call to `decode` requires `bytes` but the return type of `download`
is `Union[str, bytes]`. If we pass `bytes` object to `json.loads`, `decode` is
called in `json.loads`, so I think it's better not to care about the returned
object's type from `download` in this scope.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]