Resolve mismatch between staging and prod db data for financials (#211)

SQL Creation is now done dynamicly by the definition of the enumeration
type.
This commit is contained in:
2023-10-14 17:16:14 +02:00
committed by GitHub
parent 9f7d714403
commit f8c111d7e2
8 changed files with 76 additions and 112 deletions

View File

@ -3,10 +3,10 @@ from unittest.mock import Mock, patch
import pandas as pd
from aki_prj23_transparenzregister.models.company import FinancialKPIEnum
from aki_prj23_transparenzregister.utils.data_extraction.bundesanzeiger import (
Bundesanzeiger,
)
from aki_prj23_transparenzregister.utils.enum_types import FinancialKPIEnum
def test_extract_auditor_company_no_hits() -> None:

View File

@ -615,7 +615,6 @@ def test_add_relationships_none(empty_relations: list, full_db: Session) -> None
# noinspection SpellCheckingInspection
@pytest.mark.working_on()
@pytest.mark.parametrize(
"documents",
[
@ -980,7 +979,7 @@ def test_add_annual_report(
year,
{
"financials": {
"ebit": 123,
"revenue": 123,
"ebitda": 235,
"short_term_debt": short_term_debt,
},
@ -999,24 +998,9 @@ def test_add_annual_report(
"id": 3,
"company_id": company_id,
"date": pd.to_datetime(date(year, 1, 1)),
"total_volume": float("NaN"),
"ebit": 123.0,
"revenue": 123.0,
"ebitda": 235.0,
"ebit_margin": float("NaN"),
"total_balance": float("NaN"),
"equity": float("NaN"),
"debt": float("NaN"),
"return_on_equity": float("NaN"),
"capital_turnover_rate": float("NaN"),
"current_liabilities": float("NaN"),
"dividends": float("NaN"),
"net_income": float("NaN"),
"assets": float("NaN"),
"long_term_debt": float("NaN"),
"short_term_debt": short_term_debt,
"revenue": float("NaN"),
"cash_flow": float("NaN"),
"current_assets": float("NaN"),
}
]
)
@ -1025,6 +1009,7 @@ def test_add_annual_report(
pd.testing.assert_frame_equal(
expected_results,
df_prior,
check_like=True,
)