Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
fix(es): Getting only netloc for a host field (#219)
Browse files Browse the repository at this point in the history
* fix(es): Getting only netloc for a host field

* chore: update generator version
  • Loading branch information
Vixtir authored Sep 11, 2023
1 parent 021e6e8 commit b2d9f77
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
9 changes: 5 additions & 4 deletions odd_collector/adapters/elasticsearch/adapter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
from typing import Dict, Iterable, Optional
from urllib.parse import urlparse

from elasticsearch import Elasticsearch
from funcy import get_lax
Expand All @@ -22,7 +23,9 @@ def __init__(self, config: ElasticsearchPlugin) -> None:
verify_certs=config.verify_certs,
ca_certs=config.ca_certs,
)
self.__oddrn_generator = ElasticSearchGenerator(host_settings=config.host)
self.__oddrn_generator = ElasticSearchGenerator(
host_settings=urlparse(config.host).netloc
)

def get_data_entity_list(self) -> DataEntityList:
return DataEntityList(
Expand All @@ -34,9 +37,7 @@ def get_data_source_oddrn(self) -> str:
return self.__oddrn_generator.get_data_source_oddrn()

def get_datasets(self) -> Iterable[DataEntity]:
logger.info(
"Start collecting datasets from Elasticsearch at {self.config.host}"
)
logger.info(f"Start collecting datasets from Elasticsearch at {self.config}")
result = []
logger.info("Get indices")
indices = self.__get_indices()
Expand Down
12 changes: 8 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ more-itertools = "8.13.0"
mysql-connector-python = "^8.0.32"
neo4j = "4.3.7"
oracledb = "1.2.1"
oddrn-generator = "^0.1.90"
oddrn-generator = "^0.1.93"
psycopg2-binary = "2.9.3"
python = "^3.9"
pyhumps = "3.0.2"
Expand Down

0 comments on commit b2d9f77

Please sign in to comment.