From 4c1e1ca8e40db2e991ab39327bfe1b212331d90c Mon Sep 17 00:00:00 2001 From: 7yl4r <7yl4r@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:14:26 +0000 Subject: [PATCH] deploy: ebaf0c2120900be3eab14b244613dbf71d679062 --- .buildinfo | 2 +- _modules/index.html | 4 +-- _modules/pyobis/checklist/checklist.html | 4 +-- _modules/pyobis/dataset/dataset.html | 4 +-- _modules/pyobis/nodes/nodes.html | 4 +-- _modules/pyobis/occurrences/occurrences.html | 34 ++++++++++++++----- _modules/pyobis/taxa/taxa.html | 4 +-- _static/documentation_options.js | 2 +- changelog_link.html | 4 +-- checklist.html | 4 +-- dataset.html | 4 +-- genindex.html | 4 +-- index.html | 4 +-- nodes.html | 4 +-- objects.inv | Bin 653 -> 653 bytes occurrences.html | 6 ++-- py-modindex.html | 4 +-- search.html | 4 +-- searchindex.js | 2 +- taxa.html | 4 +-- 20 files changed, 60 insertions(+), 42 deletions(-) diff --git a/.buildinfo b/.buildinfo index 9050f66..3605c90 100644 --- a/.buildinfo +++ b/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file records the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 55c4b05eb3d65a4d66700f88c4b57e3f +config: dd9bf10d46465096c9b32fd9d68a4411 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/_modules/index.html b/_modules/index.html index 7c135af..908497b 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -5,14 +5,14 @@
-) outdf = pd.concat( [ - outdf.infer_objects(), + outdf if len(outdf) else None, pd.DataFrame(res["results"]).infer_objects(), ], ignore_index=True, @@ -236,7 +236,10 @@
**kwargs, ) outdf = pd.concat( - [outdf.infer_objects(), pd.DataFrame(res["results"]).infer_objects()], + [ + outdf if len(outdf) else None, + pd.DataFrame(res["results"]).infer_objects(), + ], ignore_index=True, ) logger.info(f"Fetched {size} records.") @@ -253,9 +256,16 @@
on="id", how="inner", ) - self.data = merged - return self.data - self.data = outdf + self.data = {"total": len(merged), "results": merged} + # set the data as [total, results] K-V pair + # but still return the DataFrame since changing this + # will impact existing usage, and be a breaking change + return self.data["results"] + self.data = {"total": len(outdf), "results": outdf} + + # again for not MeasurementOrFacts results, (simple search queries) + # should also return the DataFrame directly for backward compatibility + return self.data["results"] return self.data @@ -263,6 +273,14 @@
""" Convert the results into a pandas DataFrame """ + # if the data format of the query executed cannot be converted to a + # pandas.DataFrame which is true for other formats like .mvt or kml (not geojson) + # then we should be raising a not implemented rather relying around exceptions + # from pandas while converting + if self.__isKML: + raise NotImplementedError( + "to_pandas method is not yet available for these query types.", + ) return pd.DataFrame(self.data["results"])