Skip to content

Commit

Permalink
fix codacy stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
troyraen committed Jul 22, 2024
1 parent 993ffe3 commit 157ebff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pittgoogle/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 169 in pittgoogle/bigquery.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

pittgoogle/bigquery.py#L169

Unused import google.cloud.bigquery_storage
except ModuleNotFoundError:
return False
return True
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pittgoogle/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 157ebff

Please sign in to comment.