Unable to read parquet file with arcgis per docs?

552
1
05-10-2023 11:34 AM
Labels (1)
CarlSunderman
Occasional Contributor

I understand that I can read the parquet file in pandas, but why does the documentation claim you can read into a spatial dataframe when you cannot?

 

The docs claim, new in version 1.9 and I'm using arcgis version 2.0.1

 
This is from the docs:
static from_parquet(path, columns=None, **kwargs)

Load a Parquet object from the file path, returning a Spatially Enabled DataFrame.

Returns

Spatially Enabled DataFrame

>>> df = pd.DataFrame.spatial.read_parquet("data.parquet")  

https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html?

but every time I try to read a parquet file, i get the same error

AttributeError: type object 'GeoAccessor' has no attribute 'read_parquet'
---------------------------------------------------------------------------

 

Why not remove it from the docs if you cannot read a parquet file?

I

Tags (2)
0 Kudos
1 Reply
EarlMedina
Esri Regular Contributor

Hi @CarlSunderman ,

I read the from_parquet documentation and I believe it may need to be updated. It states:

if no geometry columns are read, this will raise a ValueError - you should use the pandas read_parquet method instead.

My reading of this is you should use the standard pandas.read_parquet method, completely separate from GeoAccessor. This makes sense because if you have no geometry column(s) in your data, then you are working with non-spatial data.

Of course, later on the User is told to do this:

df = pd.DataFrame.spatial.read_parquet("data.parquet")  

This seems to contradict the previous statement. If you have spatial data, then you should be using pd.DataFrame.spatial.from_parquet.

 

So, to read non-spatial parquet data use:

pd.read_parquet(your_parquet_file_path)

 

Hope this helps clear up some confusion. I think submitting feedback on the documentation is in order.

0 Kudos