Closed victorterpstra closed 3 months ago
Open issue: When duplicating or renaming a scenario from the dashboard we get this type of warning: "SELECT statement has a cartesian product between FROM element(s) "PHARMA_ASCM_TEST.scenario" and FROM element "PHARMA_ASCM_TEST.kpis". Apply join condition(s) between each element to resolve." See also: https://docs.sqlalchemy.org/en/14/changelog/migration_14.html#built-in-from-linting-will-warn-for-any-potential-cartesian-products-in-a-select-statement https://moserei.de/2020/01/02/sqlalchemy-prevent-implicit-cross-join.html https://www.reddit.com/r/flask/comments/ufxjuh/sqlalchemy_join_query_cartesian_product_warning/
Warning is probably caused within _duplicate_scenario_in_db_sql
:
select_sql = (sqlalchemy.select(select_columns).where(sqlalchemy.and_(t.c.scenario_seq == source_scenario_seq, s.c.scenario_seq == new_scenario_seq)))
Note: for future=True, Pandas need to be upgraded to v1.4
Implemented and tested extensively in v0.5.6. From v0.5.7 Future = True will be the default
Using SQLAlchemy 1.4, set the
future=True
when creating an engine. This will add checks to ensure the usage of SQLAlchemy will be compatible with v2.0.