diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b96543933..3949b4c3d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: # Explicitly specify the pyproject.toml at the repo root, not per-project. args: ["--config", "pyproject.toml"] - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + rev: 7.1.1 hooks: - id: flake8 args: ["--config=.flake8"] diff --git a/python/cuspatial/cuspatial/tests/test_geodataframe.py b/python/cuspatial/cuspatial/tests/test_geodataframe.py index dee2bfeb4..010061ac8 100644 --- a/python/cuspatial/cuspatial/tests/test_geodataframe.py +++ b/python/cuspatial/cuspatial/tests/test_geodataframe.py @@ -66,7 +66,7 @@ def generator(size, has_z=False): def assert_eq_point(p1, p2): - assert type(p1) == type(p2) + assert type(p1) is type(p2) assert p1.x == p2.x assert p1.y == p2.y assert p1.has_z == p2.has_z @@ -76,7 +76,7 @@ def assert_eq_point(p1, p2): def assert_eq_multipoint(p1, p2): - assert type(p1) == type(p2) + assert type(p1) is type(p2) assert len(p1) == len(p2) for i in range(len(p1)): assert_eq_point(p1[i], p2[i]) @@ -93,8 +93,8 @@ def assert_eq_multipolygon(p1, p2): def assert_eq_geo_df(geo1, geo2): - if type(geo1) != type(geo2): - assert TypeError + if type(geo1) is not type(geo2): + raise TypeError assert geo1.columns.equals(geo2.columns) for col in geo1.columns: if geo1[col].dtype == "geometry": @@ -112,7 +112,7 @@ def test_select_multiple_columns(gpdf): def test_type_persistence(gpdf): cugpdf = cuspatial.from_geopandas(gpdf) - assert type(cugpdf["geometry"]) == cuspatial.GeoSeries + assert type(cugpdf["geometry"]) is cuspatial.GeoSeries def test_interleaved_point(gpdf, polys): diff --git a/python/cuspatial/cuspatial/tests/test_geoseries.py b/python/cuspatial/cuspatial/tests/test_geoseries.py index 35007c57d..56f61158e 100644 --- a/python/cuspatial/cuspatial/tests/test_geoseries.py +++ b/python/cuspatial/cuspatial/tests/test_geoseries.py @@ -87,7 +87,7 @@ def generator(size: Integral, obj_type: Example_Feature_Enum = None): def assert_eq_point(p1, p2): - assert type(p1) == type(p2) + assert type(p1) is type(p2) assert p1.x == p2.x assert p1.y == p2.y assert p1.has_z == p2.has_z @@ -97,14 +97,14 @@ def assert_eq_point(p1, p2): def assert_eq_multipoint(p1, p2): - assert type(p1) == type(p2) + assert type(p1) is type(p2) assert len(p1) == len(p2) for i in range(len(p1)): assert_eq_point(p1[i], p2[i]) def assert_eq_linestring(p1, p2): - assert type(p1) == type(p2) + assert type(p1) is type(p2) assert p1 == p2 @@ -124,8 +124,8 @@ def assert_eq_multipolygon(p1, p2): def assert_eq_geo(geo1, geo2): - if type(geo1) != type(geo2): - assert TypeError + if type(geo1) is not type(geo2): + raise TypeError result = geo1.equals(geo2) if isinstance(result, bool): assert result