You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "rohan472000 (via GitHub)" <gi...@apache.org> on 2023/04/19 17:09:19 UTC
[GitHub] [airflow] rohan472000 opened a new pull request, #30749: Create example_taskflow_sensor.py
rohan472000 opened a new pull request, #30749:
URL: https://github.com/apache/airflow/pull/30749
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
--
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
[GitHub] [airflow] rohan472000 commented on pull request #30749: Updated python.rst and Created example_taskflow_sensor.py
Posted by "rohan472000 (via GitHub)" <gi...@apache.org>.
rohan472000 commented on PR #30749:
URL: https://github.com/apache/airflow/pull/30749#issuecomment-1517377964
@potiuk @ankit-gautam23 please check static checks failure, and suggest any rectification as I'm not getting how to resolve that.
--
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
[GitHub] [airflow] github-actions[bot] commented on pull request #30749: Updated python.rst and Created example_taskflow_sensor.py
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #30749:
URL: https://github.com/apache/airflow/pull/30749#issuecomment-1577715652
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.
--
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
[GitHub] [airflow] rohan472000 commented on a diff in pull request #30749: Updated python.rst and Created example_taskflow_sensor.py
Posted by "rohan472000 (via GitHub)" <gi...@apache.org>.
rohan472000 commented on code in PR #30749:
URL: https://github.com/apache/airflow/pull/30749#discussion_r1173913010
##########
airflow/example_dags/example_taskflow_sensor.py:
##########
@@ -0,0 +1,51 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import os
+
+from airflow import DAG
+from airflow.sensors.python import PythonSensor
+
+default_args = {"depends_on_past": False, "email_on_failure": False, "email_on_retry": False, "retries": 1}
+
+
+def my_taskflow_sensor():
+ # Check if the file exists OR you can give any logic
+ if os.path.exists("/././path_to_file"):
+ return True
+ else:
+ return False
+
+
+with DAG(
+ "example_dag",
+ default_args=default_args,
+ description="Example DAG with PythonSensor",
+ schedule_interval=None,
+ catchup=False,
+) as dag:
+ # [START example_taskflow_sensor]
+ t1 = PythonSensor(
Review Comment:
so what rectification you would suggest??
--
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
[GitHub] [airflow] ankit-gautam23 commented on pull request #30749: Updated python.rst and Created example_taskflow_sensor.py
Posted by "ankit-gautam23 (via GitHub)" <gi...@apache.org>.
ankit-gautam23 commented on PR #30749:
URL: https://github.com/apache/airflow/pull/30749#issuecomment-1517420887
Mark us as reviewers, we will see
--
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
[GitHub] [airflow] github-actions[bot] closed pull request #30749: Updated python.rst and Created example_taskflow_sensor.py
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #30749: Updated python.rst and Created example_taskflow_sensor.py
URL: https://github.com/apache/airflow/pull/30749
--
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
[GitHub] [airflow] rohan472000 commented on pull request #30749: Updated python.rst and Created example_taskflow_sensor.py
Posted by "rohan472000 (via GitHub)" <gi...@apache.org>.
rohan472000 commented on PR #30749:
URL: https://github.com/apache/airflow/pull/30749#issuecomment-1517423140
> Mark us as reviewers, we will see
You are already a reviewer for this PR, check in Reviewers.
--
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
[GitHub] [airflow] rohan472000 commented on pull request #30749: Updated python.rst and Created example_taskflow_sensor.py
Posted by "rohan472000 (via GitHub)" <gi...@apache.org>.
rohan472000 commented on PR #30749:
URL: https://github.com/apache/airflow/pull/30749#issuecomment-1516410192
@jedcunningham @pankajastro @ankit-gautam23 look into this PR and suggest any change if needed.
--
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
[GitHub] [airflow] pankajastro commented on a diff in pull request #30749: Updated python.rst and Created example_taskflow_sensor.py
Posted by "pankajastro (via GitHub)" <gi...@apache.org>.
pankajastro commented on code in PR #30749:
URL: https://github.com/apache/airflow/pull/30749#discussion_r1173864541
##########
airflow/example_dags/example_taskflow_sensor.py:
##########
@@ -0,0 +1,51 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import os
+
+from airflow import DAG
+from airflow.sensors.python import PythonSensor
+
+default_args = {"depends_on_past": False, "email_on_failure": False, "email_on_retry": False, "retries": 1}
+
+
+def my_taskflow_sensor():
+ # Check if the file exists OR you can give any logic
+ if os.path.exists("/././path_to_file"):
+ return True
+ else:
+ return False
+
+
+with DAG(
+ "example_dag",
+ default_args=default_args,
+ description="Example DAG with PythonSensor",
+ schedule_interval=None,
+ catchup=False,
+) as dag:
+ # [START example_taskflow_sensor]
+ t1 = PythonSensor(
Review Comment:
- example sensor with task flow API https://airflow.apache.org/docs/apache-airflow/stable/tutorial/taskflow.html#using-the-taskflow-api-with-sensor-operators
- PythonSensor example https://airflow.apache.org/docs/apache-airflow/stable/howto/operator/python.html#pythonsensor
so, not sure if we need this new example.
--
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