Skip to content

Commit c355b16

Browse files
authored
add attribute checks
1 parent 5d69444 commit c355b16

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

sqlalchemy_bigquery/parse_url.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ def parse_url(url): # noqa: C901
6464
if "maximum_billing_tier" in query:
6565
raise ValueError("maximum_billing_tier is a deprecated argument")
6666

67-
68-
username = url.username or None
69-
email = url.email or None
70-
71-
logger.critical('parse_url.py username', username)
72-
logger.critical('parse_url.py email', email)
67+
if hasattr(url, 'username'):
68+
username = url.username or None
69+
logger.critical('parse_url.py username', username)
70+
71+
if hasattr(url, 'email'):
72+
email = url.email or None
73+
logger.critical('parse_url.py email', email)
7374

7475
project_id = url.host
7576
location = None

0 commit comments

Comments
 (0)