Skip to content

Commit

Permalink
Fix AttributeError
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Sep 1, 2023
1 parent f68cec4 commit 6a94a21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spatialpandas/geodataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class GeoDataFrame(pd.DataFrame):
# properties to propagate
_metadata = ['_geometry']

# In Pandas 2.1 will raise AttributeError.
# AttributeError: 'GeoDataFrame' object has no attribute '_geometry'
# Ref: https://github.com/pandas-dev/pandas/issues/51280
_geometry = None

def __init__(self, data=None, index=None, geometry=None, **kwargs):
# Call pandas constructor, always copy
kwargs.pop("copy", None)
Expand Down

0 comments on commit 6a94a21

Please sign in to comment.