Fixed tqdm typos. (#382)

This commit is contained in:
Philipp Horstenkamp 2023-11-14 17:42:38 +01:00 committed by GitHub
parent dd511af3a5
commit 7c1fac28fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 5 deletions

View File

@ -612,7 +612,7 @@ def add_annual_financial_reports(companies: list[dict], db: Session) -> None:
total: int = sum(len(company.get("yearly_results", "")) for company in companies)
with tqdm(
total=total,
desc="Company connections added",
desc="Add financial reports:",
) as pbar:
for company in companies:
yearly_results: dict[str, dict] = company.get("yearly_results", {})

View File

@ -12,7 +12,7 @@ def initialize_network(edges: list, nodes: dict) -> tuple[nx.Graph, pd.DataFrame
Returns:
Graph: Plotly Figure
Metrices: DataFrame with Metrics
Metrics: DataFrame with Metrics
"""
# create edge dataframe
df_edges = pd.DataFrame(edges, columns=["from", "to", "type"])

View File

@ -182,12 +182,12 @@ def _transfer_news_to_sql(config_provider: ConfigProvider, db: Session) -> None:
articles = get_all_news(config_provider)
article_added = 0
sentiments_added = 0
for article in tqdm(articles):
for article in tqdm(articles, desc="Transfer news:"):
if sentiments := add_article_to_sql(article, db):
article_added += 1
sentiments_added += sentiments
logger.info(
f"{article_added} with {sentiments_added} articles where added to the SQL db."
f"{article_added} articles with {sentiments_added} sentiments where added to the SQL db."
)
@ -196,7 +196,6 @@ def transfer_news_to_sql(config_provider: ConfigProvider) -> None:
Args:
config_provider: The configuration prover to connect to the mongodb.
db: A session to connect to an SQL db via SQLAlchemy.
"""
_transfer_news_to_sql(config_provider, get_session(config_provider))