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

Commit 9d579cd

Browse files
author
Matthias Ekundayo
committed
changed ValueError to KeyError
1 parent 7a49e67 commit 9d579cd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

data_diff/databases/presto.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from logging import raiseExceptions
12
import re
23
from .database_types import *
34
from .base import Database, import_helper, _query_conn
@@ -46,7 +47,7 @@ def __init__(self, **kw):
4647
# if auth=basic, add basic authenticator for Presto
4748
kw["auth"] = prestodb.auth.BasicAuthentication(kw.pop("user"), kw.pop("password"))
4849
except:
49-
raise ValueError("User or password cannot be missing if auth==basic")
50+
raise KeyError("User or password cannot be missing if auth==basic")
5051

5152
if "cert" in kw: # if a certificate was specified in URI, verify session with cert
5253
cert = kw.pop("cert")

data_diff/databases/snowflake.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self, *, schema: str, **kw):
4343
with open(kw.get("key"), "rb") as key:
4444
p_key = serialization.load_pem_private_key(
4545
key.read(),
46-
password=None if not kw.get("password") else kw.pop("password"),
46+
password=kw.pop("password", None),
4747
backend=default_backend(),
4848
)
4949

0 commit comments

Comments
 (0)