Amsterdam / django-gisserver

Django speaking WFS 2.0 to expose geo data
Mozilla Public License 2.0
38 stars 10 forks source link

Fix type assetion on `XsdElement` and update pre-commit hook. #14

Closed giovannicimolin closed 1 year ago

giovannicimolin commented 1 year ago

I've run into this issue when trying to set up an API:

File "/usr/local/lib/python3.9/site-packages/gisserver/types.py", line 530, in is_many
    or isinstance(self.source, ArrayField)  # needed for ArrayField(size=1)
TypeError: isinstance() arg 2 must be a type or tuple of types

And created this PR with a fix.

Also, the pre-commit hook was failing because the version of black being used wasn't compatible with the click version installed (see this for more details).

giovannicimolin commented 1 year ago

@vdboor Hey! I'm not sure who to ping here, so I pinged you since you last committed here. Let me know if you accept contributions.

giovannicimolin commented 1 year ago

@jjmurre @adamchainz Friendly ping.

adamchainz commented 1 year ago

I'm not a maintainer

vdboor commented 1 year ago

Hi @giovannicimolin , thanks for providing this PR.

Sorry for the delay. My GitHub notifications are so flooded that I easily miss things like this. (will have to add some email filtering I guess)

I've fixed both issues in a slightly different manner (see 392fcaf393aea27ae4aa1200b5b2d23032498e6f and 035c9ebc3a3a1b86c3859d3824608847d85afee0). The main issue was that django.contrib.postgres was not installed, hence ArrayField become None instead of a type.

vdboor commented 1 year ago

I've released 1.2.4 with this fix!

giovannicimolin commented 1 year ago

I'm a bit late here but: thanks a lot for fixing the issue and creating the release! :grin: