Skip to content

Commit

Permalink
fix: session db name (#1948)
Browse files Browse the repository at this point in the history
* fix db name  in  publisher

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* applied to other compoennts

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* NEO4J_DATABASE_NAME: neo4j.DEFAULT_DATABASE

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* random lintin g error fix

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>
  • Loading branch information
allisonsuarez committed Aug 1, 2022
1 parent 879a002 commit ba5f2a4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _retrieve_tables(self, dataset: DatasetRef) -> Any: # noqa: max-complexity:
columns=cols,
is_view=table['type'] == 'VIEW')

yield(table_meta)
yield table_meta

def _iterate_over_cols(self,
parent: str,
Expand Down
2 changes: 1 addition & 1 deletion databuilder/databuilder/extractor/neo4j_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Neo4jExtractor(Extractor):

DEFAULT_CONFIG = ConfigFactory.from_dict({
NEO4J_MAX_CONN_LIFE_TIME_SEC: 50,
NEO4J_DATABASE_NAME: neo4j.DEFAULT_DATABASE
NEO4J_DATABASE_NAME: neo4j.DEFAULT_DATABASE,
})

def init(self, conf: ConfigTree) -> None:
Expand Down
2 changes: 1 addition & 1 deletion databuilder/databuilder/publisher/neo4j_csv_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def _try_create_index(self, label: str) -> None:
""").render(LABEL=label)

LOGGER.info(f'Trying to create index for label {label} if not exist: {stmt}')
with self._driver.session(self._db_name) as session:
with self._driver.session(database=self._db_name) as session:
try:
session.run(stmt)
except Neo4jError as e:
Expand Down
2 changes: 1 addition & 1 deletion databuilder/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from setuptools import find_packages, setup

__version__ = '7.1.1'
__version__ = '7.1.2'

requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'requirements.txt')
Expand Down

0 comments on commit ba5f2a4

Please sign in to comment.