Repository: DOV-Vlaanderen/pydov

Issue:
GrondwaterFilter: meetnet_code should be string
The `meetnet_code` XML attribute of the GrondwaterFilter type should be of type 'string' instead of 'integer'.

The next release of the DOV XML schema introduces "meetnet 20 – eDOV erkende boorbedrijven" with code `edov`.

This will cause issues in current pydov implementation:
```python
ValueError: invalid literal for int() with base 10: 'edov'
```

Discussion:

Patch:
diff --git a/docs/output_fields.rst b/docs/output_fields.rst
index 9943774..f469125 100644
--- a/docs/output_fields.rst
+++ b/docs/output_fields.rst
@@ -214,7 +214,7 @@ Groundwater screens (grondwaterfilters)
     y,1,float,194090
     start_grondwaterlocatie_mtaw,1,float,NaN
     gemeente,1,string,Destelbergen
-    meetnet_code,10,integer,1
+    meetnet_code,10,string,1
     aquifer_code,10,string,0100
     grondwaterlichaam_code,10,string,CVS_0160_GWL_1
     regime,10,string,freatisch
diff --git a/pydov/types/grondwaterfilter.py b/pydov/types/grondwaterfilter.py
index 5378743..4c25b43 100644
--- a/pydov/types/grondwaterfilter.py
+++ b/pydov/types/grondwaterfilter.py
@@ -87,7 +87,7 @@ class GrondwaterFilter(AbstractDovType):
         XmlField(name='meetnet_code',
                  source_xpath='/filter/meetnet',
                  definition='Tot welk meetnet behoort deze filter.',
-                 datatype='integer',
+                 datatype='string',
                  xsd_type=XsdType(
                      xsd_schema=_filterDataCodes_xsd,
                      typename='MeetnetEnumType')),


Test patch:
diff --git a/tests/test_search_grondwaterfilter.py b/tests/test_search_grondwaterfilter.py
index 9f086a9..9eff847 100644
--- a/tests/test_search_grondwaterfilter.py
+++ b/tests/test_search_grondwaterfilter.py
@@ -208,4 +208,4 @@ class TestGrondwaterfilterSearch(AbstractTestSearch):
             return_fields=('pkey_filter', 'gw_id', 'filternummer',
                            'meetnet_code'))
 
-        assert df.meetnet_code[0] == 8
+        assert df.meetnet_code[0] == '8'