Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion providers/neo4j/src/airflow/providers/neo4j/hooks/neo4j.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ def _create_driver(self, conn: Connection, encrypted: bool, uri: str) -> Driver:
kwargs: dict[str, Any] = {}
if parsed_uri.scheme in ["bolt", "neo4j"]:
kwargs["encrypted"] = encrypted
return GraphDatabase.driver(uri, auth=(conn.login, conn.password), **kwargs)
auth = None
if conn.login is not None and conn.password is not None:
auth = (conn.login, conn.password)
return GraphDatabase.driver(uri, auth=auth, **kwargs)

def get_uri(self, conn: Connection) -> str:
"""
Expand Down
2 changes: 1 addition & 1 deletion providers/neo4j/tests/unit/neo4j/operators/test_neo4j.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

from unittest import mock

from airflow.providers.common.compat.lazy_compat import timezone
from airflow.providers.neo4j.operators.neo4j import Neo4jOperator
from airflow.utils import timezone

DEFAULT_DATE = timezone.datetime(2015, 1, 1)
DEFAULT_DATE_ISO = DEFAULT_DATE.isoformat()
Expand Down