Skip to content

GeoPandas: GeoSeries.skew rejects integer use_radians values #3172

Description

@jiayuasu

Expected behavior

sedona.spark.geopandas.GeoSeries.skew should accept integer boolean-like values for use_radians, matching GeoPandas 1.1.3 and the existing GeoSeries.orient_polygons flag behavior.

For example, use_radians=1 and use_radians=np.int64(1) should be treated as true.

Actual behavior

Sedona rejects both values:

TypeError: 'use_radians' must be a boolean

The implementation accepts only bool and np.bool_, while GeoPandas evaluates this flag by truthiness.

Steps to reproduce the problem

import geopandas as gpd
import numpy as np
from shapely.geometry import Polygon
from sedona.spark.geopandas import GeoSeries

polygon = Polygon([(0, 0), (0, 1), (1, 0), (0, 0)])

# Both calls succeed.
gpd.GeoSeries([polygon]).skew(xs=0.1, use_radians=1)
gpd.GeoSeries([polygon]).skew(xs=0.1, use_radians=np.int64(1))

# Both calls raise TypeError.
GeoSeries([polygon]).skew(xs=0.1, use_radians=1)
GeoSeries([polygon]).skew(xs=0.1, use_radians=np.int64(1))

Settings

Sedona version = 1.9.1-SNAPSHOT

Apache Spark version = 3.4

Apache Flink version = N/A

API type = Python

Scala version = 2.12

JRE version = 17

Python version = 3.12

Environment = Standalone

GeoPandas version = 1.1.3

Shapely version = 2.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions