Skip to content

Commit 1f3c282

Browse files
jckrassguequierre
andauthored
RSDK-9339: Update python doc strings for tabular_data_by_sql/mql (#792)
Co-authored-by: Sierra Guequierre <[email protected]>
1 parent 2a87532 commit 1f3c282

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/viam/app/data_client.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ async def tabular_data_by_sql(self, organization_id: str, sql_query: str) -> Lis
259259
sql_query (str): The SQL query to run.
260260
261261
Returns:
262-
List[Dict[str, ValueTypes]]: An array of data objects.
262+
List[Dict[str, Union[ValueTypes, datetime]]]: An array of decoded BSON data objects.
263263
264264
For more information, see `Data Client API <https://docs.viam.com/appendix/apis/data-client/>`_.
265265
"""
@@ -274,31 +274,23 @@ async def tabular_data_by_mql(self, organization_id: str, mql_binary: List[bytes
274274
275275
import bson
276276
277-
# using bson package (pip install bson)
278-
tabular_data = await data_client.tabular_data_by_mql(organization_id="<YOUR-ORG-ID>", mql_binary=[
279-
bson.dumps({ '$match': { 'location_id': '<YOUR-LOCATION-ID>' } }),
280-
bson.dumps({ '$limit': 5 })
281-
])
282-
283-
print(f"Tabular Data 1: {tabular_data}")
284-
285277
# using pymongo package (pip install pymongo)
286278
tabular_data = await data_client.tabular_data_by_mql(organization_id="<YOUR-ORG-ID>", mql_binary=[
287279
bson.encode({ '$match': { 'location_id': '<YOUR-LOCATION-ID>' } }),
288280
bson.encode({ "$limit": 5 })
289281
])
290282
291-
print(f"Tabular Data 2: {tabular_data}")
283+
print(f"Tabular Data: {tabular_data}")
292284
293285
294286
Args:
295287
organization_id (str): The ID of the organization that owns the data.
296288
You can obtain your organization ID from the Viam app's organization settings page.
297289
mql_binary (List[bytes]): The MQL query to run as a list of BSON queries. You can encode your bson queries using a library like
298-
`pymongo` or `bson`.
290+
`pymongo`.
299291
300292
Returns:
301-
List[Dict[str, ValueTypes]]: An array of data objects.
293+
List[Dict[str, Union[ValueTypes, datetime]]]: An array of decoded BSON data objects.
302294
303295
For more information, see `Data Client API <https://docs.viam.com/appendix/apis/data-client/>`_.
304296
"""

0 commit comments

Comments
 (0)