Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geom-error in generate_wind_farms #354

Closed
KathiEsterl opened this issue Jul 28, 2021 · 5 comments
Closed

geom-error in generate_wind_farms #354

KathiEsterl opened this issue Jul 28, 2021 · 5 comments
Assignees

Comments

@KathiEsterl
Copy link
Contributor

I ran into this error several times and do not know what it is related to:

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
super(GeoDataFrame, self).__setitem__(key, value)
[2021-07-27 15:48:15,224] {taskinstance.py:1150} ERROR - 'NoneType' object has no attribute '_geom'
Traceback (most recent call last):
  File "/home/kathiesterl/vegon_data/lib/python3.7/site-packages/airflow/models/taskinstance.py", line 984, in _run_raw_task
    result = task_copy.execute(context=context)
  File "/home/kathiesterl/vegon_data/lib/python3.7/site-packages/airflow/operators/python_operator.py", line 113, in execute
    return_value = self.execute_callable()
  File "/home/kathiesterl/vegon_data/lib/python3.7/site-packages/airflow/operators/python_operator.py", line 118, in execute_callable
    return self.python_callable(*self.op_args, **self.op_kwargs)
  File "/home/kathiesterl/Git/eGon-data/src/egon/data/processing/wind_farms.py", line 85, in wind_power_parks
    fed_state,
  File "/home/kathiesterl/Git/eGon-data/src/egon/data/processing/wind_farms.py", line 433, in wind_power_states
    "egon_power_plants", schema="supply", con=db.engine(), if_exists="append"
  File "/home/kathiesterl/vegon_data/lib/python3.7/site-packages/geopandas/geodataframe.py", line 1684, in to_postgis
    self, name, con, schema, if_exists, index, index_label, chunksize, dtype
  File "/home/kathiesterl/vegon_data/lib/python3.7/site-packages/geopandas/io/sql.py", line 402, in _write_postgis
    gdf = _convert_to_ewkb(gdf, geom_name, srid)
  File "/home/kathiesterl/vegon_data/lib/python3.7/site-packages/geopandas/io/sql.py", line 286, in _convert_to_ewkb
    geoms = [dumps(geom, srid=srid, hex=True) for geom in gdf[geom_name]]
  File "/home/kathiesterl/vegon_data/lib/python3.7/site-packages/geopandas/io/sql.py", line 286, in <listcomp>
    geoms = [dumps(geom, srid=srid, hex=True) for geom in gdf[geom_name]]
  File "/home/kathiesterl/vegon_data/lib/python3.7/site-packages/shapely/wkb.py", line 42, in dumps
    geom = lgeos.GEOSGeom_clone(ob._geom)
AttributeError: 'NoneType' object has no attribute '_geom'
[2021-07-27 15:48:15,235] {taskinstance.py:1194} INFO - Marking task as FAILED. dag_id=egon-data-processing-pipeline, task_id=generate_wind_farms, execution_date=20210727T115541, start_date=20210727T134721, end_date=20210727T134815
[2021-07-27 15:48:17,043] {local_task_job.py:102} INFO - Task exited with return code 1
@ClaraBuettner
Copy link
Contributor

I can not reproduce this error. Do you still have the complete log of this task? I'm wondering if another error or warning occurred earlier.

@KathiEsterl
Copy link
Contributor Author

I can not reproduce this error. Do you still have the complete log of this task? I'm wondering if another error or warning occurred earlier.

I sent you the complete log via mail and will try and see if this error still occurs.

@KathiEsterl
Copy link
Contributor Author

I can not reproduce this error. Do you still have the complete log of this task? I'm wondering if another error or warning occurred earlier.

I sent you the complete log via mail and will try and see if this error still occurs.

Now that I have found the part to upload files:

error_wind.log

@ClaraBuettner
Copy link
Contributor

The problem also occurred on the server. It is caused by the partial migration to the datasets - when the mv_grid_district creation is skipped due to versioning but the subst_id changed in osmTGmod. Then some subst_ids from the mv_grid_districts don't match to the etrago buses.
This also explains why the issue only occurred sometimes. The problem is fixed automatically when osmTGmod is migrated to the datasets because a new run of osmTGmod then triggers a new definition of the mv grid districts.

@ClaraBuettner
Copy link
Contributor

The migration of osmTGmod to datasets was merged into dev. When this error still occurs, please make sure to re-run the MV grid district creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants