diff --git a/pittgoogle/bigquery.py b/pittgoogle/bigquery.py index a089419..f48dda2 100644 --- a/pittgoogle/bigquery.py +++ b/pittgoogle/bigquery.py @@ -166,7 +166,7 @@ def _check_bqstorage_client(user_value: bool | None) -> bool: return user_value try: - import google.cloud.bigquery_storage + import google.cloud.bigquery_storage # noqa: F401 except ModuleNotFoundError: return False return True @@ -308,7 +308,8 @@ def schema(self) -> "pd.DataFrame": child_fields = fld.pop("fields", []) # Append parent field name so that the child field name has the syntax 'parent_name.child_name'. # This is the syntax that should be used in SQL queries and also the one shown on BigQuery Console page. - [cfld.update(name=f"{fld['name']}.{cfld['name']}") for cfld in child_fields] + # The dicts update in place. + _ = [cfld.update(name=f"{fld['name']}.{cfld['name']}") for cfld in child_fields] fields.extend([fld] + child_fields) self._schema = pd.DataFrame(fields) diff --git a/pittgoogle/pubsub.py b/pittgoogle/pubsub.py index 2a89020..abb0560 100644 --- a/pittgoogle/pubsub.py +++ b/pittgoogle/pubsub.py @@ -235,10 +235,10 @@ def touch(self) -> None: # Assume this is a simple IAM problem rather than the user being confused about when # to call this method (as can happen below). msg = ( - f"PermissionDenied: You seem to have appropriate IAM permissions to get topics " + "PermissionDenied: You seem to have appropriate IAM permissions to get topics " "in this project but not to create them." ) - raise exceptions.CloudConnectionError(msg) from excep + raise exceptions.CloudConnectionError(msg) from excep except google.api_core.exceptions.PermissionDenied as excep: # User does not have permission to get this topic.