Skip to content

Commit 28df333

Browse files
authored
Merge pull request #611 from aperture-data/release-0.4.50
Release 0.4.50
2 parents 7bd0f1a + ff66474 commit 28df333

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

aperturedb/ParallelLoader.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,8 @@ def get_existing_indices(self):
120120

121121
def query_setup(self, generator: Subscriptable) -> None:
122122
"""
123-
Runs the setup for the loader, which includes creating indices
124-
Currently, it only creates indices for the properties that are
125-
also used for constraint.
123+
Runs the setup for the loader, which includes creating indices.
124+
Currently, it only creates indices for the properties that are used for constraint.
126125
127126
Will only run when the argument generator has a get_indices method that returns
128127
a dictionary of the form:
@@ -150,17 +149,20 @@ def query_setup(self, generator: Subscriptable) -> None:
150149
schema = self.utils.get_schema()
151150

152151
indices_needed = generator.get_indices()
153-
for schema_type, schema_type_plural in [("entity", "entities"), ("connection", "connections")]:
154-
for entity_class in indices_needed.get(schema_type, {}):
155-
for property_name in indices_needed[schema_type][entity_class]:
156-
schema_type = schema.get(schema_type_plural, {}) or {}
157-
if property_name not in schema_type.get('classes', {}).get(entity_class, {}).get('properties', {}):
158-
if not self.utils.create_entity_index(entity_class, property_name):
159-
logger.warning(
160-
f"Failed to create index for {entity_class}.{property_name}")
161-
else:
162-
logger.info(
163-
f"Index for {entity_class}.{property_name} already exists")
152+
153+
# Create indexes for entities
154+
for entity_class in indices_needed.get("entity", {}):
155+
for property_name in indices_needed["entity"].get(entity_class, []):
156+
if not self.utils.create_entity_index(entity_class, property_name):
157+
logger.warning(
158+
f"Failed to create index for {entity_class}.{property_name}")
159+
160+
# Create indexes for connections
161+
for connection_class in indices_needed.get("connection", {}):
162+
for property_name in indices_needed["connection"].get(connection_class, []):
163+
if not self.utils.create_connection_index(connection_class, property_name):
164+
logger.warning(
165+
f"Failed to create index for {connection_class}.{property_name}")
164166

165167
def ingest(self, generator: Subscriptable, batchsize: int = 1, numthreads: int = 4, stats: bool = False) -> None:
166168
"""

aperturedb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import signal
1111
import sys
1212

13-
__version__ = "0.4.49"
13+
__version__ = "0.4.50"
1414

1515
logger = logging.getLogger(__name__)
1616

test/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ def insert_data_from_csv(in_csv_file, rec_count=-1, expected_error_count=0, load
129129
data = data[:rec_count]
130130

131131
loader = ParallelLoader(db)
132-
loader.ingest(data, batchsize=99,
133-
numthreads=8,
132+
loader.ingest(data, batchsize=503,
133+
numthreads=4,
134134
stats=True,
135135
)
136136

0 commit comments

Comments
 (0)