Module Contents

class airflow.contrib.sensors.cassandra_record_sensor.CassandraRecordSensor(table, keys, cassandra_conn_id, *args, **kwargs)[source]

Bases: airflow.sensors.base_sensor_operator.BaseSensorOperator

Checks for the existence of a record in a Cassandra cluster.

For example, if you want to wait for a record that has values ‘v1’ and ‘v2’ for each primary keys ‘p1’ and ‘p2’ to be populated in keyspace ‘k’ and table ‘t’, instantiate it as follows:

>>> cassandra_sensor = CassandraRecordSensor(table="k.t",
...                                          keys={"p1": "v1", "p2": "v2"},
...                                          cassandra_conn_id="cassandra_default",
...                                          task_id="cassandra_sensor")
template_fields = ['table', 'keys'][source]
poke(self, context)[source]

Was this entry helpful?