OpenEnergyPlatform / open-MaStR

A collaborative software to download the energy database Marktstammdatenregister (MaStR)
https://open-mastr.readthedocs.io/en/latest/
GNU Affero General Public License v3.0
87 stars 19 forks source link

CSV export fails due to engine settings #420

Closed deniztepe closed 1 year ago

deniztepe commented 1 year ago

Hi @chrwm , is the following error familiar to you?

2023-01-27 15:27:43,557 [INFO] Starting csv-export
2023-01-27 15:27:43,557 [INFO] Technology tables: ['biomass']
2023-01-27 15:27:43,557 [INFO] Additional tables: ['balancing_area']
2023-01-27 15:27:43,557 [INFO] Tables are saved to: C:\Users\deniz\.open-MaStR\data\dataversion-2023-01-27
Performing reverse fill of basic units: 100%|██████████| 1/1 [00:00<00:00,  6.00it/s]
Traceback (most recent call last):
  File "C:\Users\deniz\Documents\open-MaStR\open_mastr\mastr_download_deniztest.py", line 59, in <module>
    mastr.to_csv(["biomass","balancing_area"])
  File "C:\Users\deniz\Documents\open-MaStR\open_mastr\mastr.py", line 346, in to_csv
    db_query_to_csv(db_query=create_db_query
  File "C:\Users\deniz\Documents\open-MaStR\open_mastr\utils\helpers.py", line 717, in db_query_to_csv
    pd.read_sql(
  File "C:\Users\deniz\Anaconda3\envs\mastr-clean\lib\site-packages\pandas\io\sql.py", line 590, in read_sql
    return pandas_sql.read_query(
  File "C:\Users\deniz\Anaconda3\envs\mastr-clean\lib\site-packages\pandas\io\sql.py", line 1560, in read_query
    result = self.execute(*args)
  File "C:\Users\deniz\Anaconda3\envs\mastr-clean\lib\site-packages\pandas\io\sql.py", line 1405, in execute
    return self.connectable.execution_options().execute(*args, **kwargs)
AttributeError: 'OptionEngine' object has no attribute 'execute'
nesnoj commented 1 year ago

Had the same error in https://github.com/OpenEnergyPlatform/open-MaStR/issues/395#issuecomment-1353218300

Looks like SQLA 2.0 related #403

deniztepe commented 1 year ago

That's right. I will try then a similar fix.

deniztepe commented 1 year ago

Closed with #421