deprosun commented on PR #2005:
URL: https://github.com/apache/airflow/pull/2005#issuecomment-1109120353
I got this error when I tried to use the `MetastorePartitionSensor`
```
File
"/home/airflow/.local/lib/python3.9/site-packages/airflow/sensors/sql.py", line
72, in _get_hook
conn = BaseHook.get_connection(self.conn_id)
File
"/home/airflow/.local/lib/python3.9/site-packages/airflow/hooks/base.py", line
68, in get_connection
conn = Connection.get_connection_from_secrets(conn_id)
File
"/home/airflow/.local/lib/python3.9/site-packages/airflow/models/connection.py",
line 410, in get_connection_from_secrets
raise AirflowNotFoundException(f"The conn_id `{conn_id}` isn't defined")
airflow.exceptions.AirflowNotFoundException: The conn_id `` isn't defined
```
What is the right way of using this Sensor? I am not sure why I am getting
the above exception. This is how I am using it
```python
MetastorePartitionSensor(
dag=dag,
task_id="t",
schema="some_schema",
table="some_table",
partition_name=(
"visit_date='some_date'"
),
mysql_conn_id="hive_prod_conn",
soft_fail=True,
mode="reschedule",
poke_interval=60,
timeout=300,
)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]