Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add batch_schema.to_json method #155

Open
maxrjones opened this issue Jan 13, 2023 · 0 comments · May be fixed by #159
Open

Add batch_schema.to_json method #155

maxrjones opened this issue Jan 13, 2023 · 0 comments · May be fixed by #159
Labels

Comments

@maxrjones
Copy link
Member

Is your feature request related to a problem?

It would be useful to be able to serialize the data in BatchSchema.selectors through a BatchSchema.to_json() and BatchSchema.to_file() method.

Describe the solution you'd like

The to_json() method would return a json representation of the selectors object (analogous to https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.to_json.html. In the BatchSchema class, there would be a new to_json() method that would format the selectors object into a JSON representation. The main thing thing to be aware of is that the slices will need to be converted to a list.

The new BatchSchema.to_file() method would write this representation to a json file (analogous to https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.to_file.html).

Describe alternatives you've considered

No response

Additional context

The type of BatchSchema.selectors is as follows:

Selectors = Dict[int, List[Dict[Hashable, slice]]]
@rcjackson rcjackson linked a pull request Jan 13, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant