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

Test failures on debian/sid #106

Open
avalentino opened this issue Aug 7, 2024 · 0 comments
Open

Test failures on debian/sid #106

avalentino opened this issue Aug 7, 2024 · 0 comments

Comments

@avalentino
Copy link

I'm trying to package pygeofilter for Debian.
I hope that you are fine with it.

Running the test suite in debian/sid (x86_64) fivers the following errors:

============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-8.3.2, pluggy-1.5.0 -- /usr/bin/python3
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/home/antonio/debian/itp/pygeofilter/deb-src-01/pygeofilter/.hypothesis/examples'))
rootdir: /home/antonio/debian/itp/pygeofilter/deb-src-01/pygeofilter
configfile: pyproject.toml
plugins: remotedata-0.4.1, anyio-4.4.0, mock-3.14.0, lazy-fixtures-1.0.7, astropy-0.11.0, instafail-0.5.0, socket-0.7.0, hypothesis-6.105.1, django-4.5.2, timeout-2.3.1, filter-subpackage-0.2.0, cov-5.0.0, astropy-header-0.2.2, xdist-3.6.1, arraydiff-0.6.1, doctestplus-1.2.1
collecting ... collected 390 items

tests/backends/django/test_django_evaluate.py::test_id_eq PASSED         [  0%]
[...]
tests/backends/django/test_django_evaluate.py::test_intersects_mulitipoint_1_inv FAILED [ 10%]
tests/backends/django/test_django_evaluate.py::test_intersects_mulitipoint_2 FAILED [ 11%]
tests/backends/django/test_django_evaluate.py::test_intersects_mulitipoint_2_inv FAILED [ 11%]
tests/backends/django/test_django_evaluate.py::test_intersects_linestring FAILED [ 11%]
tests/backends/django/test_django_evaluate.py::test_intersects_linestring__inv FAILED [ 11%]
tests/backends/django/test_django_evaluate.py::test_intersects_multilinestring FAILED [ 12%]
tests/backends/django/test_django_evaluate.py::test_intersects_multilinestring_inv FAILED [ 12%]
tests/backends/django/test_django_evaluate.py::test_intersects_polygon FAILED [ 12%]
tests/backends/django/test_django_evaluate.py::test_intersects_polygon_inv FAILED [ 12%]
tests/backends/django/test_django_evaluate.py::test_intersects_multipolygon FAILED [ 13%]
tests/backends/django/test_django_evaluate.py::test_intersects_multipolygon_inv FAILED [ 13%]
tests/backends/django/test_django_evaluate.py::test_intersects_envelope PASSED [ 13%]
tests/backends/django/test_django_evaluate.py::test_intersects_envelope_inv PASSED [ 13%]
tests/backends/django/test_django_evaluate.py::test_dwithin FAILED       [ 14%]
tests/backends/django/test_django_evaluate.py::test_dwithin_inv FAILED   [ 14%]
tests/backends/django/test_django_evaluate.py::test_beyond FAILED        [ 14%]
tests/backends/django/test_django_evaluate.py::test_beyond_inv FAILED    [ 14%]
tests/backends/django/test_django_evaluate.py::test_bbox PASSED          [ 15%]
[...]
tests/backends/sqlalchemy/test_evaluate.py::test_during_td_dt PASSED     [ 28%]
tests/backends/sqlalchemy/test_evaluate.py::test_intersects_point FAILED [ 28%]
tests/backends/sqlalchemy/test_evaluate.py::test_intersects_mulitipoint_1 FAILED [ 29%]
tests/backends/sqlalchemy/test_evaluate.py::test_intersects_mulitipoint_2 FAILED [ 29%]
tests/backends/sqlalchemy/test_evaluate.py::test_intersects_linestring FAILED [ 29%]
tests/backends/sqlalchemy/test_evaluate.py::test_intersects_multilinestring FAILED [ 30%]
tests/backends/sqlalchemy/test_evaluate.py::test_intersects_polygon FAILED [ 30%]
tests/backends/sqlalchemy/test_evaluate.py::test_intersects_multipolygon FAILED [ 30%]
tests/backends/sqlalchemy/test_evaluate.py::test_intersects_envelope PASSED [ 30%]
[...]
tests/native/test_evaluate.py::test_array_json PASSED                    [ 38%]
tests/native/test_evaluate.py::test_spatial FAILED                       [ 38%]
tests/native/test_evaluate.py::test_spatial_json FAILED                  [ 38%]
tests/native/test_evaluate.py::test_arithmetic PASSED                    [ 39%]
[...]
tests/native/test_evaluate.py::test_nested PASSED                        [ 40%]
tests/parsers/cql2_json/test_cql2_spec_fixtures.py::test_fixtures FAILED [ 40%]
tests/parsers/cql2_json/test_parser.py::test_attribute_eq_literal PASSED [ 40%]
[...]
tests/parsers/ecql/test_parser.py::test_attribute_before_or_during_dr_dt PASSED [ 67%]
tests/parsers/ecql/test_parser.py::test_intersects_attr_point FAILED     [ 67%]
tests/parsers/ecql/test_parser.py::test_disjoint_linestring_attr FAILED  [ 68%]
tests/parsers/ecql/test_parser.py::test_contains_attr_polygon FAILED     [ 68%]
tests/parsers/ecql/test_parser.py::test_within_multipolygon_attr FAILED  [ 68%]
tests/parsers/ecql/test_parser.py::test_touches_attr_multilinestring FAILED [ 68%]
tests/parsers/ecql/test_parser.py::test_crosses_attr_multilinestring FAILED [ 69%]
tests/parsers/ecql/test_parser.py::test_overlaps_attr_multilinestring FAILED [ 69%]
tests/parsers/ecql/test_parser.py::test_intersects_attr_point_ewkt FAILED [ 69%]
tests/parsers/ecql/test_parser.py::test_intersects_attr_geometrycollection FAILED [ 70%]
tests/parsers/ecql/test_parser.py::test_relate_attr_polygon FAILED       [ 70%]
tests/parsers/ecql/test_parser.py::test_dwithin_attr_polygon FAILED      [ 70%]
tests/parsers/ecql/test_parser.py::test_beyond_attr_polygon FAILED       [ 70%]
tests/parsers/ecql/test_parser.py::test_bbox_simple PASSED               [ 71%]
[...]
tests/parsers/ecql/test_parser.py::test_attribute_arithmetic_div_sub_bracketted PASSED [ 73%]
tests/parsers/ecql/test_parser.py::test_function_no_arg FAILED           [ 73%]
tests/parsers/ecql/test_parser.py::test_function_single_arg PASSED       [ 73%]
[...]
=================================== FAILURES ===================================
____________________________ test_intersects_point _____________________________

    @pytest.mark.django_db
    def test_intersects_point():
>       evaluate("INTERSECTS(geometry, POINT(1 1.0))", ("A",))

tests/backends/django/test_django_evaluate.py:304: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/backends/django/test_django_evaluate.py:41: in evaluate
    filters = to_filter(ast, mapping, mapping_choices)
pygeofilter/backends/django/evaluate.py:162: in to_filter
    return DjangoFilterEvaluator(field_mapping, mapping_choices).evaluate(root)
pygeofilter/backends/evaluator.py:103: in evaluate
    sub_args = [self.evaluate(sub_node, False) for sub_node in subnodes]
pygeofilter/backends/evaluator.py:109: in evaluate
    result = handler(self, node, *sub_args)
pygeofilter/backends/django/evaluate.py:144: in geometry
    return GEOSGeometry(json.dumps(node.__geo_interface__))
/usr/lib/python3/dist-packages/django/contrib/gis/geos/geometry.py:744: in __init__
    ogr = gdal.OGRGeometry.from_json(geo_input)
/usr/lib/python3/dist-packages/django/contrib/gis/gdal/geometries.py:166: in from_json
    return OGRGeometry(OGRGeometry._from_json(force_bytes(geom_input)))
/usr/lib/python3/dist-packages/django/contrib/gis/gdal/geometries.py:153: in _from_json
    return capi.from_json(geom_input)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = None, func = <_FuncPtr object at 0x719c9f5f87d0>
cargs = (b'{"type": "Point", "coordinates": [1.0, 1.0, null, null]}',)

    def check_geom(result, func, cargs):
        "Check a function that returns a geometry."
        # OGR_G_Clone may return an integer, even though the
        # restype is set to c_void_p
        if isinstance(result, int):
            result = c_void_p(result)
        if not result:
>           raise GDALException(
                'Invalid geometry pointer returned from "%s".' % func.__name__
            )
E           django.contrib.gis.gdal.error.GDALException: Invalid geometry pointer returned from "OGR_G_CreateGeometryFromJson".

/usr/lib/python3/dist-packages/django/contrib/gis/gdal/prototypes/errcheck.py:82: GDALException

[...]

____________________________ test_intersects_point _____________________________

db_session = <sqlalchemy.orm.scoping.scoped_session object at 0x719c8ea46240>

    def test_intersects_point(db_session):
>       evaluate(db_session, "INTERSECTS(geometry, POINT(1 1.0))", ("A",))

tests/backends/sqlalchemy/test_evaluate.py:333: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/backends/sqlalchemy/test_evaluate.py:157: in evaluate
    filters = to_filter(ast, FIELD_MAPPING, filter_option)
pygeofilter/backends/sqlalchemy/evaluate.py:148: in to_filter
    return SQLAlchemyFilterEvaluator(field_mapping, undefined_as_null).evaluate(ast)
pygeofilter/backends/evaluator.py:103: in evaluate
    sub_args = [self.evaluate(sub_node, False) for sub_node in subnodes]
pygeofilter/backends/evaluator.py:109: in evaluate
    result = handler(self, node, *sub_args)
pygeofilter/backends/sqlalchemy/evaluate.py:130: in geometry
    return filters.parse_geometry(node.__geo_interface__)
pygeofilter/backends/sqlalchemy/filters.py:27: in parse_geometry
    wkt = shape(geom).wkt
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'pygeoif.geometry.Point'>
geo_interface = {'coordinates': (1.0, 1.0, None, None), 'type': 'Point'}

    @classmethod
    def _from_dict(cls, geo_interface: GeoInterface) -> "Point":
        cls._check_dict(geo_interface)
>       return cls(*geo_interface["coordinates"])
E       TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:324: TypeError
---------------------------- Captured stdout setup -----------------------------
2024-08-07 10:11:35,867 INFO sqlalchemy.engine.Engine BEGIN (implicit)
------------------------------ Captured log setup ------------------------------
INFO     sqlalchemy.engine.Engine:base.py:2699 BEGIN (implicit)
--------------------------- Captured stdout teardown ---------------------------
2024-08-07 10:11:35,912 INFO sqlalchemy.engine.Engine ROLLBACK
---------------------------- Captured log teardown -----------------------------
INFO     sqlalchemy.engine.Engine:base.py:2702 ROLLBACK

[...]


_________________________________ test_spatial _________________________________

data = [Record(str_attr='this is a test', maybe_str_attr=None, int_attr=5, float_attr=5.5, date_attr=datetime.date(2010, 1, 1...ezone.utc), point_attr=<POINT (2 2)>, array_attr=[1, 2, 3, 4, 5], nested_attr=Nested(str_attr='this is another test'))]

    def test_spatial(data):
        result = filter_(
            parse("INTERSECTS(point_attr, ENVELOPE (0 1 0 1))"),
            data,
        )
        assert len(result) == 1 and result[0] is data[0]
    
>       result = filter_(
            parse("EQUALS(point_attr, POINT(2 2))"),
            data,
        )

tests/native/test_evaluate.py:377: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/native/test_evaluate.py:68: in filter_
    ).evaluate(ast)
pygeofilter/backends/evaluator.py:103: in evaluate
    sub_args = [self.evaluate(sub_node, False) for sub_node in subnodes]
pygeofilter/backends/evaluator.py:109: in evaluate
    result = handler(self, node, *sub_args)
pygeofilter/backends/native/evaluate.py:243: in geometry
    key = self._add_local(shapely.geometry.shape(node))
/usr/lib/python3/dist-packages/shapely/geometry/geo.py:95: in shape
    return Point(ob["coordinates"])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <class 'shapely.geometry.point.Point'>, args = ((2.0, 2.0, None, None),)
coords = array([2.0, 2.0, None, None], dtype=object)

    def __new__(self, *args):
        if len(args) == 0:
            # empty geometry
            # TODO better constructor
            return shapely.from_wkt("POINT EMPTY")
        elif len(args) > 3:
            raise TypeError(f"Point() takes at most 3 arguments ({len(args)} given)")
        elif len(args) == 1:
            coords = args[0]
            if isinstance(coords, Point):
                return coords
    
            # Accept either (x, y) or [(x, y)]
            if not hasattr(coords, "__getitem__"):  # generators
                coords = list(coords)
            coords = np.asarray(coords).squeeze()
        else:
            # 2 or 3 args
            coords = np.array(args).squeeze()
    
        if coords.ndim > 1:
            raise ValueError(
                f"Point() takes only scalar or 1-size vector arguments, got {args}"
            )
        if not np.issubdtype(coords.dtype, np.number):
>           coords = [float(c) for c in coords]
E           TypeError: float() argument must be a string or a real number, not 'NoneType'

/usr/lib/python3/dist-packages/shapely/geometry/point.py:77: TypeError
______________________________ test_spatial_json _______________________________

data_json = [{'geometry': {'coordinates': (1, 1), 'type': 'Point'}, 'properties': {'array_attr': [2, 3], 'date_attr': '2010-01-01'...4, 5], 'date_attr': '2010-01-10', 'datetime_attr': '2010-01-10T00:00:00Z', 'float_attr': 8.5, ...}, 'type': 'Feature'}]

    def test_spatial_json(data_json):
        result = filter_json(
            parse("INTERSECTS(point_attr, ENVELOPE (0 1 0 1))"),
            data_json,
        )
        assert len(result) == 1 and result[0] is data_json[0]
    
>       result = filter_json(
            parse("EQUALS(point_attr, POINT(2 2))"),
            data_json,
        )

