Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dbittenbender committed Sep 27, 2023
1 parent a3b2614 commit 249dbbf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions databuilder/tests/unit/models/test_table_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ def setUp(self) -> None:
cluster=CLUSTER,
source=SOURCE)

self.start_key = f'{DB}://{CLUSTER}.{SCHEMA}/{TABLE}/_source'
self.start_key = f'{DB}://{CLUSTER}.{SCHEMA}/{TABLE}/github/_source'
self.end_key = f'{DB}://{CLUSTER}.{SCHEMA}/{TABLE}'

def test_get_source_model_key(self) -> None:
source = self.table_source.get_source_model_key()
self.assertEqual(source, f'{DB}://{CLUSTER}.{SCHEMA}/{TABLE}/_source')
self.assertEqual(source, f'{DB}://{CLUSTER}.{SCHEMA}/{TABLE}/github/_source')

def test_get_metadata_model_key(self) -> None:
metadata = self.table_source.get_metadata_model_key()
Expand All @@ -50,7 +50,7 @@ def test_get_metadata_model_key(self) -> None:
def test_create_nodes(self) -> None:
expected_nodes = [{
'LABEL': 'Source',
'KEY': f'{DB}://{CLUSTER}.{SCHEMA}/{TABLE}/_source',
'KEY': f'{DB}://{CLUSTER}.{SCHEMA}/{TABLE}/github/_source',
'source': SOURCE,
'source_type': 'github'
}]
Expand Down
2 changes: 1 addition & 1 deletion metadata/tests/unit/proxy/test_mysql_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_get_table(self, mock_rds_client: Any) -> None:
table.owners = [RDSUser(rk='tester@example.com', email='tester@example.com')]
table.tags = [RDSTag(rk='test', tag_type='default')]
table.badges = [RDSBadge(rk='golden', category='table_status')]
table.source = RDSTableSource(rk='some key', source_type='github', source='/source_file_loc')
table.sources = [RDSTableSource(rk='some key', source_type='github', source='/source_file_loc')]
table.programmatic_descriptions = [
RDSTableProgrammaticDescription(description_source='s3_crawler', description='Test Test Test'),
RDSTableProgrammaticDescription(description_source='quality_report', description='Test Test')
Expand Down
8 changes: 4 additions & 4 deletions metadata/tests/unit/proxy/test_neo4j_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ def test_get_table(self) -> None:
Application(**self.app_consuming, kind='Consuming')
],
last_updated_timestamp=1,
source=Source(source='/source_file_loc',
source_type='github'),
sources=[Source(source='/source_file_loc',
source_type='github')],
is_view=False,
programmatic_descriptions=[
ProgrammaticDescription(source='quality_report',
Expand Down Expand Up @@ -496,8 +496,8 @@ def test_get_table_view_only(self) -> None:
Application(**self.app_consuming, kind='Consuming')
],
last_updated_timestamp=1,
source=Source(source='/source_file_loc',
source_type='github'),
sources=[Source(source='/source_file_loc',
source_type='github')],
is_view=True,
programmatic_descriptions=[
ProgrammaticDescription(source='quality_report',
Expand Down
4 changes: 2 additions & 2 deletions search/search_service/proxy/es_proxy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ def create_search_response(page_index: int, # noqa: C901
msgs[resource_name] = 'Success'
results_per_resource[resource_name] = \
format_resource_response(response=response,
fields_mapping=resource_to_field_mapping[resource])
fields_mapping=resource_to_field_mapping[resource])
else:
msgs[resource_name] = f'Query response for {resource} returned an error: {response.to_dict()}'
last_status_code = 500
logging.error(f"{resource_name} - {msgs[resource_name]}")
else:
logging.warning(f"create_search_response() -> No responses found!")
logging.warning("create_search_response() -> No responses found!")

return SearchResponse(msg=str(msgs),
page_index=page_index,
Expand Down
2 changes: 1 addition & 1 deletion search/search_service/proxy/es_proxy_v2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def get_index_alias_for_resource(self, resource_type: Resource) -> str:
alias_config = current_app.config.get(
config.ES_INDEX_ALIAS_TEMPLATE
)

if alias_config is None:
return f'{resource_str}_search_index_v2_1'

Expand Down

0 comments on commit 249dbbf

Please sign in to comment.