Skip to content

Commit

Permalink
Fix connection type
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Jun 11, 2024
1 parent f17f950 commit 8411277
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions abcd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def from_url(cls, url, **kwargs):
r = parse.urlparse(url)
logger.info(r)

if r.scheme == "mongodb":
if ConnectionType[r.scheme] is ConnectionType.mongodb:
conn_settings = {
"host": r.hostname,
"port": r.port,
Expand All @@ -40,8 +40,7 @@ def from_url(cls, url, **kwargs):

return MongoDatabase(db_name=db, **conn_settings, **kwargs)

r.scheme = ConnectionType[r.scheme]
if r.scheme is ConnectionType.opensearch:
if ConnectionType[r.scheme] is ConnectionType.opensearch:
conn_settings = {
"host": r.hostname,
"port": r.port,
Expand Down

0 comments on commit 8411277

Please sign in to comment.