Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 6ac1791

Browse files
author
Matthias Ekundayo
committed
made auth fail explicitly
1 parent 9d579cd commit 6ac1791

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

data_diff/databases/presto.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,13 @@ def __init__(self, **kw):
4141
if kw.get("schema"):
4242
self.default_schema = kw.get("schema")
4343

44-
try:
45-
# checks if user and password are missing when auth=basic
46-
kw.get("auth") == "basic" and "user" in kw and "password" in kw
47-
# if auth=basic, add basic authenticator for Presto
44+
if kw.get("auth") == "basic": # if auth=basic, add basic authenticator for Presto
4845
kw["auth"] = prestodb.auth.BasicAuthentication(kw.pop("user"), kw.pop("password"))
49-
except:
50-
raise KeyError("User or password cannot be missing if auth==basic")
5146

5247
if "cert" in kw: # if a certificate was specified in URI, verify session with cert
5348
cert = kw.pop("cert")
54-
5549
self._conn = prestodb.dbapi.connect(**kw)
5650
self._conn._http_session.verify = cert
57-
5851
else:
5952
self._conn = prestodb.dbapi.connect(**kw)
6053

0 commit comments

Comments
 (0)