tests/native/test_evaluate.py:397: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/native/test_evaluate.py:110: in filter_json
    filter_expr = NativeEvaluator(math.__dict__, attr_map, use_getattr=False).evaluate(
pygeofilter/backends/evaluator.py:103: in evaluate
    sub_args = [self.evaluate(sub_node, False) for sub_node in subnodes]
pygeofilter/backends/evaluator.py:109: in evaluate
    result = handler(self, node, *sub_args)
pygeofilter/backends/native/evaluate.py:243: in geometry
    key = self._add_local(shapely.geometry.shape(node))
/usr/lib/python3/dist-packages/shapely/geometry/geo.py:95: in shape
    return Point(ob["coordinates"])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <class 'shapely.geometry.point.Point'>, args = ((2.0, 2.0, None, None),)
coords = array([2.0, 2.0, None, None], dtype=object)

    def __new__(self, *args):
        if len(args) == 0:
            # empty geometry
            # TODO better constructor
            return shapely.from_wkt("POINT EMPTY")
        elif len(args) > 3:
            raise TypeError(f"Point() takes at most 3 arguments ({len(args)} given)")
        elif len(args) == 1:
            coords = args[0]
            if isinstance(coords, Point):
                return coords
    
            # Accept either (x, y) or [(x, y)]
            if not hasattr(coords, "__getitem__"):  # generators
                coords = list(coords)
            coords = np.asarray(coords).squeeze()
        else:
            # 2 or 3 args
            coords = np.array(args).squeeze()
    
        if coords.ndim > 1:
            raise ValueError(
                f"Point() takes only scalar or 1-size vector arguments, got {args}"
            )
        if not np.issubdtype(coords.dtype, np.number):
>           coords = [float(c) for c in coords]
E           TypeError: float() argument must be a string or a real number, not 'NoneType'

/usr/lib/python3/dist-packages/shapely/geometry/point.py:77: TypeError
________________________________ test_fixtures _________________________________

    def test_fixtures():
        """Test against fixtures from spec documentation.
    
        Parses both cql2_text and cql2_json from spec
        documentation and makes sure AST is the same
        and that json when each are converted back to
        cql2_json is the same.
        """
        with open(fixtures) as f:
            examples = json.load(f)
    
        for _, v in examples.items():
            t = v["text"].replace("filter=", "")
            j = v["json"]
            parsed_text = text_parse(t)
            parsed_json = json_parse(j)
>           assert parsed_text == parsed_json

tests/parsers/cql2_json/test_cql2_spec_fixtures.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
/usr/lib/python3/dist-packages/pygeoif/geometry.py:627: in _from_dict
    return cls(
/usr/lib/python3/dist-packages/pygeoif/geometry.py:543: in __init__
    exterior = LinearRing(shell)
/usr/lib/python3/dist-packages/pygeoif/geometry.py:473: in __init__
    super().__init__(coordinates)
/usr/lib/python3/dist-packages/pygeoif/geometry.py:365: in __init__
    object.__setattr__(self, "_geoms", self._set_geoms(coordinates))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coordinates = ((43.5845, -79.5442, None, None), (43.6079, -79.4893, None, None), (43.5677, -79.4632, None, None), (43.6129, -79.3925, None, None), (43.6223, -79.3238, None, None), (43.6576, -79.3163, None, None), ...)

    @staticmethod
    def _set_geoms(coordinates: LineType) -> Tuple[Point, ...]:
        geoms = []
        last_len = None
        for coord in dedupe(coordinates):
            if len(coord) != last_len and last_len is not None:
                msg = (  # type: ignore [unreachable]
                    "All coordinates must have the same dimension"
                )
                raise DimensionError(
                    msg,
                )
            last_len = len(coord)
>           point = Point(*coord)
E           TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:434: TypeError
__________________________ test_intersects_attr_point __________________________

    def test_intersects_attr_point():
        result = parse("INTERSECTS(geometry, POINT(1 1))")
>       assert result == ast.GeometryIntersects(
            ast.Attribute("geometry"),
            values.Geometry(geometry.Point(1, 1).__geo_interface__),
        )

tests/parsers/ecql/test_parser.py:288: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'pygeoif.geometry.Point'>
geo_interface = {'coordinates': (1.0, 1.0, None, None), 'type': 'Point'}

    @classmethod
    def _from_dict(cls, geo_interface: GeoInterface) -> "Point":
        cls._check_dict(geo_interface)
>       return cls(*geo_interface["coordinates"])
E       TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:324: TypeError
________________________ test_disjoint_linestring_attr _________________________

    def test_disjoint_linestring_attr():
        result = parse("DISJOINT(LINESTRING(1 1,2 2), geometry)")
>       assert result == ast.GeometryDisjoint(
            values.Geometry(
                geometry.LineString([(1, 1), (2, 2)]).__geo_interface__,
            ),
            ast.Attribute("geometry"),
        )

tests/parsers/ecql/test_parser.py:296: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
/usr/lib/python3/dist-packages/pygeoif/geometry.py:419: in _from_dict
    return cls(cast(LineType, geo_interface["coordinates"]))
/usr/lib/python3/dist-packages/pygeoif/geometry.py:365: in __init__
    object.__setattr__(self, "_geoms", self._set_geoms(coordinates))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coordinates = ((1.0, 1.0, None, None), (2.0, 2.0, None, None))

    @staticmethod
    def _set_geoms(coordinates: LineType) -> Tuple[Point, ...]:
        geoms = []
        last_len = None
        for coord in dedupe(coordinates):
            if len(coord) != last_len and last_len is not None:
                msg = (  # type: ignore [unreachable]
                    "All coordinates must have the same dimension"
                )
                raise DimensionError(
                    msg,
                )
            last_len = len(coord)
>           point = Point(*coord)
E           TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:434: TypeError
__________________________ test_contains_attr_polygon __________________________

    def test_contains_attr_polygon():
        result = parse("CONTAINS(geometry, POLYGON((1 1,2 2,0 3,1 1)))")
>       assert result == ast.GeometryContains(
            ast.Attribute("geometry"),
            values.Geometry(
                geometry.Polygon([(1, 1), (2, 2), (0, 3), (1, 1)]).__geo_interface__,
            ),
        )

tests/parsers/ecql/test_parser.py:306: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
/usr/lib/python3/dist-packages/pygeoif/geometry.py:627: in _from_dict
    return cls(
/usr/lib/python3/dist-packages/pygeoif/geometry.py:543: in __init__
    exterior = LinearRing(shell)
/usr/lib/python3/dist-packages/pygeoif/geometry.py:473: in __init__
    super().__init__(coordinates)
/usr/lib/python3/dist-packages/pygeoif/geometry.py:365: in __init__
    object.__setattr__(self, "_geoms", self._set_geoms(coordinates))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coordinates = ((1.0, 1.0, None, None), (2.0, 2.0, None, None), (0.0, 3.0, None, None), (1.0, 1.0, None, None))

    @staticmethod
    def _set_geoms(coordinates: LineType) -> Tuple[Point, ...]:
        geoms = []
        last_len = None
        for coord in dedupe(coordinates):
            if len(coord) != last_len and last_len is not None:
                msg = (  # type: ignore [unreachable]
                    "All coordinates must have the same dimension"
                )
                raise DimensionError(
                    msg,
                )
            last_len = len(coord)
>           point = Point(*coord)
E           TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:434: TypeError
________________________ test_within_multipolygon_attr _________________________

    def test_within_multipolygon_attr():
        result = parse("WITHIN(MULTIPOLYGON(((1 1,2 2,0 3,1 1))), geometry)")
>       assert result == ast.GeometryWithin(
            values.Geometry(
                geometry.MultiPolygon.from_polygons(
                    geometry.Polygon([(1, 1), (2, 2), (0, 3), (1, 1)])
                ).__geo_interface__,
            ),
            ast.Attribute("geometry"),
        )

tests/parsers/ecql/test_parser.py:316: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
/usr/lib/python3/dist-packages/pygeoif/geometry.py:955: in _from_dict
    return cls(cast(Sequence[PolygonType], coords))
/usr/lib/python3/dist-packages/pygeoif/geometry.py:906: in __init__
    tuple(
/usr/lib/python3/dist-packages/pygeoif/geometry.py:907: in <genexpr>
    Polygon(
/usr/lib/python3/dist-packages/pygeoif/geometry.py:543: in __init__
    exterior = LinearRing(shell)
/usr/lib/python3/dist-packages/pygeoif/geometry.py:473: in __init__
    super().__init__(coordinates)
/usr/lib/python3/dist-packages/pygeoif/geometry.py:365: in __init__
    object.__setattr__(self, "_geoms", self._set_geoms(coordinates))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coordinates = ((1.0, 1.0, None, None), (2.0, 2.0, None, None), (0.0, 3.0, None, None), (1.0, 1.0, None, None))

    @staticmethod
    def _set_geoms(coordinates: LineType) -> Tuple[Point, ...]:
        geoms = []
        last_len = None
        for coord in dedupe(coordinates):
            if len(coord) != last_len and last_len is not None:
                msg = (  # type: ignore [unreachable]
                    "All coordinates must have the same dimension"
                )
                raise DimensionError(
                    msg,
                )
            last_len = len(coord)
>           point = Point(*coord)
E           TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:434: TypeError
______________________ test_touches_attr_multilinestring _______________________

    def test_touches_attr_multilinestring():
        result = parse("TOUCHES(geometry, MULTILINESTRING((1 1,2 2),(0 3,1 1)))")
>       assert result == ast.GeometryTouches(
            ast.Attribute("geometry"),
            values.Geometry(
                geometry.MultiLineString.from_linestrings(
                    geometry.LineString([(1, 1), (2, 2)]),
                    geometry.LineString([(0, 3), (1, 1)]),
                ).__geo_interface__,
            ),
        )

tests/parsers/ecql/test_parser.py:328: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
/usr/lib/python3/dist-packages/pygeoif/geometry.py:844: in _from_dict
    return cls(cast(Sequence[LineType], geo_interface["coordinates"]))
/usr/lib/python3/dist-packages/pygeoif/geometry.py:804: in __init__
    object.__setattr__(self, "_geoms", tuple(LineString(line) for line in lines))
/usr/lib/python3/dist-packages/pygeoif/geometry.py:804: in <genexpr>
    object.__setattr__(self, "_geoms", tuple(LineString(line) for line in lines))
/usr/lib/python3/dist-packages/pygeoif/geometry.py:365: in __init__
    object.__setattr__(self, "_geoms", self._set_geoms(coordinates))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coordinates = ((1.0, 1.0, None, None), (2.0, 2.0, None, None))

    @staticmethod
    def _set_geoms(coordinates: LineType) -> Tuple[Point, ...]:
        geoms = []
        last_len = None
        for coord in dedupe(coordinates):
            if len(coord) != last_len and last_len is not None:
                msg = (  # type: ignore [unreachable]
                    "All coordinates must have the same dimension"
                )
                raise DimensionError(
                    msg,
                )
            last_len = len(coord)
>           point = Point(*coord)
E           TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:434: TypeError
______________________ test_crosses_attr_multilinestring _______________________

    def test_crosses_attr_multilinestring():
        result = parse("CROSSES(geometry, MULTILINESTRING((1 1,2 2),(0 3,1 1)))")
>       assert result == ast.GeometryCrosses(
            ast.Attribute("geometry"),
            values.Geometry(
                geometry.MultiLineString.from_linestrings(
                    geometry.LineString([(1, 1), (2, 2)]),
                    geometry.LineString([(0, 3), (1, 1)]),
                ).__geo_interface__,
            ),
        )

tests/parsers/ecql/test_parser.py:341: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
/usr/lib/python3/dist-packages/pygeoif/geometry.py:844: in _from_dict
    return cls(cast(Sequence[LineType], geo_interface["coordinates"]))
/usr/lib/python3/dist-packages/pygeoif/geometry.py:804: in __init__
    object.__setattr__(self, "_geoms", tuple(LineString(line) for line in lines))
/usr/lib/python3/dist-packages/pygeoif/geometry.py:804: in <genexpr>
    object.__setattr__(self, "_geoms", tuple(LineString(line) for line in lines))
/usr/lib/python3/dist-packages/pygeoif/geometry.py:365: in __init__
    object.__setattr__(self, "_geoms", self._set_geoms(coordinates))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coordinates = ((1.0, 1.0, None, None), (2.0, 2.0, None, None))

    @staticmethod
    def _set_geoms(coordinates: LineType) -> Tuple[Point, ...]:
        geoms = []
        last_len = None
        for coord in dedupe(coordinates):
            if len(coord) != last_len and last_len is not None:
                msg = (  # type: ignore [unreachable]
                    "All coordinates must have the same dimension"
                )
                raise DimensionError(
                    msg,
                )
            last_len = len(coord)
>           point = Point(*coord)
E           TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:434: TypeError
______________________ test_overlaps_attr_multilinestring ______________________

    def test_overlaps_attr_multilinestring():
        result = parse("OVERLAPS(geometry, MULTILINESTRING((1 1,2 2),(0 3,1 1)))")
>       assert result == ast.GeometryOverlaps(
            ast.Attribute("geometry"),
            values.Geometry(
                geometry.MultiLineString.from_linestrings(
                    geometry.LineString([(1, 1), (2, 2)]),
                    geometry.LineString([(0, 3), (1, 1)]),
                ).__geo_interface__,
            ),
        )

tests/parsers/ecql/test_parser.py:354: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
/usr/lib/python3/dist-packages/pygeoif/geometry.py:844: in _from_dict
    return cls(cast(Sequence[LineType], geo_interface["coordinates"]))
/usr/lib/python3/dist-packages/pygeoif/geometry.py:804: in __init__
    object.__setattr__(self, "_geoms", tuple(LineString(line) for line in lines))
/usr/lib/python3/dist-packages/pygeoif/geometry.py:804: in <genexpr>
    object.__setattr__(self, "_geoms", tuple(LineString(line) for line in lines))
/usr/lib/python3/dist-packages/pygeoif/geometry.py:365: in __init__
    object.__setattr__(self, "_geoms", self._set_geoms(coordinates))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coordinates = ((1.0, 1.0, None, None), (2.0, 2.0, None, None))

    @staticmethod
    def _set_geoms(coordinates: LineType) -> Tuple[Point, ...]:
        geoms = []
        last_len = None
        for coord in dedupe(coordinates):
            if len(coord) != last_len and last_len is not None:
                msg = (  # type: ignore [unreachable]
                    "All coordinates must have the same dimension"
                )
                raise DimensionError(
                    msg,
                )
            last_len = len(coord)
>           point = Point(*coord)
E           TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:434: TypeError
_______________________ test_intersects_attr_point_ewkt ________________________

    def test_intersects_attr_point_ewkt():
        result = parse("INTERSECTS(geometry, SRID=4326;POINT(1 1))")
        assert (
            result.rhs.geometry["crs"]["properties"]["name"] == "urn:ogc:def:crs:EPSG::4326"
        )
>       assert result == ast.GeometryIntersects(
            ast.Attribute("geometry"),
            values.Geometry(geometry.Point(1, 1).__geo_interface__),
        )

tests/parsers/ecql/test_parser.py:370: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'pygeoif.geometry.Point'>
geo_interface = {'coordinates': (1.0, 1.0, None, None), 'crs': {'properties': {'name': 'urn:ogc:def:crs:EPSG::4326'}, 'type': 'name'}, 'type': 'Point'}

    @classmethod
    def _from_dict(cls, geo_interface: GeoInterface) -> "Point":
        cls._check_dict(geo_interface)
>       return cls(*geo_interface["coordinates"])
E       TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:324: TypeError
----------------------------- Captured stdout call -----------------------------
4326 {'type': 'Point', 'coordinates': (1.0, 1.0, None, None)}
___________________ test_intersects_attr_geometrycollection ____________________

    def test_intersects_attr_geometrycollection():
        result = parse(
            "INTERSECTS(geometry, GEOMETRYCOLLECTION(POINT(1 1),"
            "LINESTRING(1 1,2 2),"
            "POLYGON((1 1,2 2,0 3,1 1))"
            "))"
        )
>       assert result == ast.GeometryIntersects(
            ast.Attribute("geometry"),
            values.Geometry(
                geometry.GeometryCollection(
                    [
                        geometry.Point(1, 1),
                        geometry.LineString([(1, 1), (2, 2)]),
                        geometry.Polygon([(1, 1), (2, 2), (0, 3), (1, 1)]),
                    ]
                ).__geo_interface__
            ),
        )

tests/parsers/ecql/test_parser.py:383: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:160: in shape
    shape(fi) for fi in geometry["geometries"]  # type: ignore [typeddict-item]
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'pygeoif.geometry.Point'>
geo_interface = {'coordinates': (1.0, 1.0, None, None), 'type': 'Point'}

    @classmethod
    def _from_dict(cls, geo_interface: GeoInterface) -> "Point":
        cls._check_dict(geo_interface)
>       return cls(*geo_interface["coordinates"])
E       TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:324: TypeError
___________________________ test_relate_attr_polygon ___________________________

    def test_relate_attr_polygon():
        result = parse("RELATE(geometry, POLYGON((1 1,2 2,0 3,1 1)), '1*T***T**')")
>       assert result == ast.Relate(
            ast.Attribute("geometry"),
            values.Geometry(
                geometry.Polygon([(1, 1), (2, 2), (0, 3), (1, 1)]).__geo_interface__,
            ),
            pattern="1*T***T**",
        )

tests/parsers/ecql/test_parser.py:402: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
/usr/lib/python3/dist-packages/pygeoif/geometry.py:627: in _from_dict
    return cls(
/usr/lib/python3/dist-packages/pygeoif/geometry.py:543: in __init__
    exterior = LinearRing(shell)
/usr/lib/python3/dist-packages/pygeoif/geometry.py:473: in __init__
    super().__init__(coordinates)
/usr/lib/python3/dist-packages/pygeoif/geometry.py:365: in __init__
    object.__setattr__(self, "_geoms", self._set_geoms(coordinates))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coordinates = ((1.0, 1.0, None, None), (2.0, 2.0, None, None), (0.0, 3.0, None, None), (1.0, 1.0, None, None))

    @staticmethod
    def _set_geoms(coordinates: LineType) -> Tuple[Point, ...]:
        geoms = []
        last_len = None
        for coord in dedupe(coordinates):
            if len(coord) != last_len and last_len is not None:
                msg = (  # type: ignore [unreachable]
                    "All coordinates must have the same dimension"
                )
                raise DimensionError(
                    msg,
                )
            last_len = len(coord)
>           point = Point(*coord)
E           TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:434: TypeError
__________________________ test_dwithin_attr_polygon ___________________________

    def test_dwithin_attr_polygon():
        result = parse("DWITHIN(geometry, POLYGON((1 1,2 2,0 3,1 1)), 5, feet)")
>       assert result == ast.DistanceWithin(
            ast.Attribute("geometry"),
            values.Geometry(
                geometry.Polygon([(1, 1), (2, 2), (0, 3), (1, 1)]).__geo_interface__,
            ),
            distance=5,
            units="feet",
        )

tests/parsers/ecql/test_parser.py:416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
/usr/lib/python3/dist-packages/pygeoif/geometry.py:627: in _from_dict
    return cls(
/usr/lib/python3/dist-packages/pygeoif/geometry.py:543: in __init__
    exterior = LinearRing(shell)
/usr/lib/python3/dist-packages/pygeoif/geometry.py:473: in __init__
    super().__init__(coordinates)
/usr/lib/python3/dist-packages/pygeoif/geometry.py:365: in __init__
    object.__setattr__(self, "_geoms", self._set_geoms(coordinates))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coordinates = ((1.0, 1.0, None, None), (2.0, 2.0, None, None), (0.0, 3.0, None, None), (1.0, 1.0, None, None))

    @staticmethod
    def _set_geoms(coordinates: LineType) -> Tuple[Point, ...]:
        geoms = []
        last_len = None
        for coord in dedupe(coordinates):
            if len(coord) != last_len and last_len is not None:
                msg = (  # type: ignore [unreachable]
                    "All coordinates must have the same dimension"
                )
                raise DimensionError(
                    msg,
                )
            last_len = len(coord)
>           point = Point(*coord)
E           TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:434: TypeError
___________________________ test_beyond_attr_polygon ___________________________

    def test_beyond_attr_polygon():
        result = parse("BEYOND(geometry, POLYGON((1 1,2 2,0 3,1 1)), 5, nautical miles)")
>       assert result == ast.DistanceBeyond(
            ast.Attribute("geometry"),
            values.Geometry(
                geometry.Polygon([(1, 1), (2, 2), (0, 3), (1, 1)]).__geo_interface__,
            ),
            distance=5,
            units="nautical miles",
        )

tests/parsers/ecql/test_parser.py:428: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:4: in __eq__
    ???
pygeofilter/values.py:45: in __eq__
    return shape(self).__geo_interface__ == shape(o).__geo_interface__
/usr/lib/python3/dist-packages/pygeoif/factories.py:155: in shape
    return constructor._from_dict(  # type: ignore [attr-defined, no-any-return]
/usr/lib/python3/dist-packages/pygeoif/geometry.py:627: in _from_dict
    return cls(
/usr/lib/python3/dist-packages/pygeoif/geometry.py:543: in __init__
    exterior = LinearRing(shell)
/usr/lib/python3/dist-packages/pygeoif/geometry.py:473: in __init__
    super().__init__(coordinates)
/usr/lib/python3/dist-packages/pygeoif/geometry.py:365: in __init__
    object.__setattr__(self, "_geoms", self._set_geoms(coordinates))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coordinates = ((1.0, 1.0, None, None), (2.0, 2.0, None, None), (0.0, 3.0, None, None), (1.0, 1.0, None, None))

    @staticmethod
    def _set_geoms(coordinates: LineType) -> Tuple[Point, ...]:
        geoms = []
        last_len = None
        for coord in dedupe(coordinates):
            if len(coord) != last_len and last_len is not None:
                msg = (  # type: ignore [unreachable]
                    "All coordinates must have the same dimension"
                )
                raise DimensionError(
                    msg,
                )
            last_len = len(coord)
>           point = Point(*coord)
E           TypeError: Point.__init__() takes from 3 to 4 positional arguments but 5 were given

/usr/lib/python3/dist-packages/pygeoif/geometry.py:434: TypeError
_____________________________ test_function_no_arg _____________________________

    def test_function_no_arg():
        result = parse("attr = myfunc()")
>       assert result == ast.Equal(
            ast.Attribute("attr"),
            ast.Function("myfunc", []),
        )
E       AssertionError: assert Equal(lhs=ATT...ments=[None])) == Equal(lhs=ATT...arguments=[]))
E         
E         Omitting 1 identical items, use -vv to show
E         Differing attributes:
E         ['rhs']
E         
E         Drill down into differing attribute rhs:
E           rhs: Function(name='myfunc', arguments=[None]) != Function(name='myfunc', arguments=[])...
E         
E         ...Full output truncated (14 lines hidden), use '-vv' to show

tests/parsers/ecql/test_parser.py:567: AssertionError
_________________________________ test_spatial _________________________________

data =                str_attr maybe_str_attr  ...  datetime_attr               point_attr
0        this is a test           ...0000 1.00000)
1  this is another test       not null  ...     2010-01-10  POINT (2.00000 2.00000)

[2 rows x 7 columns]

    def test_spatial(data):
        result = filter_(
            parse("INTERSECTS(point_attr, ENVELOPE (0 1 0 1))"),
            data,
        )
        assert len(result) == 1 and result.index[0] == 0
    
>       result = filter_(
            parse("EQUALS(point_attr, POINT(2 2))"),
            data,
        )

tests/test_geopandas/test_evaluate.py:137: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_geopandas/test_evaluate.py:32: in filter_
    return data[to_filter(data, ast, {}, function_map)]
pygeofilter/backends/geopandas/evaluate.py:143: in to_filter
    return GeoPandasEvaluator(df, field_mapping, function_map).evaluate(root)
pygeofilter/backends/evaluator.py:103: in evaluate
    sub_args = [self.evaluate(sub_node, False) for sub_node in subnodes]
pygeofilter/backends/evaluator.py:109: in evaluate
    result = handler(self, node, *sub_args)
pygeofilter/backends/geopandas/evaluate.py:134: in geometry
    return geometry.shape(node)
/usr/lib/python3/dist-packages/shapely/geometry/geo.py:95: in shape
    return Point(ob["coordinates"])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <class 'shapely.geometry.point.Point'>, args = ((2.0, 2.0, None, None),)
coords = array([2.0, 2.0, None, None], dtype=object)

    def __new__(self, *args):
        if len(args) == 0:
            # empty geometry
            # TODO better constructor
            return shapely.from_wkt("POINT EMPTY")
        elif len(args) > 3:
            raise TypeError(f"Point() takes at most 3 arguments ({len(args)} given)")
        elif len(args) == 1:
            coords = args[0]
            if isinstance(coords, Point):
                return coords
    
            # Accept either (x, y) or [(x, y)]
            if not hasattr(coords, "__getitem__"):  # generators
                coords = list(coords)
            coords = np.asarray(coords).squeeze()
        else:
            # 2 or 3 args
            coords = np.array(args).squeeze()
    
        if coords.ndim > 1:
            raise ValueError(
                f"Point() takes only scalar or 1-size vector arguments, got {args}"
            )
        if not np.issubdtype(coords.dtype, np.number):
>           coords = [float(c) for c in coords]
E           TypeError: float() argument must be a string or a real number, not 'NoneType'

/usr/lib/python3/dist-packages/shapely/geometry/point.py:77: TypeError
_________________________________ test_spatial _________________________________

data = <osgeo.ogr.DataSource; proxy of <Swig Object of type 'OGRDataSourceShadow *' at 0x719c8e7b6280> >

    def test_spatial(data):
        result = filter_(
            parse("INTERSECTS(point_attr, ENVELOPE (0 1 0 1))"),
            data,
        )
        assert result.GetFeatureCount() == 1 and result.GetFeature(0).GetField(0) == 0
    
>       result = filter_(
            parse("EQUALS(point_attr, POINT(2 2))"),
            data,
        )

tests/test_sql/test_evaluate.py:216: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_sql/test_evaluate.py:101: in filter_
    where = to_sql_where(ast, FIELD_MAPPING, FUNCTION_MAP)
pygeofilter/backends/sql/evaluate.py:162: in to_sql_where
    return SQLEvaluator(field_mapping, function_map or {}).evaluate(root)
pygeofilter/backends/evaluator.py:103: in evaluate
    sub_args = [self.evaluate(sub_node, False) for sub_node in subnodes]
pygeofilter/backends/evaluator.py:109: in evaluate
    result = handler(self, node, *sub_args)
pygeofilter/backends/sql/evaluate.py:148: in geometry
    wkb_hex = shapely.geometry.shape(node).wkb_hex
/usr/lib/python3/dist-packages/shapely/geometry/geo.py:95: in shape
    return Point(ob["coordinates"])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <class 'shapely.geometry.point.Point'>, args = ((2.0, 2.0, None, None),)
coords = array([2.0, 2.0, None, None], dtype=object)

    def __new__(self, *args):
        if len(args) == 0:
            # empty geometry
            # TODO better constructor
            return shapely.from_wkt("POINT EMPTY")
        elif len(args) > 3:
            raise TypeError(f"Point() takes at most 3 arguments ({len(args)} given)")
        elif len(args) == 1:
            coords = args[0]
            if isinstance(coords, Point):
                return coords
    
            # Accept either (x, y) or [(x, y)]
            if not hasattr(coords, "__getitem__"):  # generators
                coords = list(coords)
            coords = np.asarray(coords).squeeze()
        else:
            # 2 or 3 args
            coords = np.array(args).squeeze()
    
        if coords.ndim > 1:
            raise ValueError(
                f"Point() takes only scalar or 1-size vector arguments, got {args}"
            )
        if not np.issubdtype(coords.dtype, np.number):
>           coords = [float(c) for c in coords]
E           TypeError: float() argument must be a string or a real number, not 'NoneType'

/usr/lib/python3/dist-packages/shapely/geometry/point.py:77: TypeError
=============================== warnings summary ===============================
../../../../../../../usr/lib/python3/dist-packages/django/conf/__init__.py:336
  /usr/lib/python3/dist-packages/django/conf/__init__.py:336: RemovedInDjango50Warning: The USE_L10N setting is deprecated. Starting with Django 5.0, localized formatting of data will always be enabled. For example Django will display numbers and dates using the format of the current locale.
    warnings.warn(USE_L10N_DEPRECATED_MSG, RemovedInDjango50Warning)

tests/backends/sqlalchemy/test_evaluate.py:23
  /home/antonio/debian/itp/pygeofilter/deb-src-01/pygeofilter/tests/backends/sqlalchemy/test_evaluate.py:23: MovedIn20Warning: The ``declarative_base()`` function is now available as sqlalchemy.orm.declarative_base(). (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
    Base = declarative_base()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_point
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_point_inv
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_mulitipoint_1
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_mulitipoint_1_inv
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_mulitipoint_2
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_mulitipoint_2_inv
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_linestring
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_linestring__inv
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_multilinestring
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_multilinestring_inv
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_polygon
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_polygon_inv
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_multipolygon
FAILED tests/backends/django/test_django_evaluate.py::test_intersects_multipolygon_inv
FAILED tests/backends/django/test_django_evaluate.py::test_dwithin - django.c...
FAILED tests/backends/django/test_django_evaluate.py::test_dwithin_inv - djan...
FAILED tests/backends/django/test_django_evaluate.py::test_beyond - django.co...
FAILED tests/backends/django/test_django_evaluate.py::test_beyond_inv - djang...
FAILED tests/backends/sqlalchemy/test_evaluate.py::test_intersects_point - Ty...
FAILED tests/backends/sqlalchemy/test_evaluate.py::test_intersects_mulitipoint_1
FAILED tests/backends/sqlalchemy/test_evaluate.py::test_intersects_mulitipoint_2
FAILED tests/backends/sqlalchemy/test_evaluate.py::test_intersects_linestring
FAILED tests/backends/sqlalchemy/test_evaluate.py::test_intersects_multilinestring
FAILED tests/backends/sqlalchemy/test_evaluate.py::test_intersects_polygon - ...
FAILED tests/backends/sqlalchemy/test_evaluate.py::test_intersects_multipolygon
FAILED tests/native/test_evaluate.py::test_spatial - TypeError: float() argum...
FAILED tests/native/test_evaluate.py::test_spatial_json - TypeError: float() ...
FAILED tests/parsers/cql2_json/test_cql2_spec_fixtures.py::test_fixtures - Ty...
FAILED tests/parsers/ecql/test_parser.py::test_intersects_attr_point - TypeEr...
FAILED tests/parsers/ecql/test_parser.py::test_disjoint_linestring_attr - Typ...
FAILED tests/parsers/ecql/test_parser.py::test_contains_attr_polygon - TypeEr...
FAILED tests/parsers/ecql/test_parser.py::test_within_multipolygon_attr - Typ...
FAILED tests/parsers/ecql/test_parser.py::test_touches_attr_multilinestring
FAILED tests/parsers/ecql/test_parser.py::test_crosses_attr_multilinestring
FAILED tests/parsers/ecql/test_parser.py::test_overlaps_attr_multilinestring
FAILED tests/parsers/ecql/test_parser.py::test_intersects_attr_point_ewkt - T...
FAILED tests/parsers/ecql/test_parser.py::test_intersects_attr_geometrycollection
FAILED tests/parsers/ecql/test_parser.py::test_relate_attr_polygon - TypeErro...
FAILED tests/parsers/ecql/test_parser.py::test_dwithin_attr_polygon - TypeErr...
FAILED tests/parsers/ecql/test_parser.py::test_beyond_attr_polygon - TypeErro...
FAILED tests/parsers/ecql/test_parser.py::test_function_no_arg - AssertionErr...
FAILED tests/test_geopandas/test_evaluate.py::test_spatial - TypeError: float...
FAILED tests/test_sql/test_evaluate.py::test_spatial - TypeError: float() arg...
================== 43 failed, 347 passed, 2 warnings in 7.91s ==================

Python: 3.12.4
dateparser: 1.2.0
lark: 1.1.9
pygeoif: 1.4.0

Could you please provide some guidance to solve the issue.

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

1 participant