Skip to content

Rethinkdbquery

flowtask.components.RethinkDBQuery

RethinkDBQuery

RethinkDBQuery(loop=None, job=None, stat=None, **kwargs)

Bases: RethinkDBSupport, TemplateSupport, FlowComponent, PandasDataframe

RethinkDBQuery.

Class to execute queries against a RethinkDB database and retrieve results. using asyncDB as backend.

RethinkDB Query can support queries by mapping RethinkDB methods as attributes. Methods as "table", "filter", "order_by", "limit", "pluck" are supported.

Example:

```yaml
RethinkDBQuery:
  table: stores_reviews
  schema: epson
  filter:
  - rating:
      gt: 4
  - rating:
      lt: 6
  order_by:
  - rating: desc
  limit: 50
  columns:
  - store_id
  - store_name
  - formatted_address
  - latitude
  - longitude
  - reviews
  - rating
  - user_ratings_total
  as_dataframe: true
```

close async

close()

Close the connection to the RethinkDB database.

run async

run()

Execute the RethinkDB query and retrieve the results.