Skip to content

Commit 17d019b

Browse files
authored
Merge pull request #25 from ExpediaGroup/msudhir/add_print_for_debug
Adding print statements temporarily to see if logs show up for materialization
2 parents 53dc637 + 7eba517 commit 17d019b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

sdk/python/feast/expediagroup/vectordb/milvus_online_store.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ def __enter__(self):
8383
logger.info(
8484
f"Connecting to Milvus with alias {self.online_config.alias} and host {self.online_config.host} and port {self.online_config.port}."
8585
)
86+
print(
87+
f"Connecting to Milvus with alias {self.online_config.alias} and host {self.online_config.host} and port {self.online_config.port}."
88+
)
8689
connections.connect(
8790
alias=self.online_config.alias,
8891
host=self.online_config.host,
@@ -95,10 +98,12 @@ def __enter__(self):
9598
def __exit__(self, exc_type, exc_value, traceback):
9699
# Disconnecting from Milvus
97100
logger.info("Closing the connection to Milvus")
101+
print("Closing the connection to Milvus")
98102
connections.disconnect(self.online_config.alias)
99103
logger.info("Connection Closed")
100104
if exc_type is not None:
101105
logger.error(f"An exception of type {exc_type} occurred: {exc_value}")
106+
print(f"An exception of type {exc_type} occurred: {exc_value}")
102107

103108

104109
class MilvusOnlineStore(OnlineStore):
@@ -112,15 +117,18 @@ def online_write_batch(
112117
progress: Optional[Callable[[int], Any]],
113118
) -> None:
114119
with MilvusConnectionManager(config.online_store):
120+
print("Starting the process to batch write data into Milvus.")
115121
collection_to_load_data = Collection(table.name)
116122
rows = self._format_data_for_milvus(data, collection_to_load_data)
117123
collection_to_load_data.insert(rows)
118124
# The flush call will seal any remaining segments and send them for indexing
119125
collection_to_load_data.flush()
120126
collection_to_load_data.load()
121127
logger.info("loading data into memory")
128+
print("loading data into memory")
122129
utility.wait_for_loading_complete(table.name)
123130
logger.info("loading data into memory complete")
131+
print("loading data into memory complete")
124132

125133
def online_read(
126134
self,
@@ -160,6 +168,7 @@ def update(
160168

161169
if collection_available:
162170
logger.info(f"Collection {table_to_keep.name} already exists.")
171+
print(f"Collection {table_to_keep.name} already exists.")
163172
else:
164173
if not table_to_keep.schema:
165174
raise ValueError(
@@ -176,6 +185,9 @@ def update(
176185
logger.info(
177186
f"creating collection {table_to_keep.name} with schema: {schema}"
178187
)
188+
print(
189+
f"creating collection {table_to_keep.name} with schema: {schema}"
190+
)
179191
collection = Collection(name=table_to_keep.name, schema=schema)
180192

181193
for field_name, index_params in indexes.items():
@@ -184,6 +196,9 @@ def update(
184196
logger.info(
185197
f"Collection {table_to_keep.name} has been created successfully."
186198
)
199+
print(
200+
f"Collection {table_to_keep.name} has been created successfully."
201+
)
187202

188203
for table_to_delete in tables_to_delete:
189204
collection_available = utility.has_collection(table_to_delete.name)

0 commit comments

Comments
 (0)