code: def _convert_linearring_to_linestring(gdf, geom_name):
      from shapely.geometry import LineString
  
      # Todo: Use shapely function once it's implemented:
      # https://github.com/shapely/shapely/issues/1617
  
      mask = gdf.geom_type == "LinearRing"
      gdf.loc[mask, geom_name] = gdf.loc[mask, geom_name].apply(
          lambda geom: LineString(geom)
      )
      return gdf
  
file_path: geopandas/geopandas/io/sql.py
imports: import warnings
  from contextlib import contextmanager
  import pandas
  import shapely
  import shapely.wkb
  from geopandas import GeoDataFrame
label_desc: Use image node_id 7 for calling a global function with example usage: _convert_linearring_to_linestring(gdf, geom_name) and returns: gdf