Skip to content

Commit 82e5967

Browse files
committed
Update defs
1 parent fc74720 commit 82e5967

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

deploy_ai_search/src/deploy_ai_search/environment.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,18 @@ def storage_account_blob_container_name(self) -> str:
173173
This function returns azure blob container name
174174
"""
175175

176-
return os.environ.get(
176+
container = os.environ.get(
177177
f"StorageAccount__{self.normalised_indexer_type}__Container"
178178
)
179179

180+
if container is None:
181+
raise ValueError(
182+
f"""Populate environment variable 'StorageAccount__{
183+
self.normalised_indexer_type}__Container' with container name."""
184+
)
185+
186+
return container
187+
180188
@property
181189
def function_app_end_point(self) -> str:
182190
"""

deploy_ai_search/src/deploy_ai_search/text_2_sql_column_value_store.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ def __init__(
3737
rebuild (bool, optional): Whether to rebuild the index. Defaults to False.
3838
"""
3939
self.indexer_type = IndexerType.TEXT_2_SQL_COLUMN_VALUE_STORE
40+
super().__init__(suffix, rebuild)
41+
4042
self.database_engine = DatabaseEngine[
4143
os.environ["Text2Sql__DatabaseEngine"].upper()
4244
]
43-
super().__init__(suffix, rebuild)
45+
46+
self.parsing_mode = BlobIndexerParsingMode.JSON_LINES
4447

4548
@property
4649
def excluded_fields_for_database_engine(self):
@@ -156,15 +159,14 @@ def get_indexer(self) -> SearchIndexer:
156159
fail_on_unsupported_content_type=False,
157160
index_storage_metadata_only_for_oversized_documents=True,
158161
indexed_file_name_extensions=".jsonl",
159-
parsing_mode=BlobIndexerParsingMode.JSON_LINES,
162+
parsing_mode=self.parsing_mode,
160163
),
161164
max_failed_items=5,
162165
)
163166

164167
indexer = SearchIndexer(
165168
name=self.indexer_name,
166169
description="Indexer to column values",
167-
skillset_name=self.skillset_name,
168170
target_index_name=self.index_name,
169171
data_source_name=self.data_source_name,
170172
schedule=schedule,

deploy_ai_search/src/deploy_ai_search/text_2_sql_schema_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ def __init__(
4444
rebuild (bool, optional): Whether to rebuild the index. Defaults to False.
4545
"""
4646
self.indexer_type = IndexerType.TEXT_2_SQL_SCHEMA_STORE
47+
super().__init__(suffix, rebuild)
4748
self.database_engine = DatabaseEngine[
4849
os.environ["Text2Sql__DatabaseEngine"].upper()
4950
]
50-
super().__init__(suffix, rebuild)
5151

5252
if single_data_dictionary_file:
5353
self.parsing_mode = BlobIndexerParsingMode.JSON_ARRAY

0 commit comments

Comments
 (0)