Skip to content

Commit

Permalink
Fix read_parquet bug
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Oct 31, 2024
1 parent 4fb9754 commit f33cb1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion leafmap/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -12353,6 +12353,7 @@ def read_parquet(
raise ValueError("exclude_columns must be a list or a string.")
columns = f"{columns} EXCLUDE {exclude}"

result = None
if return_type in ["df", "numpy", "arrow", "polars"]:
if sql is None:
sql = f"SELECT {columns} FROM '{source}'"
Expand All @@ -12378,7 +12379,7 @@ def read_parquet(
# if src_crs is not None and dst_crs is not None:
# geom_sql = f"ST_AsText(ST_Transform(ST_GeomFromWKB({geometry}), '{src_crs}', '{dst_crs}', true)) AS {geometry}"
# else:
geom_sql = f"ST_AsText(ST_GeomFromWKB({geometry})) AS {geometry}"
geom_sql = f"ST_AsText(ST_GeomFromWKB(ST_AsWKB({geometry}))) AS {geometry}"
sql = f"SELECT {columns} EXCLUDE {geometry}, {geom_sql} FROM '{source}'"
if limit is not None:
sql += f" LIMIT {limit}"
Expand Down

0 comments on commit f33cb1a

Please sign in to comment.