[ 
https://issues.apache.org/jira/browse/AIRFLOW-778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17527795#comment-17527795
 ] 

ASF GitHub Bot commented on AIRFLOW-778:
----------------------------------------

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,
   )
   ```




> Metastore Partition Sensor Broken
> ---------------------------------
>
>                 Key: AIRFLOW-778
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-778
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: operators
>            Reporter: Dan Davydov
>            Assignee: Dan Davydov
>            Priority: Blocker
>
> MetastorePartitionSensor always throws an exception on initialization due to 
> 72cc8b3006576153aa30d27643807b4ae5dfb593 .
> Looks like the tests for this are only run if an explicit flag is set which 
> is how this got past CI.
> cc [~xuanji]



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to