You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/25 23:01:27 UTC
[GitHub] [airflow] deprosun commented on pull request #2005: [AIRFLOW-778] Fix completey broken MetastorePartitionSensor
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